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
68
69
70
71
72
73
74
75
76
<?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.AppEvaluateMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.shunfeng.model.AppEvaluate">
        <id column="id" property="id" />
        <result column="addTime" property="addTime" />
        <result column="userId" property="userId" />
        <result column="driverId" property="driverId" />
        <result column="score" property="score" />
        <result column="content" property="content" />
        <result column="type" property="type" />
        <result column="userPhone" property="userPhone" />
        <result column="driverPhone" property="driverPhone" />
        <result column="orderId" property="orderId" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, addTime, userId, driverId, score, content, type, userPhone, driverPhone, orderId
    </sql>
    <!--获取评价数据-->
    <select id="getAppEvaluate" resultType="map">
        select e.*,d.`name` as driverName,d.phone as driverPhone_ ,u.nickName ,u.phone as userPhone_
        from app_evaluate e
        left join app_driver_taxi d on e.driverId =d.id
        left join app_user_info u on e.userId=u.id
      <where>
          and e.type = 1
          <if test="beginTime != null and beginTime != ''">
              and e.addTime &gt;= CONCAT(#{beginTime},' 00:00:00')
          </if>
          <if test=" endTime != null and endTime != ''">
              and e.addTime &lt;=  CONCAT(#{endTime},' 23:59:59')
          </if>
          <if test=" score>0">
              and e.score = #{score}
          </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 e.addTime desc
    </select>
    <!--顺风车评价列表-->
    <select id="getAppEvaluateRide" resultType="map">
        select e.*,u1.name as driverName,u1.phone as driverPhone_ ,u.nickName ,u.phone as userPhone_
        from app_evaluate e
        left join t_driver u1 on u1.id=e.driverId
        left join t_user u on e.userId=u.id
        <where>
            and e.type = 2
            <if test="beginTime != null and beginTime != ''">
                and e.addTime &gt;= CONCAT(#{beginTime},' 00:00:00')
            </if>
            <if test=" endTime != null and endTime != ''">
                and e.addTime &lt;=  CONCAT(#{endTime},' 23:59:59')
            </if>
            <if test=" score>0">
                and e.score = #{score}
            </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.name like '%${driverName}%' or u1.phone like  '%${driverName}%')
            </if>
        </where>
        order by e.addTime desc
    </select>
 
</mapper>