<?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.ComplainMapper">
|
|
|
<select id="getComplainList" resultType="com.ruoyi.system.query.ComplainListResp">
|
select
|
b.vehicle_name as carName,
|
b.vehicle_number as vehicleNumber,
|
a.content,
|
a.complain_phone as complainPhone,
|
c.name as driverName,
|
d.name as enterpriseName,
|
a.complain_time as complainTime,
|
a.treatment_state as treatmentState,
|
a.treatment_user as treatmentUser,
|
a.treatment_time as treatmentTime,
|
a.treatment_remark as treatmentRemark
|
from t_complain a
|
left join t_car b on (a.car_id = b.id)
|
left join t_driver c on (a.driver_id = c.id)
|
left join t_enterprise d on (a.enterprise_id = d.id)
|
<where>
|
<if test="null != item.complainPhone and '' != item.complainPhone">
|
and a.complain_phone like CONCAT('%', #{item.complainPhone}, '%')
|
</if>
|
<if test="null != item.vehicleNumber and '' != item.vehicleNumber">
|
and b.vehicle_number like CONCAT('%', #{item.vehicleNumber}, '%')
|
</if>
|
<if test="null != item.driverName and '' != item.driverName">
|
and c.name like CONCAT('%', #{item.driverName}, '%')
|
</if>
|
<if test="null != item.enterpriseName and '' != item.enterpriseName">
|
and d.name like CONCAT('%', #{item.enterpriseName}, '%')
|
</if>
|
<if test="null != item.startTime and '' != item.startTime">
|
and a.complain_time >= #{item.startTime}
|
</if>
|
<if test="null != item.endTime and '' != item.endTime">
|
and a.complain_time <= #{item.endTime}
|
</if>
|
</where>
|
order by a.create_time desc
|
</select>
|
</mapper>
|