package com.terra.system.mapper.sys; import com.terra.system.entity.sys.RoleEntity; import com.terra.system.entity.sys.UserEntity; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; import java.util.List; /** * 用户管理 * @author sws * @date 2022-09-27 */ @Mapper @Repository public interface UserMapper { /** * 查询记录数 * * @param uname 用户名 * @param depcode 单位编码 * @return 记录数 */ public Integer selectCount(String uname, String depcode); /** * 分页查询 * * @param uname 用戶名 * @param depcode 单位编码 * @param limit 记录数 * @param offset 偏移量 * @return 列表 */ public List selectByPage(String uname, String depcode, Integer limit, Integer offset); /** * 根据token有效期查询 * * @param token * @return */ public UserEntity selectByToken(String token); /** * 查询是/否为Admin * * @param id ID * @return 统计数 */ public Integer selectForIsAdmin(Integer id); /** * 查询管理员用户 * * @param type 管理员类别 * @return */ public List selectAdminUsers(Integer type); /** * 根据用户ID查询角色 * * @param id 用户ID * @return 角色集合 */ public List selectRoleByUserId(Integer id); /** * 根据角色查询用户 * * @param roleId 角色ID * @return 用户集合 */ public List selectUserByRoleId(Integer roleId); /** * 插入一条 * * @param userEntity * @return */ public Integer insertUser(UserEntity userEntity); /** * 插入多条 * * @param userEntity * @return */ public Integer insertUsers(List userEntity); /** * 删除一条 * * @param id * @return */ public Integer deleteUser(int id); /** * 删除多条 * * @param ids * @return */ public Integer deleteUsers(List ids); /** * 更新一条 * * @param userEntity * @return */ public Integer updateUser(UserEntity userEntity); /** * 查询单条数据 * * @param id * @return */ public UserEntity selectUser(int id); /** * 根据uid查询 * * @param uid * @return */ public UserEntity selectByUid(String uid); /** * 查询所有 * * @return */ public List selectUserAll(); /** * 根据角色+单位查询记录数 * * @param uname * @param roleid * @param depcode * @return */ public Integer selectCountForRole(String uname, Integer roleid, String depcode); /** * 根据角色+单位分页查询 * * @param uname * @param roleid * @param depcode * @param limit * @param offset * @return */ public List selectByPageForRole(String uname, Integer roleid, String depcode, Integer limit, Integer offset); /** * 更新多个用户密码 * * @param updateUser * @param pwd * @param ids * @return */ public Integer updateUsersPwd(Integer updateUser, String pwd, List ids); }