yangys
2024-11-02 f69073b835f1a0c66590130e1830edcdd75ebb8a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?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.qianwen.smartman.modules.notify.mapper.NotifySystemMapper">
 
    <select id="getUnreadList" resultType="com.qianwen.smartman.modules.notify.vo.NotifySystemVO" parameterType="long">
        SELECT ns.id,
               ns.notify_type,
               ns.notify_time,
               ns.business_name,
               bn.category
        FROM blade_notify_system ns
                 LEFT JOIN blade_notice bn ON ns.source_id = bn.id
            AND ns.notify_type = 2
        WHERE ns.status != 1
        and ns.notify_user = #{userId}
        GROUP BY
            ns.id,
            ns.notify_type,
            ns.notify_time,
            ns.business_name,
            bn.category
        ORDER BY
            notify_time DESC
    </select>
    <select id="pageNotifySystem" resultType="com.qianwen.smartman.modules.notify.vo.NotifySystemVO">
        SELECT ns.id,
        ns.notify_type,
        ns.notify_time,
        ns.business_name,
        ns.status,
        bn.category
        FROM blade_notify_system ns
        LEFT JOIN blade_notice bn ON ns.source_id = bn.id
        AND ns.notify_type = 2
        WHERE
        ns.notify_user = #{param.userId}
        AND ns.notify_type = 2
        <if test="param.category != null">
            and bn.category = #{param.category}
        </if>
        ORDER BY
        ns.notify_time DESC
    </select>
</mapper>