智慧保安后台管理-外网项目备份
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.EquipageMapper">
 
    <!--装备分页信息-->
    <select id="selectEquipagePage" resultType="org.springblade.modules.equipage.vo.EquipageVo">
        SELECT
            se.*,bt.dept_name AS tenantName
        FROM
            sys_equipage se
        LEFT JOIN
            blade_dept bt
        ON
            se.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="equipage.jurisdiction!=null and equipage.jurisdiction!='' and equipage.jurisdiction!='1372091709474910209'">
            and (sj.id = #{equipage.jurisdiction} or sj.parent_id = #{equipage.jurisdiction})
        </if>
        <if test="equipage.tenantName!=null and  equipage.tenantName!=''">
            and bt.dept_name like concat('%', #{equipage.tenantName},'%')
        </if>
        <if test="equipage.deptId!=null and equipage.deptId!=''">
            and se.dept_id = #{equipage.deptId}
        </if>
        <if test="equipage.number!=null and equipage.number!=''">
            and se.number like concat('%', #{equipage.number},'%')
        </if>
        <if test="equipage.name!=null and equipage.name!=''">
            and se.name like concat('%', #{equipage.name},'%')
        </if>
        <if test="equipage.brand!=null and equipage.brand!=''">
            and se.brand like concat('%', #{equipage.brand},'%')
        </if>
        <if test="equipage.personInCharge!=null and equipage.personInCharge!=''">
            and se.person_in_charge like concat('%', #{equipage.personInCharge},'%')
        </if>
    </select>
 
    <!--车辆详情信息-->
    <select id="selectEquipageInfo" resultType="org.springblade.modules.equipage.vo.EquipageVo">
        SELECT
            se.*,bt.dept_name AS tenantName
        FROM
            sys_equipage se
        LEFT JOIN
            blade_dept bt
        ON
            se.dept_id = bt.id
        WHERE
            1=1
        <if test="equipage.id!=null">
            and se.id = #{equipage.id}
        </if>
    </select>
</mapper>