<?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>
|