|
@@ -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,61 @@
|
|
|
</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,
|
|
|
+ path,
|
|
|
+ keyword,
|
|
|
+ frequency,
|
|
|
+ searchTime,
|
|
|
+ trueStatus,
|
|
|
+ linkageFrequency
|
|
|
from cm_user_search_frequency
|
|
|
- where keyword=#{keyword}
|
|
|
- and fromSearch=#{fromSearch}
|
|
|
- and trueStatus=#{trueStutas}
|
|
|
+ where keyword = #{keyword}
|
|
|
+ and fromSearch = #{fromSearch}
|
|
|
+ and trueStatus = #{trueStutas}
|
|
|
</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>
|
|
|
- <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})
|
|
|
|
|
|
+ <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})
|
|
|
</insert>
|
|
|
</mapper>
|