<?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.mzl.flower.mapper.content.FeedbackMapper">
|
<select id="queryPage" resultType="com.mzl.flower.dto.response.content.FeedbackDTO">
|
SELECT
|
f.*,
|
c.`name` AS customerName,
|
u.tel AS customerTel
|
FROM
|
t_feedback f
|
LEFT JOIN t_user u ON f.user_id = u.id
|
LEFT JOIN t_customer_info c ON f.user_id = c.user_id
|
WHERE
|
f.deleted = 0
|
<if test="dto.id != null and dto.name != 0">
|
and f.id = #{dto.id}
|
</if>
|
<if test="dto.name != null and dto.name != ''">
|
and c.name like concat('%', #{dto.name}, '%')
|
</if>
|
<if test="dto.tel != null and dto.tel != ''">
|
and u.tel like concat('%', #{dto.tel}, '%')
|
</if>
|
<if test="dto.handled != null and dto.handled">
|
and f.handled = 1
|
</if>
|
<if test="dto.handled != null and !dto.handled">
|
and f.handled = 0
|
</if>
|
<if test="dto.userId != null and dto.userId != ''">
|
and f.user_id = #{dto.userId}
|
</if>
|
<if test="dto.createDateBegin!=null ">
|
<![CDATA[
|
AND t.create_time >= #{dto.createDateBegin}
|
]]>
|
</if>
|
<if test="dto.createDateEnd!=null ">
|
<![CDATA[
|
AND t.create_time <= #{dto.createDateEnd}
|
]]>
|
</if>
|
order by t.create_time desc
|
</select>
|
</mapper>
|