<?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.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>
|
|
<select id="selectCar" resultType="java.util.HashMap">
|
SELECT * FROM `sys_car` WHERE equipment_code IS NOT NULL
|
</select>
|
</mapper>
|