<?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="com.ruoyi.system.mapper.CarMapper">
|
|
<select id="getCarList" resultType="com.ruoyi.system.query.CarListResp">
|
select
|
a.id,
|
a.vehicle_number as vehicleNumber,
|
a.license_plate_color as licensePlateColor,
|
c.name as enterpriseName,
|
a.passenger_capacity as passengerCapacity,
|
a.brand_model as brandModel,
|
a.vehicle_type as vehicleType,
|
b.name as driverName,
|
a.vehicle_color as vehicleColor,
|
a.registration_date as registrationDate,
|
a.operating_area as operatingArea,
|
a.operate_type as operateType,
|
a.status
|
from t_car a
|
left join t_driver b on (a.vehicle_number = b.vehicle_number and b.status = 1)
|
left join t_enterprise c on (a.enterprise_id = c.id)
|
<where>
|
<if test="null != item.vehicleNumber and '' != item.vehicleNumber">
|
and a.vehicle_number like CONCAT('%', #{item.vehicleNumber}, '%')
|
</if>
|
<if test="null != item.enterpriseName and '' != item.enterpriseName">
|
and c.name like CONCAT('%', #{item.enterpriseName}, '%')
|
</if>
|
<if test="null != item.driverName and '' != item.driverName">
|
and b.name like CONCAT('%', #{item.driverName}, '%')
|
</if>
|
<if test="null != item.carColor and '' != item.carColor">
|
and a.vehicle_color like CONCAT('%', #{item.carColor}, '%')
|
</if>
|
<if test="null != item.area and '' != item.area">
|
and a.operating_area like CONCAT('%', #{item.area}, '%')
|
</if>
|
<if test="null != item.brandModel and '' != item.brandModel">
|
and a.brand_model like CONCAT('%', #{item.brandModel}, '%')
|
</if>
|
<if test="null != item.startNum and null != item.endNum">
|
and a.passenger_capacity between #{item.startNum} and #{item.endNum}
|
</if>
|
<if test="null != item.operateType and '' != item.operateType">
|
and a.operate_type like CONCAT('%', #{item.operateType}, '%')
|
</if>
|
<if test="null != item.status">
|
and a.status = #{item.status}
|
</if>
|
</where>
|
order by a.create_time desc
|
</select>
|
|
</mapper>
|