|
@@ -2,13 +2,13 @@
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.caimei365.manager.dao.KeyWordDao">
|
|
|
<insert id="insertLabel">
|
|
|
- insert into cm_user_search_frequency(fromSearch, keyword, frequency, trueStatus, addTime)
|
|
|
- values (1, #{keyword}, 0, 1, now())
|
|
|
+ insert into cm_user_search_frequency(fromSearch, keyword, frequency, trueStatus, addTime,linkageStatus)
|
|
|
+ values (1, #{keyword}, 0, 1, now(),#{linkageStatus})
|
|
|
</insert>
|
|
|
|
|
|
<insert id="insertLabelByExcel">
|
|
|
- insert into cm_user_search_frequency(fromSearch, keyword, frequency, trueStatus, addTime)
|
|
|
- values (3, #{keyword}, 0, 1, now())
|
|
|
+ insert into cm_user_search_frequency(fromSearch, keyword, frequency, trueStatus, addTime,linkageStatus)
|
|
|
+ values (3, #{keyword}, 0, 1, now(),#{linkageStatus})
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateLabelStatus">
|
|
@@ -31,8 +31,27 @@
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
+ <update id="updateCmUserSearchFrequency" parameterType="com.caimei365.manager.entity.caimei.KeyWord">
|
|
|
+ update cm_user_search_frequency
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="fromSearch != null">fromSearch = #{fromSearch},</if>
|
|
|
+ <if test="keyword != null and keyword != ''">keyword = #{keyword},</if>
|
|
|
+ <if test="frequency != null">frequency = #{frequency},</if>
|
|
|
+<!-- <if test="trueStatus != null">trueStatus = #{trueStatus},</if>-->
|
|
|
+<!-- <if test="delStatus != null">delStatus = #{delStatus},</if>-->
|
|
|
+<!-- <if test="linkageFrequency != null">linkageFrequency = #{linkageFrequency},</if>-->
|
|
|
+ <if test="linkageStatus != null">linkageStatus = #{linkageStatus},</if>
|
|
|
+ <if test="searchTime != null">searchTime = #{searchTime},</if>
|
|
|
+<!-- <if test="recommendStatus != null and recommendStatus != ''">recommendStatus = #{recommendStatus},</if>-->
|
|
|
+ <if test="recommendTime != null">recommendTime = #{recommendTime},</if>
|
|
|
+<!-- <if test="recommendFlag != null and recommendFlag != ''">recommendFlag = #{recommendFlag},</if>-->
|
|
|
+ <if test="addTime != null">addTime = #{addTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
<select id="findList" resultType="com.caimei365.manager.entity.caimei.KeyWord">
|
|
|
- SELECT cusf.id AS id, frequency, cusf.keyword as keyword,addTime,
|
|
|
+ SELECT cusf.id AS id, frequency, cusf.keyword as keyword,addTime,linkageStatus,
|
|
|
cusf.searchTime as searchTime,cusf.trueStatus as labelStatus,cusf.fromSearch as fromSearch
|
|
|
FROM cm_user_search_frequency cusf
|
|
|
WHERE cusf.delStatus = 1
|
|
@@ -66,6 +85,34 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="findLinkageStatus" resultType="java.util.HashMap">
|
|
|
+ SELECT
|
|
|
+ (SELECT id from info a WHERE
|
|
|
+ a.enabledStatus = 1
|
|
|
+ and a.onlineStatus = 2
|
|
|
+ and a.delFlag = 0
|
|
|
+ and a.labelIds LIKE CONCAT('%',cusf.id,'%') LIMIT 0,1)
|
|
|
+ as info,
|
|
|
+ (SELECT p.productID from product p
|
|
|
+ left join cm_organize_product_info copi on copi.productId = p.productId
|
|
|
+ where copi.validFlag = 2
|
|
|
+ and copi.organizeId=0
|
|
|
+ and p.labelIds LIKE CONCAT('%',cusf.id,'%') LIMIT 0,1)
|
|
|
+ as product,
|
|
|
+ (SELECT id from cm_baike_product a
|
|
|
+ WHERE a.delFlag = 0
|
|
|
+ and a.status = 1
|
|
|
+ and a.auditStatus = 2
|
|
|
+ and a.onlineStatus = 2
|
|
|
+ and a.labelIds LIKE CONCAT('%',cusf.id,'%')LIMIT 0,1)
|
|
|
+ as cm_baike_product,
|
|
|
+ (SELECT id from cm_product_archive
|
|
|
+ WHERE labelIds LIKE CONCAT('%',cusf.id,'%') LIMIT 0,1)
|
|
|
+ as cm_product_archive
|
|
|
+ from cm_user_search_frequency as cusf
|
|
|
+ WHERE id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="findKeywordExist" resultType="java.lang.Integer">
|
|
|
select id
|
|
|
from cm_user_search_frequency
|