智慧保安后台管理项目备份
Administrator
2021-11-29 efaed0faaeb1d7c8ef53cbf8c5e3af15e466b37d
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
<?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.CarMapper">
 
    <!--车辆分页信息-->
    <select id="selectCarPage" resultType="org.springblade.modules.equipage.vo.CarVo">
        SELECT
            sc.*,bt.dept_name AS tenantName
        FROM
            sys_car sc
        LEFT JOIN
            blade_dept bt
        ON
            sc.dept_id = bt.id
        WHERE
            1=1
        <if test="car.tenantName!=null and  car.tenantName!=''">
            and bt.dept_name like concat('%', #{car.tenantName},'%')
        </if>
        <if test="car.carNumber!=null and car.carNumber!=''">
            and sc.car_number like concat('%', #{car.carNumber},'%')
        </if>
        <if test="car.deptId!=null and car.deptId!=''">
            and sc.dept_id = #{car.deptId}
        </if>
        <if test="car.type!=null">
            and sc.equipment_code is not null
        </if>
        <if test="car.numberType!=null and car.numberType!=''">
            and sc.number_type like concat('%', #{car.numberType},'%')
        </if>
        <if test="car.carType!=null and car.carType!=''">
            and sc.car_type like concat('%', #{car.carType},'%')
        </if>
        <if test="car.personInCharge!=null and car.personInCharge!=''">
            and sc.person_in_charge like concat('%', #{car.personInCharge},'%')
        </if>
    </select>
 
    <!--车辆详情信息-->
    <select id="selectCarInfo" resultType="org.springblade.modules.equipage.vo.CarVo">
        SELECT
            sc.*,bt.dept_name AS tenantName
        FROM
            sys_car sc
        LEFT JOIN
            blade_dept bt
        ON
            sc.dept_id = bt.id
        WHERE
            1=1
        <if test="car.id!=null">
            and sc.id = #{car.id}
        </if>
    </select>
</mapper>