bug
jiangqs
2023-08-21 c93e76c57a98e35abbf62d2f514d9ba51efd3243
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?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.MemberTaskRecordMapper">
 
    <resultMap type="MemberTaskRecord" id="MemberTaskRecordResult">
        <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>
 
    <sql id="selectMemberTaskRecordVo">
        select id, del_flag, task_id, user_id, follow_type, call_time, follow_content from t_member_task_record
    </sql>
 
    <select id="selectMemberTaskRecordList" parameterType="MemberTaskRecord" resultMap="MemberTaskRecordResult">
        <include refid="selectMemberTaskRecordVo"/>
        <where>
            <if test="taskId != null  and taskId != ''"> and task_id = #{taskId}</if>
            <if test="userId != null "> and user_id = #{userId}</if>
            <if test="followType != null "> and follow_type = #{followType}</if>
            <if test="callTime != null "> and call_time = #{callTime}</if>
            <if test="followContent != null  and followContent != ''"> and follow_content = #{followContent}</if>
        </where>
    </select>
 
    <select id="selectMemberTaskRecordById" parameterType="Long" resultMap="MemberTaskRecordResult">
        <include refid="selectMemberTaskRecordVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertMemberTaskRecord" parameterType="MemberTaskRecord" useGeneratedKeys="true" keyProperty="id">
        insert into t_member_task_record
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="delFlag != null">del_flag,</if>
            <if test="taskId != null">task_id,</if>
            <if test="userId != null">user_id,</if>
            <if test="followType != null">follow_type,</if>
            <if test="callTime != null">call_time,</if>
            <if test="followContent != null">follow_content,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="delFlag != null">#{delFlag},</if>
            <if test="taskId != null">#{taskId},</if>
            <if test="userId != null">#{userId},</if>
            <if test="followType != null">#{followType},</if>
            <if test="callTime != null">#{callTime},</if>
            <if test="followContent != null">#{followContent},</if>
        </trim>
    </insert>
 
    <update id="updateMemberTaskRecord" parameterType="MemberTaskRecord">
        update t_member_task_record
        <trim prefix="SET" suffixOverrides=",">
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="taskId != null">task_id = #{taskId},</if>
            <if test="userId != null">user_id = #{userId},</if>
            <if test="followType != null">follow_type = #{followType},</if>
            <if test="callTime != null">call_time = #{callTime},</if>
            <if test="followContent != null">follow_content = #{followContent},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteMemberTaskRecordById" parameterType="Long">
        delete from t_member_task_record where id = #{id}
    </delete>
 
    <delete id="deleteMemberTaskRecordByIds" parameterType="String">
        delete from t_member_task_record where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
 
    <select id="pageMerMemberTaskRecord" resultType="com.ruoyi.shop.domain.vo.MerMemberTaskRecordPageVo">
        SELECT
        tmtr.id followId,
        tmtr.task_id taskId,
        tmt.task_date taskDate,
        tmtr.follow_type followType,
        tmtr.call_time callTime,
        tmtr.follow_content followContent,
        tmtr.custome_follow_type customeFollowType,
        tmtr.call_phone callPhone
        FROM t_member_task tmt
        INNER JOIN t_member_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.user_id = #{param.memberUserId}
        ORDER BY tmtr.create_time DESC
    </select>
 
    <select id="pageMgtMemberFollow" resultType="com.ruoyi.shop.domain.vo.MgtMemberFollowPageVo">
        SELECT
        tmt.shop_id shopId,
        ts.shop_name shopName,
        tsf.file_url shopPicture,
        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_member_task tmt
        INNER JOIN t_member_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.user_id = #{param.memberUserId} AND tmt.task_date =  #{param.taskDate}
        ORDER BY tmt.task_date DESC
    </select>
 
</mapper>