|
|
@@ -25,22 +25,10 @@
|
|
|
|
|
|
<select id="getNoticeCount" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
- collectCount.allCount -collectCount.alreadyCount AS unreadCount
|
|
|
- from(
|
|
|
- SELECT
|
|
|
- (SELECT count(noe.NOTICE_ID) FROM "notice" noe WHERE noe.DELETE_FLAG='NOT_DELETE') AS allCount,
|
|
|
- (SELECT count(ur.USER_ID)
|
|
|
- FROM USER_READ ur
|
|
|
- LEFT JOIN "notice" n ON n.NOTICE_ID = ur.MAIN_ID
|
|
|
- WHERE ur.DELETE_FLAG ='NOT_DELETE'
|
|
|
- <if test="userId !=null and userId != ''">
|
|
|
- AND ur.USER_ID=#{userId}
|
|
|
- </if>
|
|
|
- <if test="funcType !=null and funcType != ''">
|
|
|
- AND ur.FUNC_TYPE =#{funcType}
|
|
|
- </if>
|
|
|
- ) AS alreadyCount
|
|
|
- FROM DUAL
|
|
|
- )AS collectCount
|
|
|
+ count(DISTINCT b.ID) AS unreadCount
|
|
|
+ FROM
|
|
|
+ notice a
|
|
|
+ LEFT JOIN user_read b ON a.NOTICE_ID=b.MAIN_ID AND b.USER_ID =#{userId}
|
|
|
+ where a.NOTICE_STATUS=1 and a.DELETE_FLAG='NOT_DELETE'
|
|
|
</select>
|
|
|
</mapper>
|