Pu Zhibing
2025-07-23 2ab5f166d0fad4b1a860fde3bab1adb46d062c3f
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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.stylefeng.guns.modular.shunfeng.dao.AppComplaintsMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.shunfeng.model.AppComplaints">
        <id column="id" property="id" />
        <result column="addTime" property="addTime" />
        <result column="userId" property="userId" />
        <result column="context" property="content" />
        <result column="reMark" property="reMark" />
        <result column="phone" property="phone" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, addTime, userId, context, reMark, phone
    </sql>
    <!--获取投诉列表(出租车)-->
    <select id="getAppComplaintsTaxi" resultType="map">
        select c.*,d.`name` as driverName,d.phone as driverPhone_ ,u.nickName ,u.phone as userPhone_ from app_complaints c
        left join app_driver_taxi d on c.driverId =d.id
        left join app_user_info u on c.userId=u.id
    <where>
        <if test="type!=null">
            and c.type=2
        </if>
        <if test="beginTime != null and beginTime != ''">
            and c.addTime &gt;= CONCAT(#{beginTime},' 00:00:00')
        </if>
        <if test=" endTime != null and endTime != ''">
            and c.addTime &lt;=  CONCAT(#{endTime},' 23:59:59')
        </if>
        <if test="userName!=null and userName!=''">
            and (u.nickName like '%${userName}%' or u.phone like  '%${userName}%')
        </if>
        <if test="driverName!=null and driverName!=''">
            and (d.name like '%${driverName}%' or d.phone like  '%${driverName}%')
        </if>
    </where>
        order by c.addTime desc
    </select>
    <!--顺风车投诉-->
    <select id="getAppComplaintsRide" resultType="map">
        select c.*,u1.realName as driverName,u1.phone as driverPhone_ ,u.nickName ,u.phone as userPhone_ from app_complaints c
        left join app_user_info u1 on u1.driverId=c.driverId
        left join app_user_info u on c.userId=u.id
        <where>
            <if test="type!=null">
                and c.type=#{type}
            </if>
            <if test="beginTime != null and beginTime != ''">
                and c.addTime &gt;= CONCAT(#{beginTime},' 00:00:00')
            </if>
            <if test=" endTime != null and endTime != ''">
                and c.addTime &lt;=  CONCAT(#{endTime},' 23:59:59')
            </if>
            <if test="userName!=null and userName!=''">
                and (u.nickName like '%${userName}%' or u.phone like  '%${userName}%')
            </if>
            <if test="driverName!=null and driverName!=''">
                and (u1.realName like '%${driverName}%' or u1.phone like  '%${driverName}%')
            </if>
        </where>
        order by c.addTime desc
    </select>
</mapper>