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