智慧保安后台管理项目备份
zhongrj
2024-05-24 b5960d1968e007b91d4d33dd7cbb74f1b566f2c1
src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
@@ -40,17 +40,33 @@
        d.dict_value AS categoryName
        FROM
        blade_notice n
        LEFT JOIN ( SELECT * FROM blade_dict WHERE code = 'notice' ) d ON n.category = d.dict_key
        LEFT JOIN
            ( SELECT * FROM blade_dict WHERE code = 'notice' ) d
        ON
            n.category = d.dict_key
        <if test="notice.deptId!=null and notice.jurisdiction!=null">
            left join
                blade_user bu
            on
                bu.dept_id = n.dept_id
        </if>
        WHERE
        n.is_deleted = 0 and n.tenant_id = #{notice.tenantId}
        n.is_deleted = 0
        <if test="notice.title!=null">
            and n.title like concat(concat('%', #{notice.title}), '%')
        </if>
        <if test="notice.category!=null">
            and n.category = #{notice.category}
        </if>
        <if test="notice.deptId!=null">
            and (n.dept_id = #{notice.deptId} or n.category = 2)
        <if test="notice.deptId!=null and notice.jurisdiction!=null">
            and (n.dept_id = #{notice.deptId} or bu.jurisdiction = #{notice.jurisdiction}
                or n.dept_id = 1123598813738675201
            )
        </if>
        <if test="notice.deptId!=null and notice.jurisdiction==null">
            and (n.dept_id = #{notice.deptId} and n.category=2
            or n.dept_id = 1123598813738675201
            )
        </if>
        <if test="notice.startTime!=null and notice.startTime!=''">
            and n.release_time &gt;= #{notice.startTime}