智慧保安后台管理-验收版本
Administrator
2021-12-01 ffa79b721ba96bd12b4ca394b8849a6b0c7bf01e
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
<?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.equipage.mapper.GunMapper">
 
    <!--枪支分页信息-->
    <select id="selectGunPage" resultType="org.springblade.modules.equipage.vo.GunVo">
        SELECT
            sg.*,bt.dept_name AS tenantName
        FROM
            sys_gun sg
        LEFT JOIN
            blade_dept bt
        ON
            sg.dept_id = bt.id
        WHERE
            1=1
        <if test="gun.tenantName!=null and  gun.tenantName!=''">
            and bt.dept_name like concat('%', #{gun.tenantName},'%')
        </if>
        <if test="gun.deptId!=null and gun.deptId!=''">
            and sg.dept_id = #{gun.deptId}
        </if>
        <if test="gun.gunCardNumber!=null and gun.gunCardNumber!=''">
            and sg.gun_card_number like concat('%', #{gun.gunCardNumber},'%')
        </if>
        <if test="gun.cardNumber!=null and gun.cardNumber!=''">
            and sg.card_number like concat('%', #{gun.cardNumber},'%')
        </if>
        <if test="gun.issueUnit!=null and gun.issueUnit!=''">
            and sg.issue_unit like concat('%', #{gun.issueUnit},'%')
        </if>
        <if test="gun.personInCharge!=null and gun.personInCharge!=''">
            and sg.person_in_charge like concat('%', #{gun.personInCharge},'%')
        </if>
    </select>
 
    <!--枪支详情信息-->
    <select id="selectGunInfo" resultType="org.springblade.modules.equipage.vo.GunVo">
        SELECT
            sg.*,bt.dept_name AS tenantName
        FROM
            sys_gun sg
        LEFT JOIN
            blade_dept bt
        ON
            sg.dept_id = bt.id
        WHERE
            1=1
        <if test="gun.id!=null">
            and sg.id = #{gun.id}
        </if>
    </select>
 
    <!--查询枪支数据-->
    <select id="getGunList" resultType="org.springblade.modules.equipage.vo.GunVo">
        SELECT
        sg.*,bt.dept_name AS tenantName,sll.longitude jd,sll.latitude wd,sll.record_time recordTime
        FROM
        sys_gun sg
        LEFT JOIN
        blade_dept bt
        ON
        sg.dept_id = bt.id
        left join
        sys_live_location sll
        on
        sll.worker_id = sg.id
        WHERE
        1=1
        and type = 3
        <if test="gun.tenantName!=null and  gun.tenantName!=''">
            and bt.dept_name like concat('%', #{gun.tenantName},'%')
        </if>
        <if test="gun.deptId!=null and gun.deptId!=''">
            and sg.dept_id = #{gun.deptId}
        </if>
        <if test="gun.gunCardNumber!=null and gun.gunCardNumber!=''">
            and sg.gun_card_number like concat('%', #{gun.gunCardNumber},'%')
        </if>
        <if test="gun.cardNumber!=null and gun.cardNumber!=''">
            and sg.card_number like concat('%', #{gun.cardNumber},'%')
        </if>
        <if test="gun.issueUnit!=null and gun.issueUnit!=''">
            and sg.issue_unit like concat('%', #{gun.issueUnit},'%')
        </if>
        <if test="gun.personInCharge!=null and gun.personInCharge!=''">
            and sg.person_in_charge like concat('%', #{gun.personInCharge},'%')
        </if>
    </select>
</mapper>