zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="UTF-8" ?>  
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.autoform.web.mapper.masterdata.MasterDataMapper">
 
    <select id="queryMasterDefines" resultType="cn.autoform.db.entity.MasterDefineEntity">
        SELECT
            ID,
            CODE,
            NAME,
            DESCRIPTION,
            TYPE,
            DEL_FLAG,
            DEF1,
            DEF2,
            DEF3,
            DEF4,
            DEF5,
            INS_P,
            INS_T,
            UPD_P,
            UPD_T,
            TENANT_ID
        FROM 
            MASTER_DEFINE
        WHERE
            TENANT_ID = #{tenantID}
            <if test="name != null and name != ''">
                AND NAME LIKE CONCAT('%',#{name}, '%') ESCAPE'+'
            </if>
            AND DEL_FLAG = 0
    </select>
    
    <select id="queryMasterElements" resultType="cn.autoform.db.entity.MasterElementEntity">
        SELECT 
            ID,
            DEFINE_CODE,
            CODE,
            NAME,
            TYPE,
            LEN,
            PREC,
            MUST_FLAG,
            DESCRIPTION,
            ALIAS,
            DEL_FLAG,
            DEF1,
            DEF2,
            DEF3,
            DEF4,
            DEF5,
            INS_P,
            INS_T,
            UPD_P,
            UPD_T,
            TENANT_ID
            FROM 
        MASTER_ELEMENT
            WHERE
        TENANT_ID = #{tenantID}
        <if test="code != null and code != ''">
            AND DEFINE_CODE = #{code}
        </if>
        AND DEL_FLAG = 0
    </select>
    
    <select id="queryMasterValues" resultType="cn.autoform.db.entity.MasterValueEntity">
        SELECT 
            ID,
            DEFINE_CODE,
            ELE_CODE,
            ELE_VALUE,
            ROW_NO,
            DEL_FLAG,
            DEF1,
            DEF2,
            DEF3,
            DEF4,
            DEF5,
            INS_P,
            INS_T,
            UPD_P,
            UPD_T,
            TENANT_ID
        FROM 
            MASTER_VALUE
        WHERE
            TENANT_ID = #{tenantID}
            AND DEFINE_CODE = #{defineCode}
            AND ele_code = #{eleCode}
            AND DEL_FLAG = 0
    </select>
</mapper>