mitao
2025-06-11 0184bf471382f9328df9bdd47acf451e4e2c5cb0
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
93
94
95
96
97
<?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="com.sinata.system.mapper.MwApplicationMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.sinata.system.domain.MwApplication">
        <id column="ID" property="id" />
        <result column="DEL_FLAG" property="delFlag" />
        <result column="CREATE_BY" property="createBy" />
        <result column="CREATE_TIME" property="createTime" />
        <result column="UPDATE_BY" property="updateBy" />
        <result column="UPDATE_TIME" property="updateTime" />
        <result column="DEPARTMENT_ID" property="departmentId" />
        <result column="UNIT_TYPE" property="unitType" />
        <result column="UNIT_NAME" property="unitName" />
        <result column="CONCAT" property="concat" />
        <result column="PHONE" property="phone" />
        <result column="DESCRIPTION" property="description" />
        <result column="LEGAL_PERSON_CARD_FRONT" property="legalPersonCardFront" />
        <result column="LEGAL_PERSON_CARD_BACK" property="legalPersonCardBack" />
        <result column="CERTIFICATE_IMAGE_URL" property="certificateImageUrl" />
        <result column="AUDIT_STATUS" property="auditStatus" />
        <result column="AUDIT_OPINION" property="auditOpinion" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        DEL_FLAG,
        CREATE_BY,
        CREATE_TIME,
        UPDATE_BY,
        UPDATE_TIME,
        ID, DEPARTMENT_ID, UNIT_TYPE, UNIT_NAME, CONCAT, PHONE, DESCRIPTION, LEGAL_PERSON_CARD_FRONT, LEGAL_PERSON_CARD_BACK, CERTIFICATE_IMAGE_URL, AUDIT_STATUS, AUDIT_OPINION
    </sql>
    <select id="pageList" resultType="com.sinata.system.domain.vo.MwApplicationVO">
        SELECT MA.ID,
        MA.DEPARTMENT_ID,
        MA.UNIT_TYPE,
        MA.UNIT_NAME,
        MA.CONCAT,
        MA.PHONE,
        MA.DESCRIPTION,
        MA.LEGAL_PERSON_CARD_FRONT,
        MA.LEGAL_PERSON_CARD_BACK,
        MA.CERTIFICATE_IMAGE_URL,
        MA.AUDIT_STATUS,
        MA.AUDIT_OPINION,
        MA.CREATE_TIME,
        MA.REGION,
        SD.DEPARTMENT_NAME
        FROM MW_APPLICATION MA
        LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MA.DEPARTMENT_ID
        <where>
            MA.DEL_FLAG = 0
            <if test="treeCode != null and treeCode !=''">
                AND SD.TREE_CODE LIKE CONCAT(#{treeCode}, '%')
            </if>
            <if test="query.unitType != null and query.unitType !=''">
                AND MA.UNIT_TYPE = #{query.unitType}
            </if>
            <if test="query.unitName != null and query.unitName !=''">
                AND MA.UNIT_NAME LIKE CONCAT('%',#{query.unitName},'%')
            </if>
            <if test="query.concat !=null and query.concat != ''">
                AND MA.CONCAT LIKE CONCAT('%',#{query.concat},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                AND MA.PHONE LIKE CONCAT('%',#{query.phone},'%')
            </if>
        </where>
        ORDER BY MA.CREATE_TIME DESC
    </select>
    <select id="detail" resultType="com.sinata.system.domain.vo.MwApplicationVO">
        SELECT MA.ID,
        MA.DEPARTMENT_ID,
        MA.UNIT_TYPE,
        MA.UNIT_NAME,
        MA.CONCAT,
        MA.PHONE,
        MA.DESCRIPTION,
        MA.LEGAL_PERSON_CARD_FRONT,
        MA.LEGAL_PERSON_CARD_BACK,
        MA.CERTIFICATE_IMAGE_URL,
        MA.AUDIT_STATUS,
        MA.AUDIT_OPINION,
        MA.CREATE_TIME,
        MA.REGION,
        MA.RELATION,
        SD.DEPARTMENT_NAME
        FROM MW_APPLICATION MA
        LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MA.DEPARTMENT_ID
        <where>
            MA.ID = #{id}
        </where>
    </select>
 
</mapper>