From 30df94c05573a426d030510d4dd58ae1d93bfb7a Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Mon, 06 Dec 2021 14:03:37 +0800
Subject: [PATCH] 1.资格审查排序

---
 src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml b/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
index 8070788..83516a1 100644
--- a/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
+++ b/src/main/java/org/springblade/modules/desk/mapper/NoticeMapper.xml
@@ -37,20 +37,31 @@
     <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
         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.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.startTime!=null and notice.startTime!=''">
             and n.release_time &gt;= #{notice.startTime}

--
Gitblit v1.9.3