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.
37 lines
1.2 KiB
37 lines
1.2 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.WxmpWorkUserSubscribeDao">
|
|
|
|
<select id="getWorkSubscribeInfo" parameterType="String" resultType="Integer">
|
|
select
|
|
`count`
|
|
from Wxmp_Work_User_Subscribe
|
|
where
|
|
del_flag =0
|
|
and template_id = #{templateId}
|
|
and wx_open_id = #{openId}
|
|
and wx_subscribe_status = 'subscribe'
|
|
</select>
|
|
|
|
<update id="decreaseWorkSubscribeCount">
|
|
update Wxmp_Work_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="clearWorkSubscribeCount" parameterType="String">
|
|
update Wxmp_Work_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>
|
|
|