智慧保安后台管理项目备份
zhongrj
2024-05-24 b5960d1968e007b91d4d33dd7cbb74f1b566f2c1
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
<?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="org.springblade.modules.directive.mapper.DirectiveMapper">
 
    <!--指令分页信息-->
    <select id="selectDirectivePage" resultType="org.springblade.modules.directive.vo.DirectiveVo">
        SELECT
            sd.*,
            bu.real_name sendName
        FROM
            sys_directive sd
        left join
            blade_user bu
        on
            bu.id = sd.send_directive_id
        where
        1=1
        <if test="directive.type!=null and directive.type!=''">
            and sd.type = #{directive.type}
        </if>
        <if test="directive.startTime!=null and directive.startTime!=''">
            and sd.send_time &gt;= #{directive.startTime}
        </if>
        <if test="directive.endTime!=null and directive.endTime!=''">
            and sd.send_time &lt;= #{directive.endTime}
        </if>
        <if test="directive.content!=null and directive.content!=''">
            and sd.content like concat('%', #{directive.content},'%')
        </if>
        <if test="directive.sendName!=null and directive.sendName!=''">
            and bu.real_name like concat('%', #{directive.sendName},'%')
        </if>
        <if test="directive.sendDirectiveId!=null and directive.sendDirectiveId!=''">
            and sd.send_directive_id like concat('%', #{directive.sendDirectiveId},'%')
        </if>
        <if test="directive.receiveDirectiveIds!=null and directive.receiveDirectiveIds!=''">
            and sd.receive_directive_ids like concat('%', #{directive.receiveDirectiveIds},'%')
        </if>
    </select>
 
    <!--指令详情信息-->
    <select id="selectDirectiveInfo" resultType="org.springblade.modules.directive.vo.DirectiveVo">
        SELECT
            *
        FROM
            sys_directive
        WHERE
            1=1
        <if test="directive.id!=null">
            and id = #{directive.id}
        </if>
    </select>
 
    <!--查询指令图片信息集合-->
    <select id="getDirectiveFileList" resultType="org.springblade.modules.directive.entity.DirectiveFile">
        select * from sys_directive_file
        where 1=1
        <if test="id!=null and id!=''">
            and directive_id = #{id}
        </if>
    </select>
 
    <!--插入图片-->
    <insert id="saveDirectiveFile">
        insert into
            sys_directive_file
        (type,directive_id,url)
            value
        (#{directiveFile.type},#{directiveFile.directiveId},#{directiveFile.url})
    </insert>
 
    <!--删除图片-->
    <delete id="deleteByDirectiveId">
        delete from sys_directive_file where directive_id = #{id}
    </delete>
 
    <!--自定义分页-接收到的指令-->
    <select id="selectDirectiveReplyPage" resultType="org.springblade.modules.directive.vo.DirectiveVo">
        SELECT
        sd.*,
        bu.real_name sendName
        FROM
        sys_directive sd
        left join
        blade_user bu
        on
        bu.id = sd.send_directive_id
        where
        1=1
        <if test="directive.type!=null and directive.type!=''">
            and sd.type = #{directive.type}
        </if>
        <if test="directive.startTime!=null and directive.startTime!=''">
            and sd.send_time &gt;= #{directive.startTime}
        </if>
        <if test="directive.endTime!=null and directive.endTime!=''">
            and sd.send_time &lt;= #{directive.endTime}
        </if>
        <if test="directive.receiveDirectiveIds!=null and directive.receiveDirectiveIds!=''">
            and sd.receive_directive_ids like concat('%', #{directive.receiveDirectiveIds},'%')
        </if>
    </select>
 
</mapper>