mitao
2 天以前 1e657b5d336e41299a1ec40e89eb0f2a07c0b738
ruoyi-system/src/main/resources/mapper/system/OaNotificationMapper.xml
@@ -19,5 +19,39 @@
    <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="query.deptIds != null and query.deptIds.size() > 0">
            AND (
            <foreach collection="query.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.id as id,t1.read_status as readStatus,t1.notification_id notificationId,t2.*,t2.id as notificationId from oa_notification_user t1
                                                                                   left join oa_notification t2 on t1.notification_id = t2.id
        where 1=1
        <if test="query.title != null and query.title != ''">
            and t2.title like concat('%',#{query.title},'%')
        </if>
        <if test="query.deptIds != null and query.deptIds.size() > 0">
            AND (
            <foreach collection="query.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>