bug
luoyisheng
2025-02-24 ccd758bcd9b357b365c28f62efde203faa83fb93
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
<?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.MwStaffMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.sinata.system.domain.MwStaff">
        <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="STAFF_NAME" property="staffName" />
        <result column="PHONE" property="phone" />
        <result column="HEALTH_CERTIFICATE" property="healthCertificate" />
        <result column="VACCINE_CERTIFICATE" property="vaccineCertificate" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        DEL_FLAG,
        CREATE_BY,
        CREATE_TIME,
        UPDATE_BY,
        UPDATE_TIME,
        ID, DEPARTMENT_ID, STAFF_NAME, PHONE, HEALTH_CERTIFICATE, VACCINE_CERTIFICATE
    </sql>
    <select id="pageList" resultType="com.sinata.system.domain.vo.MwStaffVO">
        SELECT MS.ID,
        MS.DEPARTMENT_ID,
        MS.STAFF_NAME,
        MS.PHONE,
        MS.HEALTH_CERTIFICATE,
        MS.VACCINE_CERTIFICATE,
        SD.DEPARTMENT_NAME
        FROM MW_STAFF MS
        LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MS.DEPARTMENT_ID
        <where>
            MS.DEL_FLAG = 0
            <if test="treeCode != null and treeCode != ''">
                AND SD.TREE_CODE LIKE CONCAT(#{treeCode}, '%')
            </if>
            <if test="query.staffName !=null and query.staffName != ''">
                AND MS.STAFF_NAME LIKE CONCAT('%',#{query.staffName},'%')
            </if>
            <if test="query.phone != null and query.phone != ''">
                AND MS.PHONE LIKE CONCAT('%',#{query.phone},'%')
            </if>
            <if test="query.healthCertificateFlag != null and query.healthCertificateFlag == 1">
                AND MS.HEALTH_CERTIFICATE IS NOT NULL
            </if>
            <if test="query.healthCertificateFlag != null and query.healthCertificateFlag == 0">
                AND MS.HEALTH_CERTIFICATE IS NULL
            </if>
            <if test="query.vaccineCertificateFlag != null and query.vaccineCertificateFlag == 1">
                AND MS.VACCINE_CERTIFICATE IS NOT NULL
            </if>
            <if test="query.vaccineCertificateFlag != null and query.vaccineCertificateFlag == 0">
                AND MS.VACCINE_CERTIFICATE IS NULL
            </if>
        </where>
        ORDER BY MS.CREATE_TIME DESC
    </select>
    <select id="queryList" resultType="com.sinata.system.domain.vo.MwStaffVO">
        SELECT MS.ID,
        MS.DEPARTMENT_ID,
        MS.STAFF_NAME,
        MS.PHONE,
        MS.HEALTH_CERTIFICATE,
        MS.VACCINE_CERTIFICATE,
        SD.DEPARTMENT_NAME
        FROM MW_STAFF MS
        LEFT JOIN SYS_DEPARTMENT SD ON SD.ID = MS.DEPARTMENT_ID
        <where>
            MS.DEL_FLAG = 0
        </where>
        ORDER BY MS.CREATE_TIME DESC
    </select>
 
</mapper>