智慧保安后台管理项目备份
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
<?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>
</mapper>