|
@@ -28,25 +28,10 @@
|
|
|
|
|
|
|
|
<select id="getNoticeCount" resultType="java.util.Map">
|
|
<select id="getNoticeCount" resultType="java.util.Map">
|
|
|
SELECT
|
|
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(userId)
|
|
|
|
|
- from(SELECT
|
|
|
|
|
- ur.USER_ID AS userId,
|
|
|
|
|
- ur.MAIN_ID AS mainId
|
|
|
|
|
- FROM USER_READ ur
|
|
|
|
|
- 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>
|
|
|
|
|
- GROUP BY ur.USER_ID,ur.MAIN_ID)
|
|
|
|
|
- ) 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>
|
|
</select>
|
|
|
</mapper>
|
|
</mapper>
|