<?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 >= CONCAT(#{beginTime},' 00:00:00')
|
</if>
|
<if test=" endTime != null and endTime != ''">
|
and e.addTime <= 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 >= CONCAT(#{beginTime},' 00:00:00')
|
</if>
|
<if test=" endTime != null and endTime != ''">
|
and e.addTime <= 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>
|