Complete core functions #9
@@ -38,7 +38,9 @@ class RoleServiceImpl(
|
||||
baseMapper.selectPage(roleIdsPage, roleGetParam?.searchName, roleGetParam?.searchRegex ?: false)
|
||||
|
||||
val rolePage = Page<Role>(roleIdsPage.current, roleIdsIPage.size, roleIdsIPage.total)
|
||||
rolePage.setRecords(baseMapper.getWithPowerByList(roleIdsIPage.records))
|
||||
if (roleIdsIPage.total > 0) {
|
||||
rolePage.setRecords(baseMapper.getWithPowerByList(roleIdsIPage.records))
|
||||
}
|
||||
|
||||
|
||||
return RoleConverter.rolePageToRoleWithPowerPageVo(rolePage)
|
||||
|
||||
@@ -6,14 +6,16 @@
|
||||
from t_role
|
||||
<where>
|
||||
deleted = 0
|
||||
<choose>
|
||||
<when test="searchRegex == true">
|
||||
and t_role.name regexp #{searchName}
|
||||
</when>
|
||||
<otherwise>
|
||||
and t_role.name like concat('%' ,#{searchName}, '%')
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="searchName != null">
|
||||
<choose>
|
||||
<when test="searchRegex == true">
|
||||
and t_role.name regexp #{searchName}
|
||||
</when>
|
||||
<otherwise>
|
||||
and t_role.name like concat('%' ,#{searchName}, '%')
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user