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
60
61
62
63
64
65
66
67
using HH.WMS.Entitys;
using HH.WMS.Entitys.Basic;
/********************************************************************************
 
** auth: DBS
 
** date: 2018/12/12 15:43:01
 
** desc: 尚未编写描述
 
** Ver.:  V1.0.0
 
*********************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace HH.WMS.DAL.Basic
{
    public class TN_WM_PRINT_TASKDAL:DapperBaseDAL
    {
        #region 更新打印任务标识
        /// <summary>
        /// 更新打印任务标识
        /// </summary>
        /// <param name="guids">打印任务guid,多个用逗号隔开</param>
        /// <returns></returns>
        /// <History>[Hanhe(DBS)] created  2018/12/13</History>
        public OperateResult UpdatePrintFlag(string guids)
        {
            string sql = "update TN_WM_PRINT_TASK set CN_C_IS_PRINTED='Y' where CN_GUID in('"+guids.Replace(",","','")+"')";
 
            return ExecuteTranSql(sql,null,null);
        }
        #endregion
 
        #region 查询打印任务
        /// <summary>
        /// 查询打印任务
        /// </summary>
        /// <param name="mac">机器MAC地址</param>
        /// <param name="isHistory">是否查询已打印记录(Y/N)</param>
        /// <param name="key">模糊搜索的打印任务</param>
        /// <param name="startDate">开始时间</param>
        /// <param name="endDate">结束时间</param>
        /// <returns></returns>
        /// <History>[Hanhe(DBS)] created  2018/12/12</History>
        public List<TN_WM_PRINT_TASKEntity> GetList(string mac, string isHistory, string key, string startDate, string endDate)
        {
            string sql = "select * from TN_WM_PRINT_TASK where CN_S_MAC=@CN_S_MAC and CN_C_IS_PRINTED=@CN_C_IS_PRINTED ";
            if (!string.IsNullOrEmpty(startDate))
                sql += " and CN_T_CREATE >='" + startDate+"'";
            if (!string.IsNullOrEmpty(endDate))
                sql += " and CN_T_CREATE <='"+endDate+"'";
            sql += "  and CN_S_CONTENT like @CN_S_CONTENT";
            return ExecuteQuery <TN_WM_PRINT_TASKEntity>(sql, new
            { 
                CN_S_MAC =mac,
                CN_C_IS_PRINTED = isHistory,
                CN_S_CONTENT= "%"+key+"%"
            });
        }
        #endregion
    }
}