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
68
69
70
71
72
73
74
75
76
77
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HH.WMS.Entitys;
using System.Data;
 
namespace HH.WMS.DAL
{
    public class TestDAL : DapperBaseDAL
    {
        /// <summary>
        /// 多表查询动态列 List
        /// </summary>
        /// <param name="opNo"></param>
        /// <returns></returns>
        public List<dynamic> GetTestDynamicList(string opNo)
        {
            string sql = "select a.*,b.CN_S_ITEM_CODE from TN_WM_INCREASE_INVENTORY_MST a, TN_WM_INCREASE_INVENTORY_DTL b where a.CN_S_OP_NO = b.CN_S_OP_NO and a.CN_S_OP_NO=@CN_S_OP_NO";
 
            return ExecuteDynamicList(sql, new
            {
                CN_S_OP_NO = opNo
            });
        }
        
 
        /// <summary>
        /// 多表查询指定实体 List
        /// </summary>
        /// <param name="opNo"></param>
        /// <returns></returns>
        public List<TN_WM_INCREASE_INVENTORY_MSTEntity> GetTestList(string opNo)
        {
            string sql = "select a.*,b.CN_S_ITEM_CODE from TN_WM_INCREASE_INVENTORY_MST a, TN_WM_INCREASE_INVENTORY_DTL b where a.CN_S_OP_NO = b.CN_S_OP_NO and a.CN_S_OP_NO=@CN_S_OP_NO";
 
            return ExecuteQuery<TN_WM_INCREASE_INVENTORY_MSTEntity>(sql, new
            {
                CN_S_OP_NO = opNo
            });
        }
 
        /// <summary>
        /// 多表查询 Datatable
        /// </summary>
        /// <param name="opNo"></param>
        /// <returns></returns>
        public DataTable GetTestDataTable(string opNo)
        {
            string sql = "select a.*,b.CN_S_ITEM_CODE from TN_WM_INCREASE_INVENTORY_MST a, TN_WM_INCREASE_INVENTORY_DTL b where a.CN_S_OP_NO = b.CN_S_OP_NO and a.CN_S_OP_NO=@CN_S_OP_NO";
 
            return ExecuteDataTable(sql, new
            {
                CN_S_OP_NO = opNo
            });
        }
 
        /// <summary>
        /// 修改测试
        /// </summary>
        /// <param name="opNo"></param>
        /// <param name="trans"></param>
        /// <returns></returns>
        public OperateResult UpdateTest(string opNo, IDbTransaction trans)
        {
            string sql = "update TN_WM_INCREASE_INVENTORY_MST set CN_S_EXT1 = @CN_S_EXT1 where CN_S_OP_NO=@CN_S_OP_NO";
            return ExecuteTranSql(sql, new
            {
                CN_S_EXT1 = "TestUpdate",
                CN_S_OP_NO = opNo
            }, trans);
        }
 
 
    }
}