<?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
|
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="car.jurisdiction!=null and car.jurisdiction!='' and car.jurisdiction!='1372091709474910209'">
|
and (sj.id = #{car.jurisdiction} or sj.parent_id = #{car.jurisdiction})
|
</if>
|
<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.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.brand!=null and car.brand!=''">
|
and sc.brand like concat('%', #{car.brand},'%')
|
</if>
|
<if test="car.mode!=null and car.mode!=''">
|
and sc.mode like concat('%', #{car.mode},'%')
|
</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>
|
|
<select id="selectCar" resultType="java.util.HashMap">
|
SELECT equipment_code as code,car_number as carnumber FROM `sys_car` WHERE equipment_code IS NOT NULL
|
</select>
|
</mapper>
|