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
<?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.stylefeng.guns.modular.system.dao.TaskDetailVehiclesChannelMapper">
    <update id="updateAudit">
        UPDATE t_task_detail_vehicles_channel
        SET
        artificial_status = #{entity.artificialStatus},
        remark = #{entity.remark}, <!-- 无论是否为 null,都强制更新 -->
        artificial_create_time = #{entity.artificialCreateTime},
        artificial_user_id = #{entity.artificialUserId}
        WHERE id = #{entity.id}
    </update>
 
 
    <select id="getPictureDetails" resultType="com.stylefeng.guns.modular.system.model.vo.PictureDetails">
        select
            a.id,
            a.video_channel as videoChannel,
            a.image_url as imageUrl,
            a.sys_status as sysStatus,
            DATE_FORMAT(a.sys_create_time, '%Y-%m-%d %H:%i:%s') as sysCreateTime,
            a.artificial_status as artificialStatus,
            DATE_FORMAT(a.artificial_create_time, '%Y-%m-%d %H:%i:%s') as artificialCreateTime,
            b.`name` as artificialUserName,
            c.status as status
        from t_task_detail_vehicles_channel a
        left join sys_user b on (a.artificial_user_id = b.id)
        left join t_task_detail_vehicles c on (a.task_detail_vehicles_id = c.id)
        <where>
            <if test="null != taskDetailVehiclesIdList and taskDetailVehiclesIdList.size() > 0">
                and a.task_detail_vehicles_id in
                <foreach collection="taskDetailVehiclesIdList" item="item" index="index" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="null != sysStatusList and sysStatusList.size() > 0">
                and a.sys_status in
                <foreach collection="sysStatusList" item="item" index="index" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
 
            <if test="null != artificialStatusList and artificialStatusList.size() > 0">
                and a.artificial_status in
                <foreach collection="artificialStatusList" item="item" index="index" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="null != havePic">
                <if test=" havePic==0">
                    and a.image_url IS  NULL
                </if>
                <if test=" havePic==1">
                    and a.image_url IS Not NULL
                </if>
            </if>
 
        </where>
        
    </select>
</mapper>