@Mapper
public interface AdminManuallyMapper
| 限定符和类型 | 方法和说明 |
|---|---|
int |
countUnreadMessage(Long userId)
查询未读消息数量
|
List<AdminListVo> |
listAdminInfos(String keywords,
org.apache.ibatis.session.RowBounds rowBounds)
获取管理员列表
|
Admin |
selectAdminInfoById(Long adminId)
获取管理员的详细信息
|
List<Map<String,Object>> |
selectAllPermissionsByAdminId(Long adminId)
获取本账户下的所有权限列表
|
List<Map<String,Object>> |
selectAllRolesByAdminId(Long adminId)
获取本角色下的所有角色列表
|
int |
updateLastLoginDate(long userId,
String ip)
更新最后登录时间
|
@Select(value="<script>select id, no, username, nick_name nickNameAccess, title, department, gender, type, avatar_url avatarUrl, mobile, email, enabled, created_by createdBy, created_by_name createdByName, created_time createdTime, last_login_date lastLoginDate from tb_admin where 1=1 <if test=\'keywords!=null\'> and username like #{keywords}</if> </script>")
@Result(property="id",column="id") @Result(property="roles",javaType=java.util.List.class,column="id",many=@Many(select="selectAllRolesByAdminId")) @Result(property="permissions",javaType=java.util.List.class,column="id",many=@Many(select="selectAllPermissionsByAdminId"))
List<AdminListVo> listAdminInfos(String keywords,
org.apache.ibatis.session.RowBounds rowBounds)
@Select(value=" select id, no, username, nick_name nickName, title, department, gender, type, avatar_url avatarUrl, mobile, email, enabled, created_by createdBy, created_by_name createdByName, created_time createdTime from tb_admin where id=#{adminId}")
@Result(property="id",column="id") @Result(property="roles",javaType=java.util.List.class,column="id",many=@Many(select="selectAllRolesByAdminId")) @Result(property="permissions",javaType=java.util.List.class,column="id",many=@Many(select="selectAllPermissionsByAdminId"))
Admin selectAdminInfoById(@Param(value="adminId")
Long adminId)
adminId - 管理员Id@Select(value="select b.id,b.name,b.label from tb_role b left join ref_admin_role a on a.role_id=b.id and b.enabled = 1 where a.admin_id =#{adminId}")
List<Map<String,Object>> selectAllRolesByAdminId(@Param(value="adminId")
Long adminId)
adminId - 管理员Id@Select(value="select c.id,c.name,c.label from tb_permission c left join ref_role_permission b on b.permission_id=c.id left join ref_admin_role a on a.role_id=b.role_id and c.enabled = true where a.admin_id =#{adminId}")
@Result(column="id",property="id") @Result(property="children",javaType=java.util.List.class,column="id",many=@Many(select="cn.watsontech.core.service.mapper.manually.PermissionManuallyMapper.selectAllChildPermissions"))
List<Map<String,Object>> selectAllPermissionsByAdminId(@Param(value="adminId")
Long adminId)
adminId - 管理员Id@Update(value="update tb_admin set last_login_date=login_date, last_login_ip=login_ip, login_ip=#{ip}, login_date=now() where id = #{userId}")
int updateLastLoginDate(@Param(value="userId")
long userId,
@Param(value="ip")
String ip)
@Select(value="select count(*) from tb_admin_message where user_id = #{userId} and state = \'unread\'")
int countUnreadMessage(@Param(value="userId")
Long userId)
userId - 用户idCopyright © 2020. All rights reserved.