烟台政务云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

89 lines
2.7 KiB

<?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.epmet.dao.WxmpResiUserSubscribeDao">
<select id="getResiSubscribeInfo" parameterType="String" resultType="java.lang.Integer">
select
count
from Wxmp_Resi_User_Subscribe
where
del_flag = 0
and customer_id = #{customerId}
and template_id = #{templateId}
and wx_open_id = #{openId}
and user_id = #{userId}
</select>
<update id="decreaseResiSubscribeCount">
update Wxmp_Resi_User_Subscribe
set count = if(count <![CDATA[<]]> 1, 0, count - ${num} ),
UPDATED_TIME = now()
where
del_flag = 0
and customer_id = #{customerId}
and template_id = #{templateId}
and wx_open_id = #{openId}
and user_id = #{userId}
</update>
<update id="clearResiSubscribeCount" parameterType="String">
update Wxmp_Resi_User_Subscribe
set count = 0,
UPDATED_TIME = now()
where
del_flag = 0
and customer_id = #{customerId}
and template_id = #{templateId}
and wx_open_id = #{openId}
and user_id = #{userId}
</update>
<!--增加订阅次数-->
<update id="incrSubscribeCount">
update wxmp_resi_user_subscribe
set COUNT=COUNT + #{incr},
WX_SUBSCRIBE_STATUS = 'subscribe',
UPDATED_TIME = now()
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
and WX_OPEN_ID = #{resiOpenId}
and del_flag = 0
</update>
<!--取消订阅-->
<update id="unSubscribe">
update wxmp_resi_user_subscribe
set WX_SUBSCRIBE_STATUS = 'unsubscribe',
UPDATED_TIME = now()
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
and WX_OPEN_ID = #{resiOpenId}
and del_flag = 0
</update>
<select id="getWxResiSubscribe" resultType="com.epmet.entity.WxmpResiUserSubscribeEntity">
select id,
customer_id,
template_id,
user_id,
wx_open_id,
wx_subscribe_status,
count,
del_flag,
revision,
created_by,
created_time,
updated_by,
updated_time
from wxmp_resi_user_subscribe
where USER_ID = #{userId}
and CUSTOMER_ID = #{customerId}
and TEMPLATE_ID = #{templateId}
and WX_OPEN_ID = #{openId}
and del_flag = 0
</select>
</mapper>