Beispiel #1
0
        /// <summary>
        ///DAL方法:分页查找数据库中的数据(首页数据为第1页)Row_Number开窗函数方法------>根据传入的参数分页查找数据,请传入查找排序的具体依据[说明:strAccord为数据库列名,strASCorDESC请填写"ASC"或"DESC"],返回IEnumerable&lt;T_HR_LDHTXX&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_LDHTXX> SelectT_HR_LDHTXXByPageRow_NumberUsingReader(int pageIndex, int pageSize, string strAccord, string strASCorDESC)
        {
            List <T_HR_LDHTXX> list = new List <T_HR_LDHTXX>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from ( select row_number() over(order by " + strAccord + " " + strASCorDESC + ") as rownum ,* from T_HR_LDHTXX )as tempTable where tempTable.rownum> " + ((pageIndex - 1) * pageSize).ToString() + " and tempTable.rownum<=" + (((pageIndex - 1) * pageSize) + pageSize).ToString() + ""))
            {
                while (reader.Read())
                {
                    T_HR_LDHTXX model = new T_HR_LDHTXX();
                    //开窗函数会多出一列,第一列为rownum,所以传入索引1开始
                    model.HT_ID    = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.RID      = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.HTBH     = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.HTLX     = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.KSRQ     = reader.IsDBNull(5) ? null : (DateTime?)reader.GetDateTime(5);
                    model.DQRQ     = reader.IsDBNull(6) ? null : (DateTime?)reader.GetDateTime(6);
                    model.DASZD    = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.LDSC     = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.BLLYSXRQ = reader.IsDBNull(9) ? null : (DateTime?)reader.GetDateTime(9);
                    model.BLBXRQ   = reader.IsDBNull(10) ? null : (DateTime?)reader.GetDateTime(10);
                    model.BLGJJRQ  = reader.IsDBNull(11) ? null : (DateTime?)reader.GetDateTime(11);
                    model.YXBS     = reader.IsDBNull(12) ? null : reader.GetString(12);
                    model.GXRID    = reader.IsDBNull(13) ? null : reader.GetString(13);
                    model.GXRXM    = reader.IsDBNull(14) ? null : reader.GetString(14);
                    model.GXLX     = reader.IsDBNull(15) ? null : reader.GetString(15);
                    model.GXYY     = reader.IsDBNull(16) ? null : reader.GetString(16);
                    list.Add(model);
                }
            }
            return(list);
        }
        /// <summary>
        ///DAL方法:查找数据库中的全部数据------>返回IEnumerable&lt;T_HR_BMXX&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_BMXX> SelectAllByReader()
        {
            List <T_HR_BMXX> list = new List <T_HR_BMXX>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_BMXX"))
            {
                while (reader.Read())
                {
                    T_HR_BMXX model = new T_HR_BMXX();
                    model.BM_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.BMBM  = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.BMMC  = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.CJRQ  = reader.IsDBNull(3) ? null : (DateTime?)reader.GetDateTime(3);
                    model.ZZMS  = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.FZR   = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.LXR   = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRID = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXRXM = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXLX  = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GXYY  = reader.IsDBNull(10) ? null : reader.GetString(10);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #3
0
        /// <summary>
        ///DAL方法:分页查找数据库中的数据(首页数据为第1页)not in select top...子查询方法------>根据传入的参数分页查找数据,请传入查找排序的具体依据[例如:select top pageSize * from...where strAccord not in...(select top pageSize strAccord from...)][说明:strAccord为数据库列名,strASCorDESC请填写"ASC"或"DESC"],返回IEnumerable&lt;T_HR_GZLL&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_GZLL> SelectT_HR_GZLLByPageUsingReader(int pageIndex, int pageSize, string strAccord, string strASCorDESC)
        {
            List <T_HR_GZLL> list = new List <T_HR_GZLL>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select top " + pageSize + " * from T_HR_GZLL  where " + strAccord + " not in (select top " + (pageIndex - 1) * pageSize + " " + strAccord + " from T_HR_GZLL order by " + strAccord + " " + strASCorDESC + ") order by " + strAccord + " " + strASCorDESC + ""))
            {
                while (reader.Read())
                {
                    T_HR_GZLL model = new T_HR_GZLL();
                    model.GZLL_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID     = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.QSRQ    = reader.IsDBNull(2) ? null : (DateTime?)reader.GetDateTime(2);
                    model.JZRQ    = reader.IsDBNull(3) ? null : (DateTime?)reader.GetDateTime(3);
                    model.GZDW    = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.ZW      = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.ZMR     = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRID   = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXRXM   = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXLX    = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GXYY    = reader.IsDBNull(10) ? null : reader.GetString(10);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #4
0
        /// <summary>
        ///DAL方法:查找数据库中的全部数据------>返回IEnumerable&lt;T_HR_GZLL&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_GZLL> SelectAllByReader()
        {
            List <T_HR_GZLL> list = new List <T_HR_GZLL>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_GZLL"))
            {
                while (reader.Read())
                {
                    T_HR_GZLL model = new T_HR_GZLL();
                    model.GZLL_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID     = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.QSRQ    = reader.IsDBNull(2) ? null : (DateTime?)reader.GetDateTime(2);
                    model.JZRQ    = reader.IsDBNull(3) ? null : (DateTime?)reader.GetDateTime(3);
                    model.GZDW    = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.ZW      = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.ZMR     = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRID   = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXRXM   = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXLX    = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GXYY    = reader.IsDBNull(10) ? null : reader.GetString(10);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #5
0
 /// <summary>
 ///DAL方法:查找数据库中的一条数据------>根据传入的参数查找数据,请传入数据库的列名以及查找对象的具体依据,返回T_HR_YGGZ对象类型性数据
 /// </summary>
 /// <returns></returns>
 public T_HR_YGGZ SelectSingleModelByReader(string strDBColumnName, string strSelId)
 {
     using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_YGGZ where " + strDBColumnName + " = @ID", new SqlParameter("ID", strSelId)))
     {
         if (reader.HasRows)
         {
             if (reader.Read())
             {
                 T_HR_YGGZ model = new T_HR_YGGZ();
                 model.GZ_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                 model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                 model.YXBS  = reader.IsDBNull(4) ? null : reader.GetString(4);
                 model.GXRID = reader.IsDBNull(5) ? null : reader.GetString(5);
                 model.GXRXM = reader.IsDBNull(6) ? null : reader.GetString(6);
                 model.GXLX  = reader.IsDBNull(7) ? null : reader.GetString(7);
                 model.GXYY  = reader.IsDBNull(8) ? null : reader.GetString(8);
                 return(model);
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             return(null);
         }
     }
 }
        /// <summary>
        ///DAL方法:查找数据库中的全部数据------>返回IEnumerable&lt;T_HR_FJZL&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_FJZL> SelectAllByReader()
        {
            List <T_HR_FJZL> list = new List <T_HR_FJZL>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_FJZL"))
            {
                while (reader.Read())
                {
                    T_HR_FJZL model = new T_HR_FJZL();
                    model.FJ_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.ZLLX  = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.WJLX  = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.ZLMC  = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.WJMC  = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.ZLNR  = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.BZ    = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXRID = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXRXM = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GXLX  = reader.IsDBNull(10) ? null : reader.GetString(10);
                    model.GXYY  = reader.IsDBNull(11) ? null : reader.GetString(11);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #7
0
        /// <summary>
        ///DAL方法:分页查找数据库中的数据(首页数据为第1页)Row_Number开窗函数方法------>根据传入的参数分页查找数据,请传入查找排序的具体依据[说明:strAccord为数据库列名,strASCorDESC请填写"ASC"或"DESC"],返回IEnumerable&lt;T_HR_GZLL&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_GZLL> SelectT_HR_GZLLByPageRow_NumberUsingReader(int pageIndex, int pageSize, string strAccord, string strASCorDESC)
        {
            List <T_HR_GZLL> list = new List <T_HR_GZLL>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from ( select row_number() over(order by " + strAccord + " " + strASCorDESC + ") as rownum ,* from T_HR_GZLL )as tempTable where tempTable.rownum> " + ((pageIndex - 1) * pageSize).ToString() + " and tempTable.rownum<=" + (((pageIndex - 1) * pageSize) + pageSize).ToString() + ""))
            {
                while (reader.Read())
                {
                    T_HR_GZLL model = new T_HR_GZLL();
                    //开窗函数会多出一列,第一列为rownum,所以传入索引1开始
                    model.GZLL_ID = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.RID     = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.QSRQ    = reader.IsDBNull(3) ? null : (DateTime?)reader.GetDateTime(3);
                    model.JZRQ    = reader.IsDBNull(4) ? null : (DateTime?)reader.GetDateTime(4);
                    model.GZDW    = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.ZW      = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.ZMR     = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXRID   = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXRXM   = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GXLX    = reader.IsDBNull(10) ? null : reader.GetString(10);
                    model.GXYY    = reader.IsDBNull(11) ? null : reader.GetString(11);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #8
0
        /// <summary>
        ///DAL方法:分页查找数据库中的数据(首页数据为第1页)not in select top...子查询方法------>根据传入的参数分页查找数据,请传入查找排序的具体依据[例如:select top pageSize * from...where strAccord not in...(select top pageSize strAccord from...)][说明:strAccord为数据库列名,strASCorDESC请填写"ASC"或"DESC"],返回IEnumerable&lt;T_HR_JTCY&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_JTCY> SelectT_HR_JTCYByPageUsingReader(int pageIndex, int pageSize, string strAccord, string strASCorDESC)
        {
            List <T_HR_JTCY> list = new List <T_HR_JTCY>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select top " + pageSize + " * from T_HR_JTCY  where " + strAccord + " not in (select top " + (pageIndex - 1) * pageSize + " " + strAccord + " from T_HR_JTCY order by " + strAccord + " " + strASCorDESC + ") order by " + strAccord + " " + strASCorDESC + ""))
            {
                while (reader.Read())
                {
                    T_HR_JTCY model = new T_HR_JTCY();
                    model.ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.XM    = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.CW    = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.CSRQ  = reader.IsDBNull(4) ? null : (DateTime?)reader.GetDateTime(4);
                    model.JG    = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.MZ    = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.XL    = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.XW    = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.ZZMM  = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GZDW  = reader.IsDBNull(10) ? null : reader.GetString(10);
                    model.ZW    = reader.IsDBNull(11) ? null : reader.GetString(11);
                    model.LXDH  = reader.IsDBNull(12) ? null : reader.GetString(12);
                    model.GXRID = reader.IsDBNull(13) ? null : reader.GetString(13);
                    model.GXRXM = reader.IsDBNull(14) ? null : reader.GetString(14);
                    model.GXLX  = reader.IsDBNull(15) ? null : reader.GetString(15);
                    model.GXYY  = reader.IsDBNull(16) ? null : reader.GetString(16);
                    list.Add(model);
                }
            }
            return(list);
        }
 /// <summary>
 ///DAL方法:查找数据库中的一条数据------>根据传入的参数查找数据,请传入数据库的列名以及查找对象的具体依据,返回T_HR_FJZL对象类型性数据
 /// </summary>
 /// <returns></returns>
 public T_HR_FJZL SelectSingleModelByReader(string strDBColumnName, string strSelId)
 {
     using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_FJZL where " + strDBColumnName + " = @ID", new SqlParameter("ID", strSelId)))
     {
         if (reader.HasRows)
         {
             if (reader.Read())
             {
                 T_HR_FJZL model = new T_HR_FJZL();
                 model.FJ_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                 model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                 model.ZLLX  = reader.IsDBNull(2) ? null : reader.GetString(2);
                 model.WJLX  = reader.IsDBNull(3) ? null : reader.GetString(3);
                 model.ZLMC  = reader.IsDBNull(4) ? null : reader.GetString(4);
                 model.WJMC  = reader.IsDBNull(5) ? null : reader.GetString(5);
                 model.ZLNR  = reader.IsDBNull(6) ? null : reader.GetString(6);
                 model.BZ    = reader.IsDBNull(7) ? null : reader.GetString(7);
                 model.GXRID = reader.IsDBNull(8) ? null : reader.GetString(8);
                 model.GXRXM = reader.IsDBNull(9) ? null : reader.GetString(9);
                 model.GXLX  = reader.IsDBNull(10) ? null : reader.GetString(10);
                 model.GXYY  = reader.IsDBNull(11) ? null : reader.GetString(11);
                 return(model);
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             return(null);
         }
     }
 }
Beispiel #10
0
        /// <summary>
        ///DAL方法:查找数据库中的全部数据------>返回IEnumerable&lt;T_HR_LDHTXX&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_LDHTXX> SelectAllByReader()
        {
            List <T_HR_LDHTXX> list = new List <T_HR_LDHTXX>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_LDHTXX"))
            {
                while (reader.Read())
                {
                    T_HR_LDHTXX model = new T_HR_LDHTXX();
                    model.HT_ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID      = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.HTBH     = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.HTLX     = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.KSRQ     = reader.IsDBNull(4) ? null : (DateTime?)reader.GetDateTime(4);
                    model.DQRQ     = reader.IsDBNull(5) ? null : (DateTime?)reader.GetDateTime(5);
                    model.DASZD    = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.LDSC     = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.BLLYSXRQ = reader.IsDBNull(8) ? null : (DateTime?)reader.GetDateTime(8);
                    model.BLBXRQ   = reader.IsDBNull(9) ? null : (DateTime?)reader.GetDateTime(9);
                    model.BLGJJRQ  = reader.IsDBNull(10) ? null : (DateTime?)reader.GetDateTime(10);
                    model.YXBS     = reader.IsDBNull(11) ? null : reader.GetString(11);
                    model.GXRID    = reader.IsDBNull(12) ? null : reader.GetString(12);
                    model.GXRXM    = reader.IsDBNull(13) ? null : reader.GetString(13);
                    model.GXLX     = reader.IsDBNull(14) ? null : reader.GetString(14);
                    model.GXYY     = reader.IsDBNull(15) ? null : reader.GetString(15);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #11
0
        /// <summary>
        ///DAL方法:查找数据库中的全部数据------>返回IEnumerable&lt;T_HR_JTCY&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_JTCY> SelectAllByReader()
        {
            List <T_HR_JTCY> list = new List <T_HR_JTCY>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_JTCY"))
            {
                while (reader.Read())
                {
                    T_HR_JTCY model = new T_HR_JTCY();
                    model.ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.XM    = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.CW    = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.CSRQ  = reader.IsDBNull(4) ? null : (DateTime?)reader.GetDateTime(4);
                    model.JG    = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.MZ    = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.XL    = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.XW    = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.ZZMM  = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GZDW  = reader.IsDBNull(10) ? null : reader.GetString(10);
                    model.ZW    = reader.IsDBNull(11) ? null : reader.GetString(11);
                    model.LXDH  = reader.IsDBNull(12) ? null : reader.GetString(12);
                    model.GXRID = reader.IsDBNull(13) ? null : reader.GetString(13);
                    model.GXRXM = reader.IsDBNull(14) ? null : reader.GetString(14);
                    model.GXLX  = reader.IsDBNull(15) ? null : reader.GetString(15);
                    model.GXYY  = reader.IsDBNull(16) ? null : reader.GetString(16);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #12
0
        /// <summary>
        ///DAL方法:分页查找数据库中的数据(首页数据为第1页)not in select top...子查询方法------>根据传入的参数分页查找数据,请传入查找排序的具体依据[例如:select top pageSize * from...where strAccord not in...(select top pageSize strAccord from...)][说明:strAccord为数据库列名,strASCorDESC请填写"ASC"或"DESC"],返回IEnumerable&lt;T_HR_LDHTXX&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_LDHTXX> SelectT_HR_LDHTXXByPageUsingReader(int pageIndex, int pageSize, string strAccord, string strASCorDESC)
        {
            List <T_HR_LDHTXX> list = new List <T_HR_LDHTXX>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select top " + pageSize + " * from T_HR_LDHTXX  where " + strAccord + " not in (select top " + (pageIndex - 1) * pageSize + " " + strAccord + " from T_HR_LDHTXX order by " + strAccord + " " + strASCorDESC + ") order by " + strAccord + " " + strASCorDESC + ""))
            {
                while (reader.Read())
                {
                    T_HR_LDHTXX model = new T_HR_LDHTXX();
                    model.HT_ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID      = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.HTBH     = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.HTLX     = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.KSRQ     = reader.IsDBNull(4) ? null : (DateTime?)reader.GetDateTime(4);
                    model.DQRQ     = reader.IsDBNull(5) ? null : (DateTime?)reader.GetDateTime(5);
                    model.DASZD    = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.LDSC     = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.BLLYSXRQ = reader.IsDBNull(8) ? null : (DateTime?)reader.GetDateTime(8);
                    model.BLBXRQ   = reader.IsDBNull(9) ? null : (DateTime?)reader.GetDateTime(9);
                    model.BLGJJRQ  = reader.IsDBNull(10) ? null : (DateTime?)reader.GetDateTime(10);
                    model.YXBS     = reader.IsDBNull(11) ? null : reader.GetString(11);
                    model.GXRID    = reader.IsDBNull(12) ? null : reader.GetString(12);
                    model.GXRXM    = reader.IsDBNull(13) ? null : reader.GetString(13);
                    model.GXLX     = reader.IsDBNull(14) ? null : reader.GetString(14);
                    model.GXYY     = reader.IsDBNull(15) ? null : reader.GetString(15);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #13
0
 /// <summary>
 ///DAL方法:查找数据库中的一条数据------>根据传入的参数查找数据,请传入数据库的列名以及查找对象的具体依据,返回T_HR_GZLL对象类型性数据
 /// </summary>
 /// <returns></returns>
 public T_HR_GZLL SelectSingleModelByReader(string strDBColumnName, string strSelId)
 {
     using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_GZLL where " + strDBColumnName + " = @ID", new SqlParameter("ID", strSelId)))
     {
         if (reader.HasRows)
         {
             if (reader.Read())
             {
                 T_HR_GZLL model = new T_HR_GZLL();
                 model.GZLL_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                 model.RID     = reader.IsDBNull(1) ? null : reader.GetString(1);
                 model.QSRQ    = reader.IsDBNull(2) ? null : (DateTime?)reader.GetDateTime(2);
                 model.JZRQ    = reader.IsDBNull(3) ? null : (DateTime?)reader.GetDateTime(3);
                 model.GZDW    = reader.IsDBNull(4) ? null : reader.GetString(4);
                 model.ZW      = reader.IsDBNull(5) ? null : reader.GetString(5);
                 model.ZMR     = reader.IsDBNull(6) ? null : reader.GetString(6);
                 model.GXRID   = reader.IsDBNull(7) ? null : reader.GetString(7);
                 model.GXRXM   = reader.IsDBNull(8) ? null : reader.GetString(8);
                 model.GXLX    = reader.IsDBNull(9) ? null : reader.GetString(9);
                 model.GXYY    = reader.IsDBNull(10) ? null : reader.GetString(10);
                 return(model);
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             return(null);
         }
     }
 }
Beispiel #14
0
 /// <summary>
 ///DAL方法:查找数据库中的一条数据------>根据传入的参数查找数据,请传入数据库的列名以及查找对象的具体依据,返回T_HR_RXXX对象类型性数据
 /// </summary>
 /// <returns></returns>
 public T_HR_RXXX SelectSingleModelByReader(string strDBColumnName, string strSelId)
 {
     using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_RXXX where " + strDBColumnName + " = @ID", new SqlParameter("ID", strSelId)))
     {
         if (reader.HasRows)
         {
             if (reader.Read())
             {
                 T_HR_RXXX model = new T_HR_RXXX();
                 model.ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                 model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                 model.PSSJ  = reader.IsDBNull(2) ? null : (DateTime?)reader.GetDateTime(2);
                 model.LX    = reader.IsDBNull(3) ? null : reader.GetString(3);
                 model.YT    = reader.IsDBNull(4) ? null : reader.GetString(4);
                 model.XP    = reader.IsDBNull(5) ? null : reader.GetString(5);
                 model.GXRID = reader.IsDBNull(6) ? null : reader.GetString(6);
                 model.GXRXM = reader.IsDBNull(7) ? null : reader.GetString(7);
                 model.GXLX  = reader.IsDBNull(8) ? null : reader.GetString(8);
                 return(model);
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             return(null);
         }
     }
 }
Beispiel #15
0
        /// <summary>
        ///DAL方法:查找数据库中的全部数据------>返回IEnumerable&lt;T_HR_YGGZ&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_YGGZ> SelectAllByReader()
        {
            List <T_HR_YGGZ> list = new List <T_HR_YGGZ>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_YGGZ"))
            {
                while (reader.Read())
                {
                    T_HR_YGGZ model = new T_HR_YGGZ();
                    model.GZ_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.YXBS  = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.GXRID = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.GXRXM = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXLX  = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXYY  = reader.IsDBNull(8) ? null : reader.GetString(8);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #16
0
        /// <summary>
        ///DAL方法:分页查找数据库中的数据(首页数据为第1页)not in select top...子查询方法------>根据传入的参数分页查找数据,请传入查找排序的具体依据[例如:select top pageSize * from...where strAccord not in...(select top pageSize strAccord from...)][说明:strAccord为数据库列名,strASCorDESC请填写"ASC"或"DESC"],返回IEnumerable&lt;T_HR_YGGZ&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_YGGZ> SelectT_HR_YGGZByPageUsingReader(int pageIndex, int pageSize, string strAccord, string strASCorDESC)
        {
            List <T_HR_YGGZ> list = new List <T_HR_YGGZ>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select top " + pageSize + " * from T_HR_YGGZ  where " + strAccord + " not in (select top " + (pageIndex - 1) * pageSize + " " + strAccord + " from T_HR_YGGZ order by " + strAccord + " " + strASCorDESC + ") order by " + strAccord + " " + strASCorDESC + ""))
            {
                while (reader.Read())
                {
                    T_HR_YGGZ model = new T_HR_YGGZ();
                    model.GZ_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.YXBS  = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.GXRID = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.GXRXM = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXLX  = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXYY  = reader.IsDBNull(8) ? null : reader.GetString(8);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #17
0
 /// <summary>
 ///DAL方法:查找数据库中的一条数据------>根据传入的参数查找数据,请传入数据库的列名以及查找对象的具体依据,返回T_HR_JTCY对象类型性数据
 /// </summary>
 /// <returns></returns>
 public T_HR_JTCY SelectSingleModelByReader(string strDBColumnName, string strSelId)
 {
     using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_JTCY where " + strDBColumnName + " = @ID", new SqlParameter("ID", strSelId)))
     {
         if (reader.HasRows)
         {
             if (reader.Read())
             {
                 T_HR_JTCY model = new T_HR_JTCY();
                 model.ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                 model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                 model.XM    = reader.IsDBNull(2) ? null : reader.GetString(2);
                 model.CW    = reader.IsDBNull(3) ? null : reader.GetString(3);
                 model.CSRQ  = reader.IsDBNull(4) ? null : (DateTime?)reader.GetDateTime(4);
                 model.JG    = reader.IsDBNull(5) ? null : reader.GetString(5);
                 model.MZ    = reader.IsDBNull(6) ? null : reader.GetString(6);
                 model.XL    = reader.IsDBNull(7) ? null : reader.GetString(7);
                 model.XW    = reader.IsDBNull(8) ? null : reader.GetString(8);
                 model.ZZMM  = reader.IsDBNull(9) ? null : reader.GetString(9);
                 model.GZDW  = reader.IsDBNull(10) ? null : reader.GetString(10);
                 model.ZW    = reader.IsDBNull(11) ? null : reader.GetString(11);
                 model.LXDH  = reader.IsDBNull(12) ? null : reader.GetString(12);
                 model.GXRID = reader.IsDBNull(13) ? null : reader.GetString(13);
                 model.GXRXM = reader.IsDBNull(14) ? null : reader.GetString(14);
                 model.GXLX  = reader.IsDBNull(15) ? null : reader.GetString(15);
                 model.GXYY  = reader.IsDBNull(16) ? null : reader.GetString(16);
                 return(model);
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             return(null);
         }
     }
 }
Beispiel #18
0
 /// <summary>
 ///DAL方法:查找数据库中的一条数据------>根据传入的参数查找数据,请传入数据库的列名以及查找对象的具体依据,返回T_HR_LDHTXX对象类型性数据
 /// </summary>
 /// <returns></returns>
 public T_HR_LDHTXX SelectSingleModelByReader(string strDBColumnName, string strSelId)
 {
     using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_LDHTXX where " + strDBColumnName + " = @ID", new SqlParameter("ID", strSelId)))
     {
         if (reader.HasRows)
         {
             if (reader.Read())
             {
                 T_HR_LDHTXX model = new T_HR_LDHTXX();
                 model.HT_ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                 model.RID      = reader.IsDBNull(1) ? null : reader.GetString(1);
                 model.HTBH     = reader.IsDBNull(2) ? null : reader.GetString(2);
                 model.HTLX     = reader.IsDBNull(3) ? null : reader.GetString(3);
                 model.KSRQ     = reader.IsDBNull(4) ? null : (DateTime?)reader.GetDateTime(4);
                 model.DQRQ     = reader.IsDBNull(5) ? null : (DateTime?)reader.GetDateTime(5);
                 model.DASZD    = reader.IsDBNull(6) ? null : reader.GetString(6);
                 model.LDSC     = reader.IsDBNull(7) ? null : reader.GetString(7);
                 model.BLLYSXRQ = reader.IsDBNull(8) ? null : (DateTime?)reader.GetDateTime(8);
                 model.BLBXRQ   = reader.IsDBNull(9) ? null : (DateTime?)reader.GetDateTime(9);
                 model.BLGJJRQ  = reader.IsDBNull(10) ? null : (DateTime?)reader.GetDateTime(10);
                 model.YXBS     = reader.IsDBNull(11) ? null : reader.GetString(11);
                 model.GXRID    = reader.IsDBNull(12) ? null : reader.GetString(12);
                 model.GXRXM    = reader.IsDBNull(13) ? null : reader.GetString(13);
                 model.GXLX     = reader.IsDBNull(14) ? null : reader.GetString(14);
                 model.GXYY     = reader.IsDBNull(15) ? null : reader.GetString(15);
                 return(model);
             }
             else
             {
                 return(null);
             }
         }
         else
         {
             return(null);
         }
     }
 }
Beispiel #19
0
        /// <summary>
        ///DAL方法:分页查找数据库中的数据(首页数据为第1页)not in select top...子查询方法------>根据传入的参数分页查找数据,请传入查找排序的具体依据[例如:select top pageSize * from...where strAccord not in...(select top pageSize strAccord from...)][说明:strAccord为数据库列名,strASCorDESC请填写"ASC"或"DESC"],返回IEnumerable&lt;T_HR_RXXX&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_RXXX> SelectT_HR_RXXXByPageUsingReader(int pageIndex, int pageSize, string strAccord, string strASCorDESC)
        {
            List <T_HR_RXXX> list = new List <T_HR_RXXX>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select top " + pageSize + " * from T_HR_RXXX  where " + strAccord + " not in (select top " + (pageIndex - 1) * pageSize + " " + strAccord + " from T_HR_RXXX order by " + strAccord + " " + strASCorDESC + ") order by " + strAccord + " " + strASCorDESC + ""))
            {
                while (reader.Read())
                {
                    T_HR_RXXX model = new T_HR_RXXX();
                    model.ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.PSSJ  = reader.IsDBNull(2) ? null : (DateTime?)reader.GetDateTime(2);
                    model.LX    = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.YT    = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.XP    = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.GXRID = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRXM = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXLX  = reader.IsDBNull(8) ? null : reader.GetString(8);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #20
0
        /// <summary>
        ///DAL方法:查找数据库中的全部数据------>返回IEnumerable&lt;T_HR_RXXX&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_RXXX> SelectAllByReader()
        {
            List <T_HR_RXXX> list = new List <T_HR_RXXX>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_RXXX"))
            {
                while (reader.Read())
                {
                    T_HR_RXXX model = new T_HR_RXXX();
                    model.ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.PSSJ  = reader.IsDBNull(2) ? null : (DateTime?)reader.GetDateTime(2);
                    model.LX    = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.YT    = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.XP    = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.GXRID = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRXM = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXLX  = reader.IsDBNull(8) ? null : reader.GetString(8);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #21
0
        /// <summary>
        ///DAL方法:查找数据库中的全部数据------>返回IEnumerable&lt;T_HR_JCQK&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_JCQK> SelectAllByReader()
        {
            List <T_HR_JCQK> list = new List <T_HR_JCQK>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader("select * from T_HR_JCQK"))
            {
                while (reader.Read())
                {
                    T_HR_JCQK model = new T_HR_JCQK();
                    model.JCQK_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID     = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.JCQK    = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.JCDJ    = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.JCDW    = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.JCSJ    = reader.IsDBNull(5) ? null : (DateTime?)reader.GetDateTime(5);
                    model.GXRID   = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRXM   = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXLX    = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXYY    = reader.IsDBNull(9) ? null : reader.GetString(9);
                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #22
0
        /// <summary>
        ///DAL方法:模糊查找数据库中符合条件的全部数据------>返回IEnumerable&lt;T_HR_LDHTXX&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_LDHTXX> FuzzyQueryByReader(bool HT_IDIsChecked, string HT_ID, bool RIDIsChecked, string RID, bool HTBHIsChecked, string HTBH, bool HTLXIsChecked, string HTLX, bool KSRQIsChecked, string KSRQ, bool DQRQIsChecked, string DQRQ, bool DASZDIsChecked, string DASZD, bool LDSCIsChecked, string LDSC, bool BLLYSXRQIsChecked, string BLLYSXRQ, bool BLBXRQIsChecked, string BLBXRQ, bool BLGJJRQIsChecked, string BLGJJRQ, bool YXBSIsChecked, string YXBS, bool GXRIDIsChecked, string GXRID, bool GXRXMIsChecked, string GXRXM, bool GXLXIsChecked, string GXLX, bool GXYYIsChecked, string GXYY, bool GXSJIsChecked, string GXSJ)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from T_HR_LDHTXX");
            List <string>       list          = new List <string>();
            List <SqlParameter> listParameter = new List <SqlParameter>();

            if (HT_IDIsChecked)
            {
                list.Add("HT_ID like @HT_ID");
                listParameter.Add(new SqlParameter("HT_ID", "%" + HT_ID + "%"));
            }
            if (RIDIsChecked)
            {
                list.Add("RID like @RID");
                listParameter.Add(new SqlParameter("RID", "%" + RID + "%"));
            }
            if (HTBHIsChecked)
            {
                list.Add("HTBH like @HTBH");
                listParameter.Add(new SqlParameter("HTBH", "%" + HTBH + "%"));
            }
            if (HTLXIsChecked)
            {
                list.Add("HTLX like @HTLX");
                listParameter.Add(new SqlParameter("HTLX", "%" + HTLX + "%"));
            }
            if (KSRQIsChecked)
            {
                list.Add("KSRQ like @KSRQ");
                listParameter.Add(new SqlParameter("KSRQ", "%" + KSRQ + "%"));
            }
            if (DQRQIsChecked)
            {
                list.Add("DQRQ like @DQRQ");
                listParameter.Add(new SqlParameter("DQRQ", "%" + DQRQ + "%"));
            }
            if (DASZDIsChecked)
            {
                list.Add("DASZD like @DASZD");
                listParameter.Add(new SqlParameter("DASZD", "%" + DASZD + "%"));
            }
            if (LDSCIsChecked)
            {
                list.Add("LDSC like @LDSC");
                listParameter.Add(new SqlParameter("LDSC", "%" + LDSC + "%"));
            }
            if (BLLYSXRQIsChecked)
            {
                list.Add("BLLYSXRQ like @BLLYSXRQ");
                listParameter.Add(new SqlParameter("BLLYSXRQ", "%" + BLLYSXRQ + "%"));
            }
            if (BLBXRQIsChecked)
            {
                list.Add("BLBXRQ like @BLBXRQ");
                listParameter.Add(new SqlParameter("BLBXRQ", "%" + BLBXRQ + "%"));
            }
            if (BLGJJRQIsChecked)
            {
                list.Add("BLGJJRQ like @BLGJJRQ");
                listParameter.Add(new SqlParameter("BLGJJRQ", "%" + BLGJJRQ + "%"));
            }
            if (YXBSIsChecked)
            {
                list.Add("YXBS like @YXBS");
                listParameter.Add(new SqlParameter("YXBS", "%" + YXBS + "%"));
            }
            if (GXRIDIsChecked)
            {
                list.Add("GXRID like @GXRID");
                listParameter.Add(new SqlParameter("GXRID", "%" + GXRID + "%"));
            }
            if (GXRXMIsChecked)
            {
                list.Add("GXRXM like @GXRXM");
                listParameter.Add(new SqlParameter("GXRXM", "%" + GXRXM + "%"));
            }
            if (GXLXIsChecked)
            {
                list.Add("GXLX like @GXLX");
                listParameter.Add(new SqlParameter("GXLX", "%" + GXLX + "%"));
            }
            if (GXYYIsChecked)
            {
                list.Add("GXYY like @GXYY");
                listParameter.Add(new SqlParameter("GXYY", "%" + GXYY + "%"));
            }
            if (GXSJIsChecked)
            {
                list.Add("GXSJ like @GXSJ");
                listParameter.Add(new SqlParameter("GXSJ", "%" + GXSJ + "%"));
            }
            if (list.Count > 0)
            {
                sb.Append(" where ");
                string sql = string.Join(" and ", list.ToArray());
                sb.Append(sql);
            }
            List <T_HR_LDHTXX> listT_HR_LDHTXX = new List <T_HR_LDHTXX>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader(sb.ToString(), listParameter.ToArray()))
            {
                while (reader.Read())
                {
                    T_HR_LDHTXX model = new T_HR_LDHTXX();
                    model.HT_ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID      = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.HTBH     = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.HTLX     = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.KSRQ     = reader.IsDBNull(4) ? null : (DateTime?)reader.GetDateTime(4);
                    model.DQRQ     = reader.IsDBNull(5) ? null : (DateTime?)reader.GetDateTime(5);
                    model.DASZD    = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.LDSC     = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.BLLYSXRQ = reader.IsDBNull(8) ? null : (DateTime?)reader.GetDateTime(8);
                    model.BLBXRQ   = reader.IsDBNull(9) ? null : (DateTime?)reader.GetDateTime(9);
                    model.BLGJJRQ  = reader.IsDBNull(10) ? null : (DateTime?)reader.GetDateTime(10);
                    model.YXBS     = reader.IsDBNull(11) ? null : reader.GetString(11);
                    model.GXRID    = reader.IsDBNull(12) ? null : reader.GetString(12);
                    model.GXRXM    = reader.IsDBNull(13) ? null : reader.GetString(13);
                    model.GXLX     = reader.IsDBNull(14) ? null : reader.GetString(14);
                    model.GXYY     = reader.IsDBNull(15) ? null : reader.GetString(15);
                    listT_HR_LDHTXX.Add(model);
                }
            }
            return(listT_HR_LDHTXX);
        }
Beispiel #23
0
        /// <summary>
        ///DAL方法:模糊查找数据库中符合条件的全部数据------>返回IEnumerable&lt;T_HR_JTCY&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_JTCY> FuzzyQueryByReader(bool IDIsChecked, string ID, bool RIDIsChecked, string RID, bool XMIsChecked, string XM, bool CWIsChecked, string CW, bool CSRQIsChecked, string CSRQ, bool JGIsChecked, string JG, bool MZIsChecked, string MZ, bool XLIsChecked, string XL, bool XWIsChecked, string XW, bool ZZMMIsChecked, string ZZMM, bool GZDWIsChecked, string GZDW, bool ZWIsChecked, string ZW, bool LXDHIsChecked, string LXDH, bool GXRIDIsChecked, string GXRID, bool GXRXMIsChecked, string GXRXM, bool GXLXIsChecked, string GXLX, bool GXYYIsChecked, string GXYY, bool GXSJIsChecked, string GXSJ)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from T_HR_JTCY");
            List <string>       list          = new List <string>();
            List <SqlParameter> listParameter = new List <SqlParameter>();

            if (IDIsChecked)
            {
                list.Add("ID like @ID");
                listParameter.Add(new SqlParameter("ID", "%" + ID + "%"));
            }
            if (RIDIsChecked)
            {
                list.Add("RID like @RID");
                listParameter.Add(new SqlParameter("RID", "%" + RID + "%"));
            }
            if (XMIsChecked)
            {
                list.Add("XM like @XM");
                listParameter.Add(new SqlParameter("XM", "%" + XM + "%"));
            }
            if (CWIsChecked)
            {
                list.Add("CW like @CW");
                listParameter.Add(new SqlParameter("CW", "%" + CW + "%"));
            }
            if (CSRQIsChecked)
            {
                list.Add("CSRQ like @CSRQ");
                listParameter.Add(new SqlParameter("CSRQ", "%" + CSRQ + "%"));
            }
            if (JGIsChecked)
            {
                list.Add("JG like @JG");
                listParameter.Add(new SqlParameter("JG", "%" + JG + "%"));
            }
            if (MZIsChecked)
            {
                list.Add("MZ like @MZ");
                listParameter.Add(new SqlParameter("MZ", "%" + MZ + "%"));
            }
            if (XLIsChecked)
            {
                list.Add("XL like @XL");
                listParameter.Add(new SqlParameter("XL", "%" + XL + "%"));
            }
            if (XWIsChecked)
            {
                list.Add("XW like @XW");
                listParameter.Add(new SqlParameter("XW", "%" + XW + "%"));
            }
            if (ZZMMIsChecked)
            {
                list.Add("ZZMM like @ZZMM");
                listParameter.Add(new SqlParameter("ZZMM", "%" + ZZMM + "%"));
            }
            if (GZDWIsChecked)
            {
                list.Add("GZDW like @GZDW");
                listParameter.Add(new SqlParameter("GZDW", "%" + GZDW + "%"));
            }
            if (ZWIsChecked)
            {
                list.Add("ZW like @ZW");
                listParameter.Add(new SqlParameter("ZW", "%" + ZW + "%"));
            }
            if (LXDHIsChecked)
            {
                list.Add("LXDH like @LXDH");
                listParameter.Add(new SqlParameter("LXDH", "%" + LXDH + "%"));
            }
            if (GXRIDIsChecked)
            {
                list.Add("GXRID like @GXRID");
                listParameter.Add(new SqlParameter("GXRID", "%" + GXRID + "%"));
            }
            if (GXRXMIsChecked)
            {
                list.Add("GXRXM like @GXRXM");
                listParameter.Add(new SqlParameter("GXRXM", "%" + GXRXM + "%"));
            }
            if (GXLXIsChecked)
            {
                list.Add("GXLX like @GXLX");
                listParameter.Add(new SqlParameter("GXLX", "%" + GXLX + "%"));
            }
            if (GXYYIsChecked)
            {
                list.Add("GXYY like @GXYY");
                listParameter.Add(new SqlParameter("GXYY", "%" + GXYY + "%"));
            }
            if (GXSJIsChecked)
            {
                list.Add("GXSJ like @GXSJ");
                listParameter.Add(new SqlParameter("GXSJ", "%" + GXSJ + "%"));
            }
            if (list.Count > 0)
            {
                sb.Append(" where ");
                string sql = string.Join(" and ", list.ToArray());
                sb.Append(sql);
            }
            List <T_HR_JTCY> listT_HR_JTCY = new List <T_HR_JTCY>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader(sb.ToString(), listParameter.ToArray()))
            {
                while (reader.Read())
                {
                    T_HR_JTCY model = new T_HR_JTCY();
                    model.ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.XM    = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.CW    = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.CSRQ  = reader.IsDBNull(4) ? null : (DateTime?)reader.GetDateTime(4);
                    model.JG    = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.MZ    = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.XL    = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.XW    = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.ZZMM  = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GZDW  = reader.IsDBNull(10) ? null : reader.GetString(10);
                    model.ZW    = reader.IsDBNull(11) ? null : reader.GetString(11);
                    model.LXDH  = reader.IsDBNull(12) ? null : reader.GetString(12);
                    model.GXRID = reader.IsDBNull(13) ? null : reader.GetString(13);
                    model.GXRXM = reader.IsDBNull(14) ? null : reader.GetString(14);
                    model.GXLX  = reader.IsDBNull(15) ? null : reader.GetString(15);
                    model.GXYY  = reader.IsDBNull(16) ? null : reader.GetString(16);
                    listT_HR_JTCY.Add(model);
                }
            }
            return(listT_HR_JTCY);
        }
Beispiel #24
0
        /// <summary>
        ///DAL方法:模糊查找数据库中符合条件的全部数据------>返回IEnumerable&lt;T_HR_FJZL&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_FJZL> FuzzyQueryByReader(bool FJ_IDIsChecked, string FJ_ID, bool RIDIsChecked, string RID, bool ZLLXIsChecked, string ZLLX, bool WJLXIsChecked, string WJLX, bool ZLMCIsChecked, string ZLMC, bool WJMCIsChecked, string WJMC, bool ZLNRIsChecked, string ZLNR, bool BZIsChecked, string BZ, bool GXRIDIsChecked, string GXRID, bool GXRXMIsChecked, string GXRXM, bool GXLXIsChecked, string GXLX, bool GXYYIsChecked, string GXYY, bool GXSJIsChecked, string GXSJ)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from T_HR_FJZL");
            List <string>       list          = new List <string>();
            List <SqlParameter> listParameter = new List <SqlParameter>();

            if (FJ_IDIsChecked)
            {
                list.Add("FJ_ID like @FJ_ID");
                listParameter.Add(new SqlParameter("FJ_ID", "%" + FJ_ID + "%"));
            }
            if (RIDIsChecked)
            {
                list.Add("RID like @RID");
                listParameter.Add(new SqlParameter("RID", "%" + RID + "%"));
            }
            if (ZLLXIsChecked)
            {
                list.Add("ZLLX like @ZLLX");
                listParameter.Add(new SqlParameter("ZLLX", "%" + ZLLX + "%"));
            }
            if (WJLXIsChecked)
            {
                list.Add("WJLX like @WJLX");
                listParameter.Add(new SqlParameter("WJLX", "%" + WJLX + "%"));
            }
            if (ZLMCIsChecked)
            {
                list.Add("ZLMC like @ZLMC");
                listParameter.Add(new SqlParameter("ZLMC", "%" + ZLMC + "%"));
            }
            if (WJMCIsChecked)
            {
                list.Add("WJMC like @WJMC");
                listParameter.Add(new SqlParameter("WJMC", "%" + WJMC + "%"));
            }
            if (ZLNRIsChecked)
            {
                list.Add("ZLNR like @ZLNR");
                listParameter.Add(new SqlParameter("ZLNR", "%" + ZLNR + "%"));
            }
            if (BZIsChecked)
            {
                list.Add("BZ like @BZ");
                listParameter.Add(new SqlParameter("BZ", "%" + BZ + "%"));
            }
            if (GXRIDIsChecked)
            {
                list.Add("GXRID like @GXRID");
                listParameter.Add(new SqlParameter("GXRID", "%" + GXRID + "%"));
            }
            if (GXRXMIsChecked)
            {
                list.Add("GXRXM like @GXRXM");
                listParameter.Add(new SqlParameter("GXRXM", "%" + GXRXM + "%"));
            }
            if (GXLXIsChecked)
            {
                list.Add("GXLX like @GXLX");
                listParameter.Add(new SqlParameter("GXLX", "%" + GXLX + "%"));
            }
            if (GXYYIsChecked)
            {
                list.Add("GXYY like @GXYY");
                listParameter.Add(new SqlParameter("GXYY", "%" + GXYY + "%"));
            }
            if (GXSJIsChecked)
            {
                list.Add("GXSJ like @GXSJ");
                listParameter.Add(new SqlParameter("GXSJ", "%" + GXSJ + "%"));
            }
            if (list.Count > 0)
            {
                sb.Append(" where ");
                string sql = string.Join(" and ", list.ToArray());
                sb.Append(sql);
            }
            List <T_HR_FJZL> listT_HR_FJZL = new List <T_HR_FJZL>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader(sb.ToString(), listParameter.ToArray()))
            {
                while (reader.Read())
                {
                    T_HR_FJZL model = new T_HR_FJZL();
                    model.FJ_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.ZLLX  = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.WJLX  = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.ZLMC  = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.WJMC  = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.ZLNR  = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.BZ    = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXRID = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXRXM = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GXLX  = reader.IsDBNull(10) ? null : reader.GetString(10);
                    model.GXYY  = reader.IsDBNull(11) ? null : reader.GetString(11);
                    listT_HR_FJZL.Add(model);
                }
            }
            return(listT_HR_FJZL);
        }
Beispiel #25
0
        /// <summary>
        ///DAL方法:模糊查找数据库中符合条件的全部数据------>返回IEnumerable&lt;T_HR_YGGZ&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_YGGZ> FuzzyQueryByReader(bool GZ_IDIsChecked, string GZ_ID, bool RIDIsChecked, string RID, bool JBGZIsChecked, string JBGZ, bool ZWGZIsChecked, string ZWGZ, bool YXBSIsChecked, string YXBS, bool GXRIDIsChecked, string GXRID, bool GXRXMIsChecked, string GXRXM, bool GXLXIsChecked, string GXLX, bool GXYYIsChecked, string GXYY, bool GXSJIsChecked, string GXSJ)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from T_HR_YGGZ");
            List <string>       list          = new List <string>();
            List <SqlParameter> listParameter = new List <SqlParameter>();

            if (GZ_IDIsChecked)
            {
                list.Add("GZ_ID like @GZ_ID");
                listParameter.Add(new SqlParameter("GZ_ID", "%" + GZ_ID + "%"));
            }
            if (RIDIsChecked)
            {
                list.Add("RID like @RID");
                listParameter.Add(new SqlParameter("RID", "%" + RID + "%"));
            }
            if (JBGZIsChecked)
            {
                list.Add("JBGZ like @JBGZ");
                listParameter.Add(new SqlParameter("JBGZ", "%" + JBGZ + "%"));
            }
            if (ZWGZIsChecked)
            {
                list.Add("ZWGZ like @ZWGZ");
                listParameter.Add(new SqlParameter("ZWGZ", "%" + ZWGZ + "%"));
            }
            if (YXBSIsChecked)
            {
                list.Add("YXBS like @YXBS");
                listParameter.Add(new SqlParameter("YXBS", "%" + YXBS + "%"));
            }
            if (GXRIDIsChecked)
            {
                list.Add("GXRID like @GXRID");
                listParameter.Add(new SqlParameter("GXRID", "%" + GXRID + "%"));
            }
            if (GXRXMIsChecked)
            {
                list.Add("GXRXM like @GXRXM");
                listParameter.Add(new SqlParameter("GXRXM", "%" + GXRXM + "%"));
            }
            if (GXLXIsChecked)
            {
                list.Add("GXLX like @GXLX");
                listParameter.Add(new SqlParameter("GXLX", "%" + GXLX + "%"));
            }
            if (GXYYIsChecked)
            {
                list.Add("GXYY like @GXYY");
                listParameter.Add(new SqlParameter("GXYY", "%" + GXYY + "%"));
            }
            if (GXSJIsChecked)
            {
                list.Add("GXSJ like @GXSJ");
                listParameter.Add(new SqlParameter("GXSJ", "%" + GXSJ + "%"));
            }
            if (list.Count > 0)
            {
                sb.Append(" where ");
                string sql = string.Join(" and ", list.ToArray());
                sb.Append(sql);
            }
            List <T_HR_YGGZ> listT_HR_YGGZ = new List <T_HR_YGGZ>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader(sb.ToString(), listParameter.ToArray()))
            {
                while (reader.Read())
                {
                    T_HR_YGGZ model = new T_HR_YGGZ();
                    model.GZ_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.YXBS  = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.GXRID = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.GXRXM = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXLX  = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXYY  = reader.IsDBNull(8) ? null : reader.GetString(8);
                    listT_HR_YGGZ.Add(model);
                }
            }
            return(listT_HR_YGGZ);
        }
Beispiel #26
0
        /// <summary>
        ///DAL方法:模糊查找数据库中符合条件的全部数据------>返回IEnumerable&lt;T_HR_GZLL&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_GZLL> FuzzyQueryByReader(bool GZLL_IDIsChecked, string GZLL_ID, bool RIDIsChecked, string RID, bool QSRQIsChecked, string QSRQ, bool JZRQIsChecked, string JZRQ, bool GZDWIsChecked, string GZDW, bool ZWIsChecked, string ZW, bool ZMRIsChecked, string ZMR, bool GXRIDIsChecked, string GXRID, bool GXRXMIsChecked, string GXRXM, bool GXLXIsChecked, string GXLX, bool GXYYIsChecked, string GXYY, bool GXSJIsChecked, string GXSJ)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from T_HR_GZLL");
            List <string>       list          = new List <string>();
            List <SqlParameter> listParameter = new List <SqlParameter>();

            if (GZLL_IDIsChecked)
            {
                list.Add("GZLL_ID like @GZLL_ID");
                listParameter.Add(new SqlParameter("GZLL_ID", "%" + GZLL_ID + "%"));
            }
            if (RIDIsChecked)
            {
                list.Add("RID like @RID");
                listParameter.Add(new SqlParameter("RID", "%" + RID + "%"));
            }
            if (QSRQIsChecked)
            {
                list.Add("QSRQ like @QSRQ");
                listParameter.Add(new SqlParameter("QSRQ", "%" + QSRQ + "%"));
            }
            if (JZRQIsChecked)
            {
                list.Add("JZRQ like @JZRQ");
                listParameter.Add(new SqlParameter("JZRQ", "%" + JZRQ + "%"));
            }
            if (GZDWIsChecked)
            {
                list.Add("GZDW like @GZDW");
                listParameter.Add(new SqlParameter("GZDW", "%" + GZDW + "%"));
            }
            if (ZWIsChecked)
            {
                list.Add("ZW like @ZW");
                listParameter.Add(new SqlParameter("ZW", "%" + ZW + "%"));
            }
            if (ZMRIsChecked)
            {
                list.Add("ZMR like @ZMR");
                listParameter.Add(new SqlParameter("ZMR", "%" + ZMR + "%"));
            }
            if (GXRIDIsChecked)
            {
                list.Add("GXRID like @GXRID");
                listParameter.Add(new SqlParameter("GXRID", "%" + GXRID + "%"));
            }
            if (GXRXMIsChecked)
            {
                list.Add("GXRXM like @GXRXM");
                listParameter.Add(new SqlParameter("GXRXM", "%" + GXRXM + "%"));
            }
            if (GXLXIsChecked)
            {
                list.Add("GXLX like @GXLX");
                listParameter.Add(new SqlParameter("GXLX", "%" + GXLX + "%"));
            }
            if (GXYYIsChecked)
            {
                list.Add("GXYY like @GXYY");
                listParameter.Add(new SqlParameter("GXYY", "%" + GXYY + "%"));
            }
            if (GXSJIsChecked)
            {
                list.Add("GXSJ like @GXSJ");
                listParameter.Add(new SqlParameter("GXSJ", "%" + GXSJ + "%"));
            }
            if (list.Count > 0)
            {
                sb.Append(" where ");
                string sql = string.Join(" and ", list.ToArray());
                sb.Append(sql);
            }
            List <T_HR_GZLL> listT_HR_GZLL = new List <T_HR_GZLL>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader(sb.ToString(), listParameter.ToArray()))
            {
                while (reader.Read())
                {
                    T_HR_GZLL model = new T_HR_GZLL();
                    model.GZLL_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID     = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.QSRQ    = reader.IsDBNull(2) ? null : (DateTime?)reader.GetDateTime(2);
                    model.JZRQ    = reader.IsDBNull(3) ? null : (DateTime?)reader.GetDateTime(3);
                    model.GZDW    = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.ZW      = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.ZMR     = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRID   = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXRXM   = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXLX    = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GXYY    = reader.IsDBNull(10) ? null : reader.GetString(10);
                    listT_HR_GZLL.Add(model);
                }
            }
            return(listT_HR_GZLL);
        }
Beispiel #27
0
        /// <summary>
        ///DAL方法:模糊查找数据库中符合条件的全部数据------>返回IEnumerable&lt;T_HR_BMXX&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_BMXX> FuzzyQueryByReader(bool BM_IDIsChecked, string BM_ID, bool BMBMIsChecked, string BMBM, bool BMMCIsChecked, string BMMC, bool CJRQIsChecked, string CJRQ, bool ZZMSIsChecked, string ZZMS, bool FZRIsChecked, string FZR, bool LXRIsChecked, string LXR, bool GXRIDIsChecked, string GXRID, bool GXRXMIsChecked, string GXRXM, bool GXLXIsChecked, string GXLX, bool GXYYIsChecked, string GXYY, bool GXSJIsChecked, string GXSJ)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from T_HR_BMXX");
            List <string>       list          = new List <string>();
            List <SqlParameter> listParameter = new List <SqlParameter>();

            if (BM_IDIsChecked)
            {
                list.Add("BM_ID like @BM_ID");
                listParameter.Add(new SqlParameter("BM_ID", "%" + BM_ID + "%"));
            }
            if (BMBMIsChecked)
            {
                list.Add("BMBM like @BMBM");
                listParameter.Add(new SqlParameter("BMBM", "%" + BMBM + "%"));
            }
            if (BMMCIsChecked)
            {
                list.Add("BMMC like @BMMC");
                listParameter.Add(new SqlParameter("BMMC", "%" + BMMC + "%"));
            }
            if (CJRQIsChecked)
            {
                list.Add("CJRQ like @CJRQ");
                listParameter.Add(new SqlParameter("CJRQ", "%" + CJRQ + "%"));
            }
            if (ZZMSIsChecked)
            {
                list.Add("ZZMS like @ZZMS");
                listParameter.Add(new SqlParameter("ZZMS", "%" + ZZMS + "%"));
            }
            if (FZRIsChecked)
            {
                list.Add("FZR like @FZR");
                listParameter.Add(new SqlParameter("FZR", "%" + FZR + "%"));
            }
            if (LXRIsChecked)
            {
                list.Add("LXR like @LXR");
                listParameter.Add(new SqlParameter("LXR", "%" + LXR + "%"));
            }
            if (GXRIDIsChecked)
            {
                list.Add("GXRID like @GXRID");
                listParameter.Add(new SqlParameter("GXRID", "%" + GXRID + "%"));
            }
            if (GXRXMIsChecked)
            {
                list.Add("GXRXM like @GXRXM");
                listParameter.Add(new SqlParameter("GXRXM", "%" + GXRXM + "%"));
            }
            if (GXLXIsChecked)
            {
                list.Add("GXLX like @GXLX");
                listParameter.Add(new SqlParameter("GXLX", "%" + GXLX + "%"));
            }
            if (GXYYIsChecked)
            {
                list.Add("GXYY like @GXYY");
                listParameter.Add(new SqlParameter("GXYY", "%" + GXYY + "%"));
            }
            if (GXSJIsChecked)
            {
                list.Add("GXSJ like @GXSJ");
                listParameter.Add(new SqlParameter("GXSJ", "%" + GXSJ + "%"));
            }
            if (list.Count > 0)
            {
                sb.Append(" where ");
                string sql = string.Join(" and ", list.ToArray());
                sb.Append(sql);
            }
            List <T_HR_BMXX> listT_HR_BMXX = new List <T_HR_BMXX>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader(sb.ToString(), listParameter.ToArray()))
            {
                while (reader.Read())
                {
                    T_HR_BMXX model = new T_HR_BMXX();
                    model.BM_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.BMBM  = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.BMMC  = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.CJRQ  = reader.IsDBNull(3) ? null : (DateTime?)reader.GetDateTime(3);
                    model.ZZMS  = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.FZR   = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.LXR   = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRID = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXRXM = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXLX  = reader.IsDBNull(9) ? null : reader.GetString(9);
                    model.GXYY  = reader.IsDBNull(10) ? null : reader.GetString(10);
                    listT_HR_BMXX.Add(model);
                }
            }
            return(listT_HR_BMXX);
        }
Beispiel #28
0
        /// <summary>
        ///DAL方法:模糊查找数据库中符合条件的全部数据------>返回IEnumerable&lt;T_HR_JCQK&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_JCQK> FuzzyQueryByReader(bool JCQK_IDIsChecked, string JCQK_ID, bool RIDIsChecked, string RID, bool JCQKIsChecked, string JCQK, bool JCDJIsChecked, string JCDJ, bool JCDWIsChecked, string JCDW, bool JCSJIsChecked, string JCSJ, bool GXRIDIsChecked, string GXRID, bool GXRXMIsChecked, string GXRXM, bool GXLXIsChecked, string GXLX, bool GXYYIsChecked, string GXYY, bool GXSJIsChecked, string GXSJ)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from T_HR_JCQK");
            List <string>       list          = new List <string>();
            List <SqlParameter> listParameter = new List <SqlParameter>();

            if (JCQK_IDIsChecked)
            {
                list.Add("JCQK_ID like @JCQK_ID");
                listParameter.Add(new SqlParameter("JCQK_ID", "%" + JCQK_ID + "%"));
            }
            if (RIDIsChecked)
            {
                list.Add("RID like @RID");
                listParameter.Add(new SqlParameter("RID", "%" + RID + "%"));
            }
            if (JCQKIsChecked)
            {
                list.Add("JCQK like @JCQK");
                listParameter.Add(new SqlParameter("JCQK", "%" + JCQK + "%"));
            }
            if (JCDJIsChecked)
            {
                list.Add("JCDJ like @JCDJ");
                listParameter.Add(new SqlParameter("JCDJ", "%" + JCDJ + "%"));
            }
            if (JCDWIsChecked)
            {
                list.Add("JCDW like @JCDW");
                listParameter.Add(new SqlParameter("JCDW", "%" + JCDW + "%"));
            }
            if (JCSJIsChecked)
            {
                list.Add("JCSJ like @JCSJ");
                listParameter.Add(new SqlParameter("JCSJ", "%" + JCSJ + "%"));
            }
            if (GXRIDIsChecked)
            {
                list.Add("GXRID like @GXRID");
                listParameter.Add(new SqlParameter("GXRID", "%" + GXRID + "%"));
            }
            if (GXRXMIsChecked)
            {
                list.Add("GXRXM like @GXRXM");
                listParameter.Add(new SqlParameter("GXRXM", "%" + GXRXM + "%"));
            }
            if (GXLXIsChecked)
            {
                list.Add("GXLX like @GXLX");
                listParameter.Add(new SqlParameter("GXLX", "%" + GXLX + "%"));
            }
            if (GXYYIsChecked)
            {
                list.Add("GXYY like @GXYY");
                listParameter.Add(new SqlParameter("GXYY", "%" + GXYY + "%"));
            }
            if (GXSJIsChecked)
            {
                list.Add("GXSJ like @GXSJ");
                listParameter.Add(new SqlParameter("GXSJ", "%" + GXSJ + "%"));
            }
            if (list.Count > 0)
            {
                sb.Append(" where ");
                string sql = string.Join(" and ", list.ToArray());
                sb.Append(sql);
            }
            List <T_HR_JCQK> listT_HR_JCQK = new List <T_HR_JCQK>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader(sb.ToString(), listParameter.ToArray()))
            {
                while (reader.Read())
                {
                    T_HR_JCQK model = new T_HR_JCQK();
                    model.JCQK_ID = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID     = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.JCQK    = reader.IsDBNull(2) ? null : reader.GetString(2);
                    model.JCDJ    = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.JCDW    = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.JCSJ    = reader.IsDBNull(5) ? null : (DateTime?)reader.GetDateTime(5);
                    model.GXRID   = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRXM   = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXLX    = reader.IsDBNull(8) ? null : reader.GetString(8);
                    model.GXYY    = reader.IsDBNull(9) ? null : reader.GetString(9);
                    listT_HR_JCQK.Add(model);
                }
            }
            return(listT_HR_JCQK);
        }
Beispiel #29
0
        /// <summary>
        ///DAL方法:模糊查找数据库中符合条件的全部数据------>返回IEnumerable&lt;T_HR_RXXX&gt;接口数据
        /// </summary>
        /// <returns></returns>
        public IEnumerable <T_HR_RXXX> FuzzyQueryByReader(bool IDIsChecked, string ID, bool RIDIsChecked, string RID, bool PSSJIsChecked, string PSSJ, bool LXIsChecked, string LX, bool YTIsChecked, string YT, bool XPIsChecked, string XP, bool GXRIDIsChecked, string GXRID, bool GXRXMIsChecked, string GXRXM, bool GXLXIsChecked, string GXLX, bool GXSJIsChecked, string GXSJ)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("select * from T_HR_RXXX");
            List <string>       list          = new List <string>();
            List <SqlParameter> listParameter = new List <SqlParameter>();

            if (IDIsChecked)
            {
                list.Add("ID like @ID");
                listParameter.Add(new SqlParameter("ID", "%" + ID + "%"));
            }
            if (RIDIsChecked)
            {
                list.Add("RID like @RID");
                listParameter.Add(new SqlParameter("RID", "%" + RID + "%"));
            }
            if (PSSJIsChecked)
            {
                list.Add("PSSJ like @PSSJ");
                listParameter.Add(new SqlParameter("PSSJ", "%" + PSSJ + "%"));
            }
            if (LXIsChecked)
            {
                list.Add("LX like @LX");
                listParameter.Add(new SqlParameter("LX", "%" + LX + "%"));
            }
            if (YTIsChecked)
            {
                list.Add("YT like @YT");
                listParameter.Add(new SqlParameter("YT", "%" + YT + "%"));
            }
            if (XPIsChecked)
            {
                list.Add("XP like @XP");
                listParameter.Add(new SqlParameter("XP", "%" + XP + "%"));
            }
            if (GXRIDIsChecked)
            {
                list.Add("GXRID like @GXRID");
                listParameter.Add(new SqlParameter("GXRID", "%" + GXRID + "%"));
            }
            if (GXRXMIsChecked)
            {
                list.Add("GXRXM like @GXRXM");
                listParameter.Add(new SqlParameter("GXRXM", "%" + GXRXM + "%"));
            }
            if (GXLXIsChecked)
            {
                list.Add("GXLX like @GXLX");
                listParameter.Add(new SqlParameter("GXLX", "%" + GXLX + "%"));
            }
            if (GXSJIsChecked)
            {
                list.Add("GXSJ like @GXSJ");
                listParameter.Add(new SqlParameter("GXSJ", "%" + GXSJ + "%"));
            }
            if (list.Count > 0)
            {
                sb.Append(" where ");
                string sql = string.Join(" and ", list.ToArray());
                sb.Append(sql);
            }
            List <T_HR_RXXX> listT_HR_RXXX = new List <T_HR_RXXX>();

            using (SqlDataReader reader = SqlHelper.ExcuteReader(sb.ToString(), listParameter.ToArray()))
            {
                while (reader.Read())
                {
                    T_HR_RXXX model = new T_HR_RXXX();
                    model.ID    = reader.IsDBNull(0) ? null : reader.GetString(0);
                    model.RID   = reader.IsDBNull(1) ? null : reader.GetString(1);
                    model.PSSJ  = reader.IsDBNull(2) ? null : (DateTime?)reader.GetDateTime(2);
                    model.LX    = reader.IsDBNull(3) ? null : reader.GetString(3);
                    model.YT    = reader.IsDBNull(4) ? null : reader.GetString(4);
                    model.XP    = reader.IsDBNull(5) ? null : reader.GetString(5);
                    model.GXRID = reader.IsDBNull(6) ? null : reader.GetString(6);
                    model.GXRXM = reader.IsDBNull(7) ? null : reader.GetString(7);
                    model.GXLX  = reader.IsDBNull(8) ? null : reader.GetString(8);
                    listT_HR_RXXX.Add(model);
                }
            }
            return(listT_HR_RXXX);
        }