guohongjin
2024-05-15 5b7639f0bd9e056738ec15100ed0532e965c6cd5
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
<?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.stylefeng.guns.modular.business.mapper.MentalAnalysisTimeConfigMapper">
 
    <select id="getWorkerPage" resultType="cn.stylefeng.guns.modular.business.dto.MentalAnalysisTimeConfigPageDTO">
        SELECT
            tu.customer_id AS counsellingInfoId,
            tu.nick_name AS nickName,
            tu.mental_analysis_status
        FROM
            t_mental_analysis_time_config o
            LEFT JOIN toc_customer tu ON tu.customer_id = o.counselling_info_id
        <where>
            AND tu.status_flag = 1
            <if test="nickName != null and nickName != ''">
                AND tu.nick_name LIKE CONCAT('%',#{nickName},'%')
            </if>
        </where>
        GROUP BY counselling_info_id
    </select>
    <select id="getWorkerListByAppointmentTime" resultType="cn.stylefeng.guns.modular.business.entity.MentalAnalysisTimeConfig">
        SELECT
            tc.*
        FROM
            t_mental_analysis_time_config tc
            LEFT JOIN toc_customer u ON tc.counselling_info_id = u.customer_id
        <where>
            AND u.status_flag = 1
            <if test="workStatus != null">
                AND u.work_status = #{workStatus}
            </if>
            <if test="mentalAnalysisStatus != null">
                AND u.mental_analysis_status = #{mentalAnalysisStatus}
            </if>
            <if test="weekDay != null">
                AND tc.week_day = #{weekDay}
            </if>
            <if test="beginTimePoint != null and beginTimePoint != ''">
                AND tc.begin_time_point = #{beginTimePoint}
            </if>
            <if test="endTimePoint != null and endTimePoint != ''">
                AND tc.end_time_point = #{endTimePoint}
            </if>
            <if test="appointmentDay != null and appointmentDay != ''">
                AND u.customer_id NOT IN (
                    SELECT counselling_info_id FROM t_mental_analysis_special_time_config stc
                    WHERE stc.special_day <![CDATA[ <> ]]> #{appointmentDay} AND stc.is_cancel_day = 1
            )
            </if>
        </where>
    </select>
</mapper>