Temp
This commit is contained in:
@@ -15,7 +15,7 @@ import top.fatweb.api.entity.permission.Role
|
|||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface RoleMapper : BaseMapper<Role> {
|
interface RoleMapper : BaseMapper<Role> {
|
||||||
fun selectPage(page: IPage<Long>): IPage<Long>
|
fun selectPage(page: IPage<Long>, searchName: String?, searchRegex: Boolean): IPage<Long>
|
||||||
|
|
||||||
fun getWithPowerByList(roleIds: List<Long>): List<Role>?
|
fun getWithPowerByList(roleIds: List<Long>): List<Role>?
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ class RoleServiceImpl(
|
|||||||
|
|
||||||
PageUtil.setPageSort(roleGetParam, roleIdsPage)
|
PageUtil.setPageSort(roleGetParam, roleIdsPage)
|
||||||
|
|
||||||
val roleIdsIPage = baseMapper.selectPage(roleIdsPage)
|
val roleIdsIPage =
|
||||||
|
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))
|
rolePage.setRecords(baseMapper.getWithPowerByList(roleIdsIPage.records))
|
||||||
|
|||||||
@@ -4,7 +4,17 @@
|
|||||||
<select id="selectPage" resultType="long">
|
<select id="selectPage" resultType="long">
|
||||||
select id
|
select id
|
||||||
from t_role
|
from t_role
|
||||||
where deleted = 0
|
<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>
|
||||||
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getWithPowerByList" resultMap="roleWithPowerMap">
|
<select id="getWithPowerByList" resultMap="roleWithPowerMap">
|
||||||
|
|||||||
Reference in New Issue
Block a user