智慧保安后台管理-验收版本
tangzy
2021-12-06 30df94c05573a426d030510d4dd58ae1d93bfb7a
src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
@@ -37,19 +37,18 @@
    <select id="selectNoticePage" resultMap="noticeVOResultMap">
        SELECT
        n.*,
        d.dict_value AS categoryName
        d.dict_value AS categoryName,
        bd.dept_name deptName
        FROM
        blade_notice n
        left join
        blade_dept bd
        on
        bd.id = n.dept_id
        LEFT JOIN
            ( SELECT * FROM blade_dict WHERE code = 'notice' ) d
        ( 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>
        n.category = d.dict_key
        WHERE
        n.is_deleted = 0
        <if test="notice.title!=null">
@@ -58,15 +57,11 @@
        <if test="notice.category!=null">
            and n.category = #{notice.category}
        </if>
        <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 test="notice.type!=null">
            and n.type = #{notice.type}
        </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 test="notice.deptId!=null and notice.deptId!=''">
            and n.dept_id = #{notice.deptId}
        </if>
        <if test="notice.startTime!=null and notice.startTime!=''">
            and n.release_time &gt;= #{notice.startTime}