|
@@ -45,34 +45,45 @@
|
|
|
where userID = #{userid}
|
|
|
</select>
|
|
|
<select id="getMaturitySecondProductIds" resultType="java.lang.Integer">
|
|
|
- SELECT cshd.productID FROM cm_second_hand_detail cshd
|
|
|
- LEFT JOIN product p ON p.productID = cshd.productID
|
|
|
- WHERE p.validFlag = 2 AND cshd.onLineDate <![CDATA[ < ]]> #{beforeDays}
|
|
|
+ SELECT cshd.productID
|
|
|
+ FROM cm_second_hand_detail cshd
|
|
|
+ LEFT JOIN product p ON p.productID = cshd.productID
|
|
|
+ WHERE p.validFlag = 2
|
|
|
+ AND cshd.onLineDate <![CDATA[ < ]]> #{beforeDays}
|
|
|
</select>
|
|
|
+
|
|
|
<update id="updateProductValidFlag">
|
|
|
- UPDATE product SET validFlag = #{validFlag} where productID = #{productId}
|
|
|
+ UPDATE product
|
|
|
+ SET validFlag = #{validFlag}
|
|
|
+ where productID = #{productId}
|
|
|
</update>
|
|
|
+
|
|
|
<select id="getCouponUserIds" resultType="java.lang.Integer">
|
|
|
- SELECT userId FROM cm_coupon_club GROUP BY userId
|
|
|
+ SELECT userId
|
|
|
+ FROM cm_coupon_club
|
|
|
+ GROUP BY userId
|
|
|
</select>
|
|
|
+
|
|
|
<select id="getReceivedCoupons" resultType="com.caimei365.tools.model.bo.CouponDateBo">
|
|
|
- SELECT
|
|
|
- cc.id AS couponId,
|
|
|
- cc.startDate,
|
|
|
- cc.endDate
|
|
|
+ SELECT cc.id AS couponId,
|
|
|
+ cc.startDate,
|
|
|
+ cc.endDate
|
|
|
FROM cm_coupon_club a
|
|
|
- LEFT JOIN cm_coupon cc ON a.couponId = cc.id
|
|
|
- WHERE cc.delFlag = 0 AND a.delFlag = 0
|
|
|
- AND a.status = 1 AND cc.status != 2
|
|
|
- AND a.userId = #{userId}
|
|
|
- AND NOW() BETWEEN cc.startDate AND cc.endDate
|
|
|
+ LEFT JOIN cm_coupon cc ON a.couponId = cc.id
|
|
|
+ WHERE cc.delFlag = 0
|
|
|
+ AND a.delFlag = 0
|
|
|
+ AND a.status = 1
|
|
|
+ AND cc.status != 2
|
|
|
+ AND a.userId = #{userId}
|
|
|
+ AND NOW() BETWEEN cc.startDate AND cc.endDate
|
|
|
ORDER BY a.createDate DESC
|
|
|
</select>
|
|
|
+
|
|
|
<select id="getUnclaimedCoupons" resultType="com.caimei365.tools.model.bo.CouponDateBo">
|
|
|
SELECT
|
|
|
- id AS couponId,
|
|
|
- startDate,
|
|
|
- endDate
|
|
|
+ id AS couponId,
|
|
|
+ startDate,
|
|
|
+ endDate
|
|
|
FROM cm_coupon
|
|
|
WHERE delFlag = 0 AND couponsMode = 0 AND status != 2
|
|
|
AND NOW() BETWEEN startDate AND endDate
|
|
@@ -88,45 +99,119 @@
|
|
|
</if>
|
|
|
ORDER BY createDate DESC
|
|
|
</select>
|
|
|
+
|
|
|
<insert id="insertShortLink">
|
|
|
INSERT INTO cm_short_link (markId, shortLink, jumpLink, createTime)
|
|
|
- VALUES (#{markId}, #{shortLink}, #{url},NOW())
|
|
|
+ VALUES (#{markId}, #{shortLink}, #{url}, NOW())
|
|
|
</insert>
|
|
|
+
|
|
|
<insert id="insertProductViews">
|
|
|
INSERT INTO cm_product_views_record (productId, views, viewTime)
|
|
|
VALUES (#{productId}, #{views}, #{viewTime})
|
|
|
</insert>
|
|
|
+
|
|
|
<update id="updateSmsSendCount">
|
|
|
- UPDATE cm_sms_statistics SET sendNum = (sendNum + #{count}) WHERE markId = #{markId}
|
|
|
+ UPDATE cm_sms_statistics
|
|
|
+ SET sendNum = (sendNum + #{count})
|
|
|
+ WHERE markId = #{markId}
|
|
|
</update>
|
|
|
+
|
|
|
<select id="findIdByShortLink" resultType="java.lang.Integer">
|
|
|
- SELECT id FROM cm_short_link WHERE shortLink = #{shortLink}
|
|
|
+ SELECT id
|
|
|
+ FROM cm_short_link
|
|
|
+ WHERE shortLink = #{shortLink}
|
|
|
</select>
|
|
|
|
|
|
<select id="getInfoBykeyword" resultType="com.caimei365.tools.model.po.SearchFrequencyVo">
|
|
|
- select
|
|
|
- id,
|
|
|
- fromSearch,
|
|
|
- path,
|
|
|
- keyword,
|
|
|
- frequency,
|
|
|
- searchTime,
|
|
|
- trueStatus,
|
|
|
- linkageFrequency
|
|
|
+ select id,
|
|
|
+ fromSearch,
|
|
|
+ keyword,
|
|
|
+ frequency,
|
|
|
+ searchTime,
|
|
|
+ trueStatus,
|
|
|
+ linkageFrequency
|
|
|
+ from cm_user_search_frequency
|
|
|
+ where keyword = #{keyword}
|
|
|
+ and fromSearch = #{fromSearch}
|
|
|
+ and trueStatus = #{trueStutas}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findKeywordId" resultType="java.lang.Integer">
|
|
|
+ select id
|
|
|
from cm_user_search_frequency
|
|
|
- where keyword=#{keyword}
|
|
|
- and fromSearch=#{fromSearch}
|
|
|
- and trueStatus=#{trueStutas}
|
|
|
+ where keyword = #{keyword}
|
|
|
+ and delStatus = 1
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="findUserNameById" resultType="com.caimei365.tools.model.po.SysUser">
|
|
|
+ select ssr.systemId as id,su.username as username
|
|
|
+ from sys_system_role ssr
|
|
|
+ left join system_user su on ssr.systemId=su.id
|
|
|
+ where ssr.sysId=#{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getRoleNamesByUserId" resultType="java.lang.String">
|
|
|
+ SELECT DISTINCT r.role_name FROM system_role r
|
|
|
+ LEFT JOIN system_role_user ru ON r.id = ru.role_id
|
|
|
+ WHERE ru.user_id = #{userId}
|
|
|
+ </select>
|
|
|
+
|
|
|
<update id="upFrequencyById">
|
|
|
- update cm_user_search_frequency set frequency=#{frequency},delStatus=1 where id=#{id}
|
|
|
+ update cm_user_search_frequency
|
|
|
+ set frequency=#{frequency},
|
|
|
+ delStatus=1
|
|
|
+ where id = #{id}
|
|
|
</update>
|
|
|
+
|
|
|
<update id="uplinkageFrequencyById">
|
|
|
- update cm_user_search_frequency set linkageFrequency=#{linkageFrequency}, frequency=#{frequency},delStatus=#{delStatus} where id=#{id}
|
|
|
+ update cm_user_search_frequency
|
|
|
+ set linkageFrequency=#{linkageFrequency},
|
|
|
+ frequency=#{frequency},
|
|
|
+ delStatus=#{delStatus}
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateKeywordTimes">
|
|
|
+ UPDATE cm_user_search_frequency
|
|
|
+ SET frequency = frequency + 1,
|
|
|
+ searchtime = NOW()
|
|
|
+ WHERE id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updateAllKeyword">
|
|
|
+ update cm_user_search_frequency
|
|
|
+ set recommendFlag=0,
|
|
|
+ recommendStatus=0
|
|
|
+ where trueStatus = 0
|
|
|
+ and delStatus = 1
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="getRecommendKeyword">
|
|
|
+ SELECT keyWordId
|
|
|
+ FROM cm_label_source
|
|
|
+ WHERE saveTime BETWEEN #{date} AND NOW()
|
|
|
+ GROUP BY keyWordId
|
|
|
+ HAVING COUNT(keywordId) > 1
|
|
|
</update>
|
|
|
- <insert id="saveInfo" parameterType="com.caimei365.tools.model.po.SearchFrequencyVo">
|
|
|
- insert into cm_user_search_frequency(fromSearch,path,keyword,frequency,searchTime,linkageFrequency)
|
|
|
- values (#{fromSearch},#{path},#{keyword},#{frequency},#{searchTime},#{linkageFrequency})
|
|
|
|
|
|
+ <update id="updateRecommend">
|
|
|
+ update cm_user_search_frequency
|
|
|
+ set recommendStatus = 1
|
|
|
+ where id in
|
|
|
+ <foreach collection="ids" separator="," item="id" open="(" close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <insert id="saveInfo" parameterType="com.caimei365.tools.model.po.SearchFrequencyVo" useGeneratedKeys="true"
|
|
|
+ keyProperty="id">
|
|
|
+ insert into cm_user_search_frequency(keyword, frequency, searchTime)
|
|
|
+ values (#{keyword}, #{frequency}, now())
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertLabelSource">
|
|
|
+ insert into cm_label_source(keywordId, saveTime, path)
|
|
|
+ VALUES (#{id}, now(), #{path})
|
|
|
</insert>
|
|
|
</mapper>
|