huliguo
9 小时以前 c5d38d650d2ac4101b1293a4f17346e7d5420076
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
<?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.ruoyi.shop.mapper.task.AgencyTaskRecordMapper">
 
 
    <resultMap type="AgencyTaskRecord" id="AgencyTaskRecordResult">
        <result property="id"    column="id"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="taskId"    column="task_id"    />
        <result property="userId"    column="user_id"    />
        <result property="followType"    column="follow_type"    />
        <result property="callTime"    column="call_time"    />
        <result property="followContent"    column="follow_content"    />
    </resultMap>
 
 
    <select id="pageMerAgencyTaskRecord" resultType="com.ruoyi.shop.domain.vo.MerAgencyTaskRecordPageVo">
        SELECT
        tmtr.id followId,
        tmtr.task_id taskId,
        tmt.task_date taskDate,
        tmtr.follow_type followType,
        tmtr.custome_follow_type customeFollowType,
        tmtr.call_time callTime,
        tmtr.follow_content followContent,
        tmtr.call_phone callPhone
        FROM t_agency_task tmt
        INNER JOIN t_agency_task_record tmtr ON tmtr.task_id = tmt.task_id
        WHERE tmt.del_flag = 0 AND tmtr.del_flag = 0 AND tmt.shop_id = #{param.shopId} AND tmt.agency_id = #{param.agencyId}
        ORDER BY tmtr.create_time DESC
    </select>
 
    <select id="pageMgtAgencyFollow" resultType="com.ruoyi.shop.domain.vo.MgtAgencyTaskRecordPageVo">
        SELECT
        tmtr.user_id userId,
        tmtr.id followId,
        tmtr.task_id taskId,
        tmt.create_time createTime,
        tmtr.follow_type followType,
        tmtr.custome_follow_type customeFollowType,
        tmtr.call_time callTime,
        tmtr.follow_content followContent,
        tmtr.call_phone callPhone
        FROM t_agency_task tmt
        INNER JOIN t_agency_task_record tmtr ON tmtr.task_id = tmt.task_id
        INNER JOIN t_shop ts ON ts.shop_id = tmt.shop_id
        INNER JOIN t_shop_file tsf ON tsf.shop_id = ts.shop_id AND tsf.del_flag = 0 AND tsf.file_type = 1
        WHERE tmt.del_flag = 0 AND tmt.agency_id = #{param.shopId} AND tmt.task_date = #{param.taskDate}
        ORDER BY tmtr.create_time DESC
    </select>
 
    <select id="pageStaffAgencyTaskRecord" resultType="com.ruoyi.shop.domain.vo.StaffAgencyTaskRecordPageVo">
        SELECT
            tmtr.user_id userId,
            tmtr.id followId,
            tmtr.task_id taskId,
            tmt.create_time createTime,
            CASE tmtr.follow_type WHEN 1 THEN "电话跟进" WHEN 2 THEN "手动跟进" END followType,
            tmtr.custome_follow_type customeFollowType,
            tmtr.call_time callTime,
            tmtr.follow_content followContent,
            tmtr.call_phone callPhone
        FROM t_agency_task tmt
                 INNER JOIN t_agency_task_record tmtr ON tmtr.task_id = tmt.task_id
                 INNER JOIN t_shop ts ON ts.shop_id = tmt.shop_id
                 INNER JOIN t_shop_file tsf ON tsf.shop_id = ts.shop_id AND tsf.del_flag = 0 AND tsf.file_type = 1
        WHERE tmt.del_flag = 0 AND tmt.shop_id = #{param.agencyId}
        ORDER BY tmtr.create_time DESC
    </select>
 
 
</mapper>