Pu Zhibing
2025-06-19 a05b419384e148fc950c77553816a2d05144f4ae
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
<?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 &lt;= #{item.endTime}
            </if>
        </where>
        order by a.create_time desc
    </select>
</mapper>