移风店镇项目初始化
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.
 
 
 
 
 

67 lines
2.1 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.ResiEventReportOrgDao">
<update id="updateReadFlag" parameterType="map">
UPDATE resi_event_report_org
SET ORG_READ = 'read',
UPDATED_BY = #{userId},
UPDATED_TIME = NOW()
WHERE
RESI_EVENT_ID = #{eventId}
AND ORG_ID = #{orgId}
AND DEL_FLAG = '0'
</update>
<update id="updateRedDotShow" parameterType="java.lang.String">
UPDATE resi_event_report_org
SET RED_DOT = '1',
UPDATED_TIME = NOW()
WHERE
RESI_EVENT_ID = #{resiEventId}
AND DEL_FLAG = '0'
</update>
<!-- 更新组织的红点显示状态 -->
<update id="updateEventOrg">
UPDATE resi_event_report_org
SET RED_DOT = 0,
UPDATED_TIME = NOW()
WHERE DEL_FLAG = '0'
AND ORG_ID = #{orgId}
AND RESI_EVENT_ID = #{eventId}
</update>
<select id="selectUnReadCount" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT
COUNT(M.ID)
FROM resi_event_report_org M
INNER JOIN resi_event RE ON(M.RESI_EVENT_ID=RE.ID)
WHERE M.DEL_FLAG='0'
AND RE.DEL_FLAG='0'
AND M.ORG_ID=#{agencyId}
AND M.ORG_READ='un_read'
</select>
<select id="selectRedCount" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT
COUNT(M.ID)
FROM resi_event_report_org M
INNER JOIN resi_event RE ON(M.RESI_EVENT_ID=RE.ID)
WHERE M.DEL_FLAG='0'
AND RE.DEL_FLAG='0'
AND M.ORG_ID=#{agencyId}
AND M.ORG_READ='read'
and m.RED_DOT='1'
</select>
<select id="getByEventId" resultType="com.epmet.entity.ResiEventReportOrgEntity">
SELECT
*
FROM resi_event_report_org
WHERE del_flag='0'
AND resi_event_id = #{resiEventId}
LIMIT 1
</select>
</mapper>