diff --git a/src/main/java/neatlogic/framework/dao/mapper/RoleMapper.java b/src/main/java/neatlogic/framework/dao/mapper/RoleMapper.java index 42fb263ecfa346e83af9c96818b984364d4667ab..2f624da7100d912baff6903b310865e18365b12e 100644 --- a/src/main/java/neatlogic/framework/dao/mapper/RoleMapper.java +++ b/src/main/java/neatlogic/framework/dao/mapper/RoleMapper.java @@ -27,6 +27,8 @@ public interface RoleMapper { int checkRoleIsExists(String uuid); + int checkRoleNameIsIsRepeat(RoleVo roleVo); + List searchRole(RoleVo roleVo); List getRoleListByAuthName(String auth); @@ -49,6 +51,8 @@ public interface RoleMapper { RoleVo getRoleByUuid(String uuid); + RoleVo getRoleByName(String name); + RoleVo getRoleSimpleInfoByUuid(String uuid); List getRoleByUuidList(List uuidList); @@ -109,11 +113,13 @@ public interface RoleMapper { int updateTeamRole(RoleTeamVo roleTeamVo); + int updateRoleIsDeletedByUuid(String uuid); + int deleteRoleAuthByRoleUuid(String roleUuid); int deleteRoleAuth(RoleAuthVo roleAuthVo); - int deleteRoleByUuid(String uuid); +// int deleteRoleByUuid(String uuid); int deleteMenuRoleByRoleUuid(String roleUuid); diff --git a/src/main/java/neatlogic/framework/dao/mapper/RoleMapper.xml b/src/main/java/neatlogic/framework/dao/mapper/RoleMapper.xml index 697c25ec685fee1d098a28f961d8f370e16df3f5..0c4f0af144d88fb953f21b62ed438ceead7f3868 100644 --- a/src/main/java/neatlogic/framework/dao/mapper/RoleMapper.xml +++ b/src/main/java/neatlogic/framework/dao/mapper/RoleMapper.xml @@ -28,9 +28,17 @@ limitations under the License. + + @@ -49,6 +57,7 @@ limitations under the License. FROM `role` a LEFT JOIN `role_authority` c ON a.`uuid` = c.`role_uuid` + `is_delete` = 0 AND (name LIKE CONCAT('%',#{keyword}, '%') OR description LIKE CONCAT('%',#{keyword}, '%')) @@ -78,8 +87,7 @@ limitations under the License. CONCAT("role#",a.`uuid`) AS `value`, a.`name` as `text` FROM `role` a - WHERE - 1=1 + WHERE `is_delete` = 0 AND (a.`name` LIKE CONCAT('%',#{keyword}, '%') OR a.`description` LIKE CONCAT('%',#{keyword}, '%')) @@ -102,8 +110,7 @@ limitations under the License. COUNT(DISTINCT (a.`uuid`)) FROM `role` a LEFT JOIN `role_authority` b ON a.`uuid` = b.`role_uuid` - WHERE - 1=1 + WHERE `is_delete` = 0 AND (a.`name` LIKE CONCAT('%', #{keyword}, '%') OR a.`description` LIKE CONCAT('%', #{keyword}, '%')) @@ -132,11 +139,26 @@ limitations under the License. WHERE `uuid` = #{value} + + @@ -150,7 +172,7 @@ limitations under the License. `description`, `rule` FROM `role` - WHERE `uuid` in + WHERE `is_delete` = 0 AND `uuid` IN #{item} @@ -165,7 +187,7 @@ limitations under the License. `description`, `rule` FROM `role` - WHERE `id` in + WHERE `is_delete` = 0 AND `id` in #{id} @@ -177,7 +199,7 @@ limitations under the License. `uuid`, `rule` FROM `role` - WHERE `uuid` in + WHERE `is_delete` = 0 AND `uuid` in #{item} @@ -193,13 +215,13 @@ limitations under the License. - INSERT INTO `role` (`id`, `uuid`, `name`, `description`, `rule`) - VALUES (#{id}, #{uuid}, #{name}, #{description}, #{rule}) + INSERT INTO `role` (`id`, `uuid`, `name`, `description`, `rule`, `is_delete`) + VALUES (#{id}, #{uuid}, #{name}, #{description}, #{rule}, 0) @@ -411,7 +433,8 @@ limitations under the License. UPDATE `role` SET `name` = #{name}, `description` = #{description}, - `rule` = #{rule} + `rule` = #{rule}, + `is_delete` = #{isDelete} WHERE `uuid` = #{uuid} @@ -422,11 +445,17 @@ limitations under the License. AND `team_uuid` = #{teamUuid} - + + UPDATE `role` + SET `is_delete` = 1 + WHERE `uuid` = #{value} + + + DELETE diff --git a/src/main/java/neatlogic/framework/dao/mapper/TeamMapper.java b/src/main/java/neatlogic/framework/dao/mapper/TeamMapper.java index 6de28a5126b7eba8a7c03eb658f8682abb9016f3..cc760fe77b41f1b52e8cfd2187b17da1601be515 100644 --- a/src/main/java/neatlogic/framework/dao/mapper/TeamMapper.java +++ b/src/main/java/neatlogic/framework/dao/mapper/TeamMapper.java @@ -15,6 +15,8 @@ public interface TeamMapper { int checkTeamIsExists(String uuid); + int checkTeamNameIsIsRepeat(TeamVo teamVo); + List getTeamUuidListByUuidList(List uuidList); TeamVo getTeamByUuid(String uuid); @@ -35,6 +37,8 @@ public interface TeamMapper { List getTeamByUuidList(List teamUuidList); + List getTeamListContainsDeletedByUuidList(List teamUuidList); + List getTeamByIdList(List idList); List getTeamUuidListByUserUuid(String userUuid); @@ -55,6 +59,8 @@ public interface TeamMapper { List getTeamUuidByName(String name); + TeamVo getTeamByNameAndParentUuid(TeamVo teamVo); + List getRepeatTeamNameByNameList(List list); List getChildrenUuidListByLeftRightCode(@Param("lft") Integer lft, @Param("rht") Integer rht); @@ -85,13 +91,15 @@ public interface TeamMapper { int updateUpwardNamePathByLftRht(@Param("lft") Integer lft, @Param("rht") Integer rht); + int updateTeamIsDeletedByUuidList(List uuidList); + int deleteTeamUserByTeamUuid(String teamUuid); int deleteTeamUserByTeamUuidList(List teamUuidList); int deleteTeamUserByTeamUuidAndUserUuidList(@Param("teamUuid") String teamUuid, @Param("userUuidList") List userUuidList); - int deleteTeamByUuidList(List uuidList); +// int deleteTeamByUuidList(List uuidList); int deleteTeamRoleByTeamUuidList(List teamUuidList); diff --git a/src/main/java/neatlogic/framework/dao/mapper/TeamMapper.xml b/src/main/java/neatlogic/framework/dao/mapper/TeamMapper.xml index 9151b91f2b3b3893398caabb0c861b9cade0de6b..10e72a7b7d79b055105bc3afe58db0b9ac58af64 100644 --- a/src/main/java/neatlogic/framework/dao/mapper/TeamMapper.xml +++ b/src/main/java/neatlogic/framework/dao/mapper/TeamMapper.xml @@ -178,7 +178,8 @@ limitations under the License. SELECT a.`id`, a.`uuid`, - a.`name` + a.`name`, + a.`is_delete` AS isDelete FROM `team` a @@ -205,11 +206,20 @@ limitations under the License. + + + + + +