Browse Source

重点区域添加数据权限

lyq 1 năm trước cách đây
mục cha
commit
9201b6d3c1

+ 2 - 0
src/main/java/com/sooka/sponest/data/commandcenter/service/impl/ICommandCenterServiceImpl.java

@@ -189,6 +189,7 @@ public class ICommandCenterServiceImpl extends BaseServiceImpl implements IComma
      * @param commandCenterBO
      * @return
      */
+    @DataScopeMutiDept(deptAlias = "d")
     @Override
     public List<AreaBody> getImportAreaList(CommandCenterBO commandCenterBO) {
         setSookaDataBase(commandCenterBO);
@@ -222,6 +223,7 @@ public class ICommandCenterServiceImpl extends BaseServiceImpl implements IComma
      * @param commandCenterBO
      * @return
      */
+    @DataScopeMutiDept(deptAlias = "d")
     @Override
     public List<Map<String, Object>> getImportAreaListPage(CommandCenterBO commandCenterBO) {
         setSookaDataBase(commandCenterBO);

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

@@ -210,9 +210,10 @@
         FROM centerdata_t_forest_importarea a
         LEFT JOIN ${database_system}.sys_dept d on d.dept_id = a.dept_id
         <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.areaName != null and params.areaName != ''">
                 AND a.area_name like concat('%', #{params.areaName}, '%')
             </if>