Optimize function name

This commit is contained in:
2023-11-29 11:34:21 +08:00
parent 7cf6b5cea2
commit 3d178aa8fe
6 changed files with 12 additions and 12 deletions

View File

@@ -15,7 +15,7 @@ import top.fatweb.api.entity.permission.Group
interface GroupMapper : BaseMapper<Group> { interface GroupMapper : BaseMapper<Group> {
fun selectPage(page: IPage<Long>, searchName: String?, searchRegex: Boolean): IPage<Long> fun selectPage(page: IPage<Long>, searchName: String?, searchRegex: Boolean): IPage<Long>
fun getWithRoleByList(groupIds: List<Long>): List<Group>? fun selectListWithRoleByIds(groupIds: List<Long>): List<Group>?
fun selectOne(id: Long): Group? fun selectOneById(id: Long): Group?
} }

View File

@@ -15,7 +15,7 @@ import top.fatweb.api.entity.permission.Role
interface RoleMapper : BaseMapper<Role> { interface RoleMapper : BaseMapper<Role> {
fun selectPage(page: IPage<Long>, searchName: String?, searchRegex: Boolean): IPage<Long> fun selectPage(page: IPage<Long>, searchName: String?, searchRegex: Boolean): IPage<Long>
fun getWithPowerByList(roleIds: List<Long>): List<Role>? fun selectListWithPowerByIds(roleIds: List<Long>): List<Role>?
fun selectOne(id: Long): Role? fun selectOneById(id: Long): Role?
} }

View File

@@ -36,14 +36,14 @@ class GroupServiceImpl(
baseMapper.selectPage(groupIdsPage, groupGetParam?.searchName, groupGetParam?.searchRegex ?: false) baseMapper.selectPage(groupIdsPage, groupGetParam?.searchName, groupGetParam?.searchRegex ?: false)
val groupPage = Page<Group>(groupIdsPage.current, groupIdsIPage.size, groupIdsIPage.total) val groupPage = Page<Group>(groupIdsPage.current, groupIdsIPage.size, groupIdsIPage.total)
if (groupIdsIPage.total > 0) { if (groupIdsIPage.total > 0) {
groupPage.setRecords(baseMapper.getWithRoleByList(groupIdsIPage.records)) groupPage.setRecords(baseMapper.selectListWithRoleByIds(groupIdsIPage.records))
} }
return GroupConverter.groupPageToGroupWithRolePageVo(groupPage) return GroupConverter.groupPageToGroupWithRolePageVo(groupPage)
} }
override fun getOne(id: Long): GroupWithRoleVo? { override fun getOne(id: Long): GroupWithRoleVo? {
return baseMapper.selectOne(id)?.let { GroupConverter.groupToGroupWithRoleVo(it) } ?: let { null } return baseMapper.selectOneById(id)?.let { GroupConverter.groupToGroupWithRoleVo(it) } ?: let { null }
} }
override fun listAll(): List<GroupVo> { override fun listAll(): List<GroupVo> {

View File

@@ -41,7 +41,7 @@ class RoleServiceImpl(
val rolePage = Page<Role>(roleIdsPage.current, roleIdsIPage.size, roleIdsIPage.total) val rolePage = Page<Role>(roleIdsPage.current, roleIdsIPage.size, roleIdsIPage.total)
if (roleIdsIPage.total > 0) { if (roleIdsIPage.total > 0) {
rolePage.setRecords(baseMapper.getWithPowerByList(roleIdsIPage.records)) rolePage.setRecords(baseMapper.selectListWithPowerByIds(roleIdsIPage.records))
} }
@@ -49,7 +49,7 @@ class RoleServiceImpl(
} }
override fun getOne(id: Long): RoleWithPowerVo? { override fun getOne(id: Long): RoleWithPowerVo? {
return baseMapper.selectOne(id)?.let { RoleConverter.roleToRoleWithPowerVo(it) } ?: let { null } return baseMapper.selectOneById(id)?.let { RoleConverter.roleToRoleWithPowerVo(it) } ?: let { null }
} }
override fun listAll(): List<RoleVo> { override fun listAll(): List<RoleVo> {

View File

@@ -19,7 +19,7 @@
</where> </where>
</select> </select>
<select id="getWithRoleByList" resultMap="groupWithRoleMap"> <select id="selectListWithRoleByIds" resultMap="groupWithRoleMap">
select t_group.id as group_id, select t_group.id as group_id,
t_group.name as group_name, t_group.name as group_name,
t_group.enable as group_enable, t_group.enable as group_enable,
@@ -45,7 +45,7 @@
</where> </where>
</select> </select>
<select id="selectOne" resultMap="groupWithRoleMap"> <select id="selectOneById" resultMap="groupWithRoleMap">
select t_group.id as group_id, select t_group.id as group_id,
t_group.name as group_name, t_group.name as group_name,
t_group.enable as group_enable, t_group.enable as group_enable,

View File

@@ -19,7 +19,7 @@
</where> </where>
</select> </select>
<select id="getWithPowerByList" resultMap="roleWithPowerMap"> <select id="selectListWithPowerByIds" resultMap="roleWithPowerMap">
select distinct t_role.id as role_id, select distinct t_role.id as role_id,
t_role.name as role_name, t_role.name as role_name,
t_role.enable as role_enable, t_role.enable as role_enable,
@@ -57,7 +57,7 @@
</where> </where>
</select> </select>
<select id="selectOne" resultMap="roleWithPowerMap"> <select id="selectOneById" resultMap="roleWithPowerMap">
select distinct t_role.id as role_id, select distinct t_role.id as role_id,
t_role.name as role_name, t_role.name as role_name,
t_role.enable as role_enable, t_role.enable as role_enable,