jt
2021-06-10 5d0d028456874576560552f5a5c4e8b801786f11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using HH.WMS.Entitys;
using HH.WMS.Entitys.Basic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HH.WMS.Entitys.Common;
using HH.WMS.Common;
using System.Data;
 
namespace HH.WMS.DAL.Basic
{
   public class TN_WM_LOT_INFODAL:DapperBaseDAL
    {
       public OperateResult GetLotList(int pageIndex, int pageSize)
        {
            string sql = @"(select * from TN_WM_LOT_INFO) T ";
 
            OperateResult result = new OperateResult();
 
            return ExecutePagingResult(sql, pageIndex, pageSize, "", "");
        }
 
        public DataTable GetLotList(SearchModel searchModel,out long total)
        {
            var condition = searchModel.SearchCondition;
            string sql = " select * from TN_WM_LOT_INFO where 1=1 ";
            string ConStr = "";
            if (condition != null)
            {
                if (!string.IsNullOrEmpty(condition.CN_S_LOT_CODE.ToString()))
                {
                    ConStr = ConStr + " and CN_S_LOT_CODE like '%" + Util.ToStringInput(condition.CN_S_LOT_CODE) + "%'";
                }
                 if (!string.IsNullOrEmpty(condition.CN_S_VENDOR_NO.ToString()))
                {
                    ConStr = ConStr + " and CN_S_VENDOR_NO like '%" + Util.ToStringInput(condition.CN_S_VENDOR_NO) + "%'";
                }
            }
            if (!string.IsNullOrEmpty(ConStr))
            {
                sql = sql + ConStr;
            }
            OperateResult result = new OperateResult();
            //DataTable dt = new DataTable();
            //if (!isExport)
            //{
                return ExecutePagingData(" (" + sql + ") t ", searchModel.PageIndex, searchModel.PageSize, out total, "", "");
            //}
            //else
            //{
            //    total = 0;//无效
            //    return ExecuteDataTable(sql, "");
            //}
 
        }
    }
}