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.
|
|
|
|
<?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="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 wx_subscribe_status = 'subscribe'
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="decreaseResiSubscribeCount">
|
|
|
|
|
update Wxmp_Resi_User_Subscribe
|
|
|
|
|
set count = if(count < 1, 0, count - ${num} )
|
|
|
|
|
where
|
|
|
|
|
del_flag =0
|
|
|
|
|
and customer_id = #{customerId}
|
|
|
|
|
and template_id = #{templateId}
|
|
|
|
|
and wx_open_id = #{openId}
|
|
|
|
|
and wx_subscribe_status = 'subscribe'
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="clearResiSubscribeCount" parameterType="String">
|
|
|
|
|
update Wxmp_Resi_User_Subscribe
|
|
|
|
|
set count = 0,
|
|
|
|
|
wx_subscribe_status = 'unsubscribe'
|
|
|
|
|
where
|
|
|
|
|
del_flag =0
|
|
|
|
|
and customer_id = #{customerId}
|
|
|
|
|
and template_id = #{templateId}
|
|
|
|
|
and wx_open_id = #{openId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
</mapper>
|