Commit 66ab43804abe8c036fd01a5bdcfb1c1825c3f47c

Authored by 戈灵虎
2 parents 4e474e36 fb5fc720

Merge branch 'master' into dev_fangshan

urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/tree/TreeMapper.java
... ... @@ -3,6 +3,7 @@ package com.zteits.urbanops.module.garden.dal.mysql.tree;
3 3 import java.util.*;
4 4  
5 5 import com.zteits.urbanops.framework.common.pojo.PageResult;
  6 +import com.zteits.urbanops.framework.datapermission.core.annotation.DataPermission;
6 7 import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX;
7 8 import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX;
8 9 import com.zteits.urbanops.framework.mybatis.core.query.MPJLambdaWrapperX;
... ... @@ -73,6 +74,7 @@ public interface TreeMapper extends BaseMapperX<TreeDO> {
73 74 );
74 75 }
75 76  
  77 + @DataPermission(enable = true)
76 78 List<CompanyDeptRoadVO> selectCompanyDeptRoadTreeData(TreeVO tree);
77 79  
78 80 // default List<CompanyDeptRoadVO> selectCompanyDeptRoadTreeData(TreeVO tree) {
... ...
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/framework/datapermission/config/TreeDataPermissionConfiguration.java
... ... @@ -17,6 +17,7 @@ public class TreeDataPermissionConfiguration {
17 17 return rule -> {
18 18 // 为garden_tree表配置基于部门的数据权限
19 19 rule.addDeptColumn("garden_tree", "dept_id");
  20 + rule.addDeptColumn("garden_road", "dept_id");
20 21 rule.addDeptColumn("garden_oldtrees", "dept_id");
21 22 rule.addDeptColumn("garden_emergency_task", "dept_id");
22 23 };
... ...
urbanops-module-garden/src/main/resources/mapper/tree/TreeMapper.xml
... ... @@ -36,10 +36,11 @@
36 36 r.end_remark AS endRemark,
37 37 COALESCE(r.tree_area, 0) AS treeCount,
38 38 COUNT(t.id) AS recordedCount
39   - FROM garden_tree t
40   - LEFT JOIN garden_road r ON t.road = r.id
  39 + FROM garden_road r
  40 + LEFT JOIN garden_tree t ON t.road = r.id
41 41 LEFT JOIN system_dept d ON r.dept_id = d.id AND d.status = 0
42 42 WHERE r.company_id = #{belongCompanyId}
  43 + and d.id is not null
43 44 <if test="roadName != null and roadName != ''">
44 45 AND r.road_name LIKE CONCAT('%', #{roadName}, '%')
45 46 </if>
... ...