智慧保安后台管理-外网项目备份
Administrator
2021-09-27 345d17cf82e1bbc1fbfbeec10193c2bed59cd674
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
<?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
        left join
        sys_information si
        on
        si.departmentid = bt.id
        left join
        sys_jurisdiction sj
        on
        sj.id = si.jurisdiction
        WHERE
            1=1
        <if test="gun.jurisdiction!=null and gun.jurisdiction!='' and gun.jurisdiction!='1372091709474910209'">
            and (sj.id = #{gun.jurisdiction} or sj.parent_id = #{gun.jurisdiction})
        </if>
        <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>
</mapper>