<?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.ruoyi.member.mapper.member.MemberSuggestMapper">
|
|
<select id="pageAppUserSuggest" resultType="com.ruoyi.member.domain.vo.AppSuggestPageVo">
|
SELECT
|
suggest_content suggestContent,
|
replay_content replayContent,
|
shop_replay_content shopReplayContent,
|
create_time createTime
|
FROM t_member_suggest
|
WHERE del_flag = 0 AND create_user_id = #{param.userId}
|
AND suggest_type = #{param.suggestType}
|
ORDER BY create_time DESC
|
</select>
|
|
<update id="deleteMemberSuggestTag">
|
UPDATE t_member_suggest SET suggest_tags = TRIM(BOTH ',' FROM REPLACE(CONCAT(',', suggest_tags, ','), CONCAT(',',#{suggestTag},','), ','))
|
WHERE FIND_IN_SET(#{suggestTag}, suggest_tags) > 0
|
</update>
|
|
|
<select id="pageMgtMemberSuggest" resultType="com.ruoyi.member.domain.vo.MgtMemberSuggestPageVo">
|
SELECT
|
tms.suggest_id suggestId,
|
tm.real_name userRealName,
|
tm.nick_name userNickName,
|
CASE tm.gender WHEN 0 THEN "男" WHEN 1 THEN "女" ELSE "未知" END gender,
|
tm.mobile userMobile,
|
CASE tms.suggest_type WHEN 1 THEN "平台建议" WHEN 2 THEN "店铺建议" ELSE "未知" END suggestType,
|
tms.suggest_content suggestContent,
|
tms.replay_content replayContent,
|
tms.shop_replay_content shopReplayContent,
|
CASE tms.replay_flag WHEN 1 THEN "已回复" ELSE "未回复" END suggestStatus,
|
tms.create_time createTime,
|
tms.replay_user_name replayUserName,
|
tms.replay_time replayTime,
|
tms.response_time responseTime,
|
tms.shop_replay_user_name shopReplayUserName,
|
tms.shop_replay_time shopReplayTime,
|
tms.shop_response_time shopResponseTime,
|
tms.suggest_tags suggestTags,
|
tms.shop_id shopId
|
FROM
|
t_member_suggest tms
|
INNER JOIN t_member tm ON tms.create_user_id = tm.user_id
|
WHERE tms.del_flag = 0
|
<if test="param.keyword!=null and param.keyword !='' and param.shopIds==null">
|
AND (tm.real_name LIKE CONCAT('%',#{param.keyword},'%') OR tm.nick_name LIKE CONCAT('%',#{param.keyword},'%') OR tm.mobile LIKE CONCAT('%',#{param.keyword},'%') OR tms.replay_user_name LIKE CONCAT('%',#{param.keyword},'%') OR tms.shop_replay_user_name LIKE CONCAT('%',#{param.keyword},'%'))
|
</if>
|
<if test="param.keyword!=null and param.keyword !='' and param.shopIds != null">
|
AND (tm.real_name LIKE CONCAT('%',#{param.keyword},'%') OR tm.nick_name LIKE CONCAT('%',#{param.keyword},'%') OR tm.mobile LIKE CONCAT('%',#{param.keyword},'%') OR tms.replay_user_name LIKE CONCAT('%',#{param.keyword},'%') OR tms.shop_replay_user_name LIKE CONCAT('%',#{param.keyword},'%') OR FIND_IN_SET(tms.shop_id, #{param.shopIds}) > 0)
|
</if>
|
<if test="param.keyword == null and param.shopIds!=null and param.shopIds!=''">
|
AND FIND_IN_SET(tms.shop_id, #{param.shopIds}) > 0
|
</if>
|
<if test="param.createStartTime!=null and param.createStartTime!=''">
|
AND Date(tms.create_time) >= #{param.createStartTime}
|
</if>
|
<if test="param.createEndTime!=null and param.createEndTime!=''">
|
AND Date(tms.create_time) <= #{param.createEndTime}
|
</if>
|
<if test="param.suggestStatus!=null and param.suggestStatus!=''">
|
AND tms.replay_flag = #{param.suggestStatus}
|
</if>
|
<if test="param.gender!=null">
|
AND tm.gender = #{param.gender}
|
</if>
|
<if test="param.tags!=null and param.tags!=''">
|
AND tms.suggest_tags REGEXP #{param.tags}
|
</if>
|
<if test="param.shopReplayStartTime!=null and param.shopReplayStartTime!=''">
|
AND Date(tms.shop_replay_time) >= #{param.shopReplayStartTime}
|
</if>
|
<if test="param.shopReplayEndTime!=null and param.shopReplayEndTime!=''">
|
AND Date(tms.shop_replay_time) <= #{param.shopReplayEndTime}
|
</if>
|
<if test="param.replayStartTime!=null and param.replayStartTime!=''">
|
AND Date(tms.replay_time) >= #{param.replayStartTime}
|
</if>
|
<if test="param.replayEndTime!=null and param.replayEndTime!=''">
|
AND Date(tms.replay_time) <= #{param.replayEndTime}
|
</if>
|
<if test="param.suggestType!=null and param.suggestType!=''">
|
AND tms.suggest_type = #{param.suggestType}
|
</if>
|
ORDER BY
|
<if test="param.suggestSort!=null and param.suggestSort==1">
|
tms.response_timestamp ASC,
|
</if>
|
<if test="param.suggestSort!=null and param.suggestSort==2">
|
tms.response_timestamp DESC,
|
</if>
|
<if test="param.suggestSort!=null and param.suggestSort==3">
|
tms.shop_response_timestamp ASC,
|
</if>
|
<if test="param.suggestSort!=null and param.suggestSort==4">
|
tms.shop_response_timestamp DESC,
|
</if>
|
tms.replay_flag ASC,tms.create_time DESC
|
</select>
|
</mapper>
|