<?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.system.dao.TTimeoutAppealMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TTimeoutAppeal">
|
<id column="id" property="id" />
|
<result column="createTime" property="createTime" />
|
<result column="orderId" property="orderId" />
|
<result column="driverId" property="driverId" />
|
<result column="content" property="content" />
|
<result column="imgList" property="imgList" />
|
<result column="returnMoney" property="returnMoney" />
|
<result column="state" property="state" />
|
<result column="dealTime" property="dealTime" />
|
<result column="remark" property="remark" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, createTime, orderId, driverId, content, imgList, returnMoney, state, dealTime, remark
|
</sql>
|
|
|
<select id="getAppealList" resultType="map">
|
select
|
ta.*,
|
d.name driverName,
|
d.phone driverPhone,
|
ol.orderNum orderNum,
|
case when ol.type = 4 then '同城物流'
|
when ol.type = 5 then '跨城物流' end types,
|
ol.timeOutMoney timeOutMoney,
|
TIMESTAMPDIFF(MINUTE,ol.arriveTimeExpect,ol.endServiceTime) timeOut
|
from t_timeout_appeal ta
|
left join t_driver d
|
on ta.driverId = d.id
|
left join t_order_logistics ol
|
on ta.orderId = ol.id
|
<where>
|
<if test="driverName != null and driverName != ''">
|
and d.name like CONCAT('%',#{driverName},'%')
|
</if>
|
<if test="driverPhone != null and driverPhone != ''">
|
and d.phone like CONCAT('%',#{driverPhone},'%')
|
</if>
|
<if test="orderNum != null and orderNum != ''">
|
and ol.orderNum like CONCAT('%',#{orderNum},'%')
|
</if>
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
and ta.createTime between CONCAT(#{startTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')
|
</if>
|
</where>
|
order by ta.id desc
|
</select>
|
</mapper>
|