using System;
using System.Collections.Generic;
using System.Linq;

namespace PushPlatform.Data.Criteria
{
    public partial class CriteriaSelectItemDetail
    {
        
        public CriteriaSelectItemDetail()
        {
            TableName="SelectItemDetail";
            OrderList = new List<string>();
            PageIndex = 1;
            PageSize = 20;
            UsePage = true;
            UserWhere = false;
        }
        
        #region Criteria Property
        public string TableName { get; set; }
        
        public IList<string> OrderList { get; set; }
        
        public int PageIndex { get; set; }
        
        public int PageSize { get; set; }
        
        public int PageTotal { get; set; }
        
        public bool UsePage { get; set; }
        
        public bool UseOr { get; set; }
        
        public bool UserWhere { get; set; }
        
        public string Where { get; set; }
        
        public bool IsAsc { get; set; }
        
        public object WhereValue { get; set; }
        
        #endregion
    
        #region Criteria Field
        
        
        public const string CriteriaField = "Id";
        
        
        
        public const string FieldId = "Id";
        public const string MapId = "Id";
        public const string FieldValue = "Value";
        public const string MapValue = "Value";
        public const string FieldDescription = "Description";
        public const string MapDescription = "Description";
        public const string FieldSelectType = "SelectType";
        public const string MapSelectType = "Select_Type";
        public const string FieldCreateUser = "CreateUser";
        public const string MapCreateUser = "Create_User";
        public const string FieldCreateTime = "CreateTime";
        public const string MapCreateTime = "Create_Time";
        public const string FieldUpdateUser = "UpdateUser";
        public const string MapUpdateUser = "Update_User";
        public const string FieldUpdateTime = "UpdateTime";
        public const string MapUpdateTime = "Update_Time";
        public const string FieldIsDeleted = "IsDeleted";
        public const string MapIsDeleted = "Is_Deleted";
        public const string FieldTimestamp = "Timestamp";
        public const string MapTimestamp = "Timestamp";
        
        
        
        #endregion
        
        #region Criteria Auto Property
        
        public System.String LikeAll { get; set; }
        
        public System.String LikeId { get; set; }
        List<System.String> _InId;
        public List<System.String> InId
        {
            get
            {
                if (_InId == null) { _InId = new List<System.String>(); }
                return _InId;
            }
        }
        List<System.String> _NotId;
        public List<System.String> NotId
        {
            get
            {
                if (_NotId == null) { _NotId = new List<System.String>(); }
                return _NotId;
            }
        }
        List<System.String> _OrEqId;
        public List<System.String> OrEqId
        {
            get
            {
                if (_OrEqId == null) { _OrEqId = new List<System.String>(); }
                return _OrEqId;
            }
        }
        List<System.String> _OrLikeId;
        public List<System.String> OrLikeId
        {
            get
            {
                if (_OrLikeId == null) { _OrLikeId = new List<System.String>(); }
                return _OrLikeId;
            }
        }
        public System.String EqId { get; set; }
        public System.String NeId { get; set; }
        public System.String EqIgId { get; set; }
        public System.String LeId { get; set; }
        public System.String GeId { get; set; }
        public System.String LtId { get; set; }
        public System.String GtId { get; set; }
        public bool  NullId { get; set; }
        public bool  NotNullId { get; set; }
        public System.String LikeValue { get; set; }
        List<System.String> _InValue;
        public List<System.String> InValue
        {
            get
            {
                if (_InValue == null) { _InValue = new List<System.String>(); }
                return _InValue;
            }
        }
        List<System.String> _NotValue;
        public List<System.String> NotValue
        {
            get
            {
                if (_NotValue == null) { _NotValue = new List<System.String>(); }
                return _NotValue;
            }
        }
        List<System.String> _OrEqValue;
        public List<System.String> OrEqValue
        {
            get
            {
                if (_OrEqValue == null) { _OrEqValue = new List<System.String>(); }
                return _OrEqValue;
            }
        }
        List<System.String> _OrLikeValue;
        public List<System.String> OrLikeValue
        {
            get
            {
                if (_OrLikeValue == null) { _OrLikeValue = new List<System.String>(); }
                return _OrLikeValue;
            }
        }
        public System.String EqValue { get; set; }
        public System.String NeValue { get; set; }
        public System.String EqIgValue { get; set; }
        public System.String LeValue { get; set; }
        public System.String GeValue { get; set; }
        public System.String LtValue { get; set; }
        public System.String GtValue { get; set; }
        public bool  NullValue { get; set; }
        public bool  NotNullValue { get; set; }
        public System.String LikeDescription { get; set; }
        List<System.String> _InDescription;
        public List<System.String> InDescription
        {
            get
            {
                if (_InDescription == null) { _InDescription = new List<System.String>(); }
                return _InDescription;
            }
        }
        List<System.String> _NotDescription;
        public List<System.String> NotDescription
        {
            get
            {
                if (_NotDescription == null) { _NotDescription = new List<System.String>(); }
                return _NotDescription;
            }
        }
        List<System.String> _OrEqDescription;
        public List<System.String> OrEqDescription
        {
            get
            {
                if (_OrEqDescription == null) { _OrEqDescription = new List<System.String>(); }
                return _OrEqDescription;
            }
        }
        List<System.String> _OrLikeDescription;
        public List<System.String> OrLikeDescription
        {
            get
            {
                if (_OrLikeDescription == null) { _OrLikeDescription = new List<System.String>(); }
                return _OrLikeDescription;
            }
        }
        public System.String EqDescription { get; set; }
        public System.String NeDescription { get; set; }
        public System.String EqIgDescription { get; set; }
        public System.String LeDescription { get; set; }
        public System.String GeDescription { get; set; }
        public System.String LtDescription { get; set; }
        public System.String GtDescription { get; set; }
        public bool  NullDescription { get; set; }
        public bool  NotNullDescription { get; set; }
        List<System.Int32> _InSelectType;
        public List<System.Int32> InSelectType
        {
            get
            {
                if (_InSelectType == null) { _InSelectType = new List<System.Int32>(); }
                return _InSelectType;
            }
        }
        List<System.Int32> _NotSelectType;
        public List<System.Int32> NotSelectType
        {
            get
            {
                if (_NotSelectType == null) { _NotSelectType = new List<System.Int32>(); }
                return _NotSelectType;
            }
        }
        List<System.Int32> _OrEqSelectType;
        public List<System.Int32> OrEqSelectType
        {
            get
            {
                if (_OrEqSelectType == null) { _OrEqSelectType = new List<System.Int32>(); }
                return _OrEqSelectType;
            }
        }
        public System.Int32? EqSelectType { get; set; }
        public System.Int32? NeSelectType { get; set; }
        public System.Int32? EqIgSelectType { get; set; }
        public System.Int32? LeSelectType { get; set; }
        public System.Int32? GeSelectType { get; set; }
        public System.Int32? LtSelectType { get; set; }
        public System.Int32? GtSelectType { get; set; }
        public bool  NullSelectType { get; set; }
        public bool  NotNullSelectType { get; set; }
        public System.String LikeCreateUser { get; set; }
        List<System.String> _InCreateUser;
        public List<System.String> InCreateUser
        {
            get
            {
                if (_InCreateUser == null) { _InCreateUser = new List<System.String>(); }
                return _InCreateUser;
            }
        }
        List<System.String> _NotCreateUser;
        public List<System.String> NotCreateUser
        {
            get
            {
                if (_NotCreateUser == null) { _NotCreateUser = new List<System.String>(); }
                return _NotCreateUser;
            }
        }
        List<System.String> _OrEqCreateUser;
        public List<System.String> OrEqCreateUser
        {
            get
            {
                if (_OrEqCreateUser == null) { _OrEqCreateUser = new List<System.String>(); }
                return _OrEqCreateUser;
            }
        }
        List<System.String> _OrLikeCreateUser;
        public List<System.String> OrLikeCreateUser
        {
            get
            {
                if (_OrLikeCreateUser == null) { _OrLikeCreateUser = new List<System.String>(); }
                return _OrLikeCreateUser;
            }
        }
        public System.String EqCreateUser { get; set; }
        public System.String NeCreateUser { get; set; }
        public System.String EqIgCreateUser { get; set; }
        public System.String LeCreateUser { get; set; }
        public System.String GeCreateUser { get; set; }
        public System.String LtCreateUser { get; set; }
        public System.String GtCreateUser { get; set; }
        public bool  NullCreateUser { get; set; }
        public bool  NotNullCreateUser { get; set; }
        public System.DateTime? EqCreateTime { get; set; }
        public System.DateTime? NeCreateTime { get; set; }
        public System.DateTime? EqIgCreateTime { get; set; }
        public System.DateTime? LeCreateTime { get; set; }
        public System.DateTime? GeCreateTime { get; set; }
        public System.DateTime? LtCreateTime { get; set; }
        public System.DateTime? GtCreateTime { get; set; }
        public bool  NullCreateTime { get; set; }
        public bool  NotNullCreateTime { get; set; }
        public System.String LikeUpdateUser { get; set; }
        List<System.String> _InUpdateUser;
        public List<System.String> InUpdateUser
        {
            get
            {
                if (_InUpdateUser == null) { _InUpdateUser = new List<System.String>(); }
                return _InUpdateUser;
            }
        }
        List<System.String> _NotUpdateUser;
        public List<System.String> NotUpdateUser
        {
            get
            {
                if (_NotUpdateUser == null) { _NotUpdateUser = new List<System.String>(); }
                return _NotUpdateUser;
            }
        }
        List<System.String> _OrEqUpdateUser;
        public List<System.String> OrEqUpdateUser
        {
            get
            {
                if (_OrEqUpdateUser == null) { _OrEqUpdateUser = new List<System.String>(); }
                return _OrEqUpdateUser;
            }
        }
        List<System.String> _OrLikeUpdateUser;
        public List<System.String> OrLikeUpdateUser
        {
            get
            {
                if (_OrLikeUpdateUser == null) { _OrLikeUpdateUser = new List<System.String>(); }
                return _OrLikeUpdateUser;
            }
        }
        public System.String EqUpdateUser { get; set; }
        public System.String NeUpdateUser { get; set; }
        public System.String EqIgUpdateUser { get; set; }
        public System.String LeUpdateUser { get; set; }
        public System.String GeUpdateUser { get; set; }
        public System.String LtUpdateUser { get; set; }
        public System.String GtUpdateUser { get; set; }
        public bool  NullUpdateUser { get; set; }
        public bool  NotNullUpdateUser { get; set; }
        public System.DateTime? EqUpdateTime { get; set; }
        public System.DateTime? NeUpdateTime { get; set; }
        public System.DateTime? EqIgUpdateTime { get; set; }
        public System.DateTime? LeUpdateTime { get; set; }
        public System.DateTime? GeUpdateTime { get; set; }
        public System.DateTime? LtUpdateTime { get; set; }
        public System.DateTime? GtUpdateTime { get; set; }
        public bool  NullUpdateTime { get; set; }
        public bool  NotNullUpdateTime { get; set; }
        public System.SByte? EqIsDeleted { get; set; }
        public System.SByte? NeIsDeleted { get; set; }
        public System.SByte? EqIgIsDeleted { get; set; }
        public System.SByte? LeIsDeleted { get; set; }
        public System.SByte? GeIsDeleted { get; set; }
        public System.SByte? LtIsDeleted { get; set; }
        public System.SByte? GtIsDeleted { get; set; }
        public bool  NullIsDeleted { get; set; }
        public bool  NotNullIsDeleted { get; set; }
        public System.Int64? EqTimestamp { get; set; }
        public System.Int64? NeTimestamp { get; set; }
        public System.Int64? EqIgTimestamp { get; set; }
        public System.Int64? LeTimestamp { get; set; }
        public System.Int64? GeTimestamp { get; set; }
        public System.Int64? LtTimestamp { get; set; }
        public System.Int64? GtTimestamp { get; set; }
        public bool  NullTimestamp { get; set; }
        public bool  NotNullTimestamp { get; set; }
        
        
        
        #endregion
        
        
        #region Criteria Method
        
        public void AddOrder(string order)
        {
            this.AddOrder(order,false);
        }
        
        public void AddOrder(string order, bool isAsc)
        {
            if(isAsc)
            {
                this.OrderList.Add(order);
                IsAsc=true;
            }
            else
            {
                this.OrderList.Add(order);
                IsAsc=false;
            }
        }
        
        public void ClearOrder()
        {
            this.OrderList.Clear();
        }
        
        public void RemoveOrder(string order)
        {
            if(this.OrderList.Contains(order+",0"))
                this.OrderList.Remove(order+",0");
            if(this.OrderList.Contains(order+",1"))
                this.OrderList.Remove(order+",1");
        }
        
        #endregion
       
    }
}
