<?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.TComplaintMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.TComplaint">
|
<id column="id" property="id" />
|
<result column="userId" property="userId" />
|
<result column="driverId" property="driverId" />
|
<result column="reason" property="reason" />
|
<result column="notes" property="notes" />
|
<result column="state" property="state" />
|
<result column="status" property="status" />
|
<result column="createTime" property="createTime" />
|
<result column="auditId" property="auditId" />
|
<result column="auditPersonName" property="auditPersonName" />
|
<result column="auditTime" property="auditTime" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, userId, driverId, reason, notes, state, status, createTime,auditId,auditPersonName,auditTime
|
</sql>
|
<select id="getPageList" resultType="com.stylefeng.guns.modular.system.controller.resp.TComplaintResp">
|
select c.id, c.userId, c.driverId, c.reason, c.notes, c.state, c.status, c.createTime,c.auditId,c.auditPersonName,c.auditTime,
|
au.nickname AS userName,au.phone AS userPhone,d.phone AS driverPhone
|
from t_complaint c
|
left join t_app_user au on c.userId = au.id
|
left join t_driver d on c.driverId = d.id
|
<where>
|
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
|
AND c.createTime between #{startTime} and #{endTime}
|
</if>
|
<if test="userName != null and userName != ''">
|
AND au.nickname LIKE concat('%',#{userName},'%')
|
</if>
|
<if test="userPhone != null and userPhone != ''">
|
AND au.phone LIKE concat('%',#{userPhone},'%')
|
</if>
|
<if test="driverPhone != null and driverPhone != ''">
|
AND d.phone LIKE concat('%',#{driverPhone},'%')
|
</if>
|
<if test="state != null">
|
AND c.state = #{state}
|
</if>
|
<if test="roleType != null and roleType == 2">
|
AND d.branchOfficeId = #{objectId}
|
</if>
|
<if test="roleType != null and roleType == 3">
|
AND d.agentId = #{objectId}
|
</if>
|
</where>
|
ORDER BY c.state,c.createTime DESC
|
</select>
|
|
</mapper>
|