1.5 KiB

getuserTeams

  • 根据团队id,和用户id获取该用户的角色数组 SELECT ut.roles FROM user_teams ut LEFT JOIN users u ON ut.user_id = u.id WHERE u.id = #users.id# AND ut.team_id = #teamId#

getRoles

  • 获取用户对应的角色列表 SELECT * FROM roles WHERE id IN (#join(ids)#)

queryByCondition

  • 根据不为空的参数进行分页查询

    select @pageTag(){ t.* @} from roles t where 1=1
    @//数据权限该sql语句功能点,如果不考虑数据权限,可以删除此行
    and #function("roles.query")# @if(!isEmpty(id)){ and t.id =#id# @} @if(!isEmpty(name)){ and t.name =#name# @} @if(!isEmpty(description)){ and t.description =#description# @}

deleteRolesByIds

  • 批量删除

    delete from roles where find_in_set(id,#ids#)

getRolesValues

  • 根据不为空的参数进行查询

    select t.* from roles t where 1=1
    @if(!isEmpty(id)){ and t.id =#id# @} @if(!isEmpty(name)){ and t.name =#name# @} @if(!isEmpty(description)){ and t.description =#description# @}

getValuesByQuery

  • 根据不为空的参数进行查询

    select t.* from roles t where 1=1
    @if(!isEmpty(id)){ and t.id =#id# @} @if(!isEmpty(name)){ and t.name =#name# @} @if(!isEmpty(description)){ and t.description =#description# @}