Commit fb5fc72063662d361414a0b148ec05b1e6952e43
1 parent
0bb87db5
feat(garden): 为道路数据添加部门权限控制
Showing
3 changed files
with
4 additions
and
0 deletions
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,6 +3,7 @@ package com.zteits.urbanops.module.garden.dal.mysql.tree; | ||
| 3 | import java.util.*; | 3 | import java.util.*; |
| 4 | 4 | ||
| 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; | 5 | import com.zteits.urbanops.framework.common.pojo.PageResult; |
| 6 | +import com.zteits.urbanops.framework.datapermission.core.annotation.DataPermission; | ||
| 6 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; | 7 | import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; | 8 | import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | import com.zteits.urbanops.framework.mybatis.core.query.MPJLambdaWrapperX; | 9 | import com.zteits.urbanops.framework.mybatis.core.query.MPJLambdaWrapperX; |
| @@ -73,6 +74,7 @@ public interface TreeMapper extends BaseMapperX<TreeDO> { | @@ -73,6 +74,7 @@ public interface TreeMapper extends BaseMapperX<TreeDO> { | ||
| 73 | ); | 74 | ); |
| 74 | } | 75 | } |
| 75 | 76 | ||
| 77 | + @DataPermission(enable = true) | ||
| 76 | List<CompanyDeptRoadVO> selectCompanyDeptRoadTreeData(TreeVO tree); | 78 | List<CompanyDeptRoadVO> selectCompanyDeptRoadTreeData(TreeVO tree); |
| 77 | 79 | ||
| 78 | // default List<CompanyDeptRoadVO> selectCompanyDeptRoadTreeData(TreeVO tree) { | 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,6 +17,7 @@ public class TreeDataPermissionConfiguration { | ||
| 17 | return rule -> { | 17 | return rule -> { |
| 18 | // 为garden_tree表配置基于部门的数据权限 | 18 | // 为garden_tree表配置基于部门的数据权限 |
| 19 | rule.addDeptColumn("garden_tree", "dept_id"); | 19 | rule.addDeptColumn("garden_tree", "dept_id"); |
| 20 | + rule.addDeptColumn("garden_road", "dept_id"); | ||
| 20 | rule.addDeptColumn("garden_oldtrees", "dept_id"); | 21 | rule.addDeptColumn("garden_oldtrees", "dept_id"); |
| 21 | rule.addDeptColumn("garden_emergency_task", "dept_id"); | 22 | rule.addDeptColumn("garden_emergency_task", "dept_id"); |
| 22 | }; | 23 | }; |
urbanops-module-garden/src/main/resources/mapper/tree/TreeMapper.xml
| @@ -40,6 +40,7 @@ | @@ -40,6 +40,7 @@ | ||
| 40 | LEFT JOIN garden_tree t ON t.road = r.id | 40 | LEFT JOIN garden_tree t ON t.road = r.id |
| 41 | LEFT JOIN system_dept d ON r.dept_id = d.id AND d.status = 0 | 41 | LEFT JOIN system_dept d ON r.dept_id = d.id AND d.status = 0 |
| 42 | WHERE r.company_id = #{belongCompanyId} | 42 | WHERE r.company_id = #{belongCompanyId} |
| 43 | + and d.id is not null | ||
| 43 | <if test="roadName != null and roadName != ''"> | 44 | <if test="roadName != null and roadName != ''"> |
| 44 | AND r.road_name LIKE CONCAT('%', #{roadName}, '%') | 45 | AND r.road_name LIKE CONCAT('%', #{roadName}, '%') |
| 45 | </if> | 46 | </if> |