日照智慧社区接口服务
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.
 
 
 
 
 

83 lines
2.6 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">
<update id="incrSubscribeCount">
update wxmp_work_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 = #{openId}
and del_flag =0
</update>
<select id="getWorkSubscribeInfo" parameterType="String" resultType="Integer">
select
`count`
from Wxmp_Work_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="decreaseWorkSubscribeCount">
update Wxmp_Work_User_Subscribe
set count = if(count &lt; 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="clearWorkSubscribeCount" parameterType="String">
update Wxmp_Work_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="unSubscribe">
update wxmp_work_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 = #{workOpenId}
and del_flag =0
</update>
<select id="getWxWorkSubscribe" resultType="com.epmet.entity.WxmpWorkUserSubscribeEntity">
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_work_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>