Browse Source

数据中心

hanfucheng 1 year ago
parent
commit
b9b989cf55
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/main/resources/mapper/commandcenter/CommandCentreMapper.xml

+ 4 - 3
src/main/resources/mapper/commandcenter/CommandCentreMapper.xml

@@ -172,9 +172,10 @@
         FROM centerdata_t_key_projects a
         FROM centerdata_t_key_projects a
         LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
         LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
         <where>
         <where>
-            <if test="deptId != null and deptId != ''">
-                AND FIND_IN_SET( #{deptId}, CONCAT(d.ancestors,',',d.dept_id) )
-            </if>
+            <choose>
+                <when test="deptId != null and deptId != ''">and FIND_IN_SET( #{deptId}, CONCAT(d.ancestors,',',d.dept_id) )</when>
+                <otherwise>${params.dataScope}</otherwise>
+            </choose>
             <if test="params.projectName != null and params.projectName != ''"><!--工程名称-->
             <if test="params.projectName != null and params.projectName != ''"><!--工程名称-->
                 AND project_name like concat('%', #{params.projectName}, '%')
                 AND project_name like concat('%', #{params.projectName}, '%')
             </if>
             </if>