智慧保安后台管理-外网项目备份
zhongrj
2023-09-17 8853292babb2ad94de4a3207966f1e83b767cd2d
src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
@@ -37,17 +37,42 @@
    <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 ( SELECT * FROM blade_dict WHERE CODE = 'notice' ) d ON n.category = d.dict_key
        left join
        blade_dept bd
        on
        bd.id = n.dept_id
        LEFT JOIN
        ( SELECT * FROM blade_dict WHERE code = 'notice' ) d
        ON
        n.category = d.dict_key
        left join sys_information si on si.departmentid = bd.id
        left join sys_jurisdiction sj on sj.id = si.jurisdiction
        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.type!=null">
            and n.type = #{notice.type}
        </if>
        <if test="notice.deptId!=null and notice.deptId!=''">
            and n.dept_id = #{notice.deptId}
        </if>
        <if test="notice.jurisdiction!=null and notice.jurisdiction!='' and notice.jurisdiction!='1372091709474910209'">
            and (sj.id=#{notice.jurisdiction} or sj.parent_id = #{notice.jurisdiction})
        </if>
        <if test="notice.startTime!=null and notice.startTime!=''">
            and n.release_time &gt;= #{notice.startTime}
        </if>
        <if test="notice.endTime!=null and notice.endTime!=''">
            and n.release_time &lt;= #{notice.endTime}
        </if>
    </select>
</mapper>