mitao
5 天以前 0b7e2752b6f1e87084b837043291c890cca780a8
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
45
46
47
48
49
50
51
52
53
54
55
56
<?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.ruoyi.system.mapper.OaNotificationMapper">
 
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.system.model.OaNotification">
        <id column="id" property="id" />
        <result column="title" property="title" />
        <result column="content" property="content" />
        <result column="type" property="type" />
        <result column="create_time" property="createTime" />
        <result column="create_by" property="createBy" />
        <result column="update_time" property="updateTime" />
        <result column="update_by" property="updateBy" />
        <result column="disabled" property="disabled" />
    </resultMap>
 
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, title, content, type, create_time, create_by, update_time, update_by, disabled
    </sql>
    <select id="pageList" resultType="com.ruoyi.system.vo.system.NotificationVO">
        select * from oa_notification
        where 1=1
        <if test="query.title != null and query.title != ''">
            and title like concat('%',#{query.title},'%')
        </if>
        <if test="deptIds != null and deptIds.size() > 0">
            AND (
            <foreach collection="deptIds" item="deptId" separator=" OR ">
                FIND_IN_SET(#{deptId}, dept_ids)
            </foreach>
            )
        </if>
        AND disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        order by  create_time desc
    </select>
    <select id="pageListUser" resultType="com.ruoyi.system.vo.system.NotificationVO">
        select t1.read_status as readStatus,t1.notification_id notificationId,t2.* from oa_notification t2
        where 1=1
        <if test="query.title != null and query.title != ''">
            and t2.title like concat('%',#{query.title},'%')
        </if>
        <if test="deptIds != null and deptIds.size() > 0">
            AND (
            <foreach collection="deptIds" item="deptId" separator=" OR ">
                FIND_IN_SET(#{deptId}, t2.dept_ids)
            </foreach>
            )
        </if>
          and t1.user_id = #{query.userId}
        AND t2.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        order by  t1.id desc
    </select>
 
</mapper>