update
This commit is contained in:
@@ -100,7 +100,7 @@
|
||||
<select id="queryBestNewActivityPage" parameterType="java.util.Map"
|
||||
resultType="cn.pluss.platform.entity.BestNewActivity">
|
||||
SELECT bna.*, IF(nrr.id IS NULL, 0, 1) readStatus from tb_pluss_best_new_activity bna
|
||||
LEFT JOIN tb_pluss_notice_read_record nrr ON nrr.noticeId = bna.id
|
||||
LEFT JOIN tb_pluss_notice_read_record nrr ON nrr.noticeId = bna.id AND nrr.type=3
|
||||
<if test="userId != null">
|
||||
AND nrr.userId = #{userId}
|
||||
</if>
|
||||
|
||||
@@ -191,8 +191,8 @@
|
||||
IF ( nrr.id IS NULL, 0, 1 ) readStatus
|
||||
FROM
|
||||
tb_pluss_notice n
|
||||
LEFT JOIN tb_pluss_notice_read_record nrr ON n.id = nrr.noticeId
|
||||
AND nrr.userId = n.userId
|
||||
LEFT JOIN tb_pluss_notice_read_record nrr ON n.id = nrr.noticeId AND nrr.type='2'
|
||||
AND nrr.userId = #{userId}
|
||||
<where>
|
||||
<if test="id!= null">
|
||||
and n.id = #{id}
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
<insert id="updateNoticeRead">
|
||||
INSERT INTO tb_pluss_notice_read_record(`userId`, `type`, `noticeId`)
|
||||
SELECT #{userId} `userId`, 2 `type`, n.id noticeId FROM tb_pluss_notice n
|
||||
LEFT JOIN tb_pluss_notice_read_record nrr ON n.id = nrr.noticeId AND nrr.type = '2' AND (nrr.userId = n.userId OR n.userId = -1)
|
||||
WHERE nrr.id IS NULL AND n.typeFirst = #{type} AND n.userId IN ("-1", #{userId})
|
||||
SELECT #{userId},2 type, id FROM tb_pluss_notice
|
||||
WHERE id NOT IN(SELECT noticeId FROM tb_pluss_notice_read_record WHERE type='2' AND userId=#{userId})
|
||||
AND userId IN(-1,#{userId})
|
||||
</insert>
|
||||
|
||||
<insert id="updateEventInfoRead">
|
||||
@@ -43,10 +43,9 @@
|
||||
</select>
|
||||
|
||||
<select id="selectNoticeCount" resultType="java.util.Map">
|
||||
SELECT count(1) `count`, typeFirst `type` FROM tb_pluss_notice n
|
||||
LEFT JOIN tb_pluss_notice_read_record nrr ON n.id = nrr.noticeId AND nrr.type = '2' AND (nrr.userId = n.userId OR n.userId = -1)
|
||||
WHERE nrr.id IS NULL AND (n.userId = #{userId} OR n.userId = '-1')
|
||||
GROUP BY n.typeFirst
|
||||
SELECT COUNT(*) `count`,typeFirst `type` FROM tb_pluss_notice
|
||||
WHERE id NOT IN(select noticeId from tb_pluss_notice_read_record WHERE type='2' and userId=#{userId})
|
||||
AND userId IN(-1,#{userId}) GROUP BY typeFirst
|
||||
</select>
|
||||
|
||||
<select id="selectArticleCount" resultType="java.util.Map">
|
||||
|
||||
Reference in New Issue
Block a user