huliguo
15 小时以前 c5d38d650d2ac4101b1293a4f17346e7d5420076
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?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.shop.mapper.shop.ShopSuggestMapper">
 
    <select id="pageMerShopSuggest" resultType="com.ruoyi.shop.domain.vo.MerShopSuggestVo">
        SELECT
        suggest_content suggestContent,
        replay_content replayContent,
        create_time createTime
        FROM
        t_shop_suggest
        WHERE del_flag = 0 AND shop_id = #{param.shopId} AND create_user_id =  #{param.userId}
        ORDER BY create_time DESC
    </select>
 
    <update id="deleteShopSuggestTag">
        UPDATE t_shop_suggest SET suggest_tags = TRIM(BOTH ',' FROM REPLACE(CONCAT(',', suggest_tags, ','), CONCAT(',',#{suggestTag},','), ','))
        WHERE FIND_IN_SET(#{suggestTag}, suggest_tags) &gt; 0
    </update>
    
    <select id="pageMgtShopSuggest" resultType="com.ruoyi.shop.domain.vo.MgtShopSuggestPageVo">
        SELECT
        tss.suggest_id suggestId,
        ts.shop_name shopName,
        ts.shop_type shopType,
        ts.shopowner_name shopownerName,
        ts.shopowner_phone shopownerPhone,
        tss.suggest_content suggestContent,
        tss.replay_content replayContent,
        CASE tss.replay_flag WHEN 1 THEN "已回复" ELSE "未回复" END suggestStatus,
        tss.create_time createTime,
        tss.replay_user_name replayUserName,
        tss.replay_time replayTime,
        tss.response_time responseTime,
        tss.suggest_tags suggestTags
        FROM t_shop_suggest tss
        LEFT JOIN t_shop ts ON tss.shop_id = ts.shop_id
        WHERE tss.del_flag = 0
        <if test="param.keyword!=null and param.keyword !=''">
            AND (ts.shop_name LIKE CONCAT('%',#{param.keyword},'%') OR ts.shopowner_name LIKE CONCAT('%',#{param.keyword},'%') OR ts.shopowner_phone LIKE CONCAT('%',#{param.keyword},'%') OR tss.replay_user_name LIKE CONCAT('%',#{param.keyword},'%'))
        </if>
        <if test="param.createStartTime!=null and param.createStartTime!=''">
            AND Date(tss.create_time) &gt;= #{param.createStartTime}
        </if>
        <if test="param.createEndTime!=null and param.createEndTime!=''">
            AND Date(tss.create_time) &lt;= #{param.createEndTime}
        </if>
        <if test="param.suggestStatus!=null">
            AND tss.replay_flag = #{param.suggestStatus}
        </if>
        <if test="param.tags!=null and param.tags!=''">
            AND tss.suggest_tags REGEXP #{param.tags}
        </if>
        <if test="param.replayStartTime!=null and param.replayStartTime!=''">
            AND Date(tss.replay_time) &gt;= #{param.replayStartTime}
        </if>
        <if test="param.replayEndTime!=null and param.replayEndTime!=''">
            AND Date(tss.replay_time) &lt;= #{param.replayEndTime}
        </if>
        ORDER BY
        <if test="param.suggestSort!=null and param.suggestSort==1">
            tss.response_timestamp ASC,
        </if>
        <if test="param.suggestSort!=null and param.suggestSort==2">
            tss.response_timestamp DESC,
        </if>
            tss.replay_flag ASC,tss.create_time DESC
    </select>
</mapper>