package com.moon.server.mapper.sys; import com.moon.server.entity.sys.TokenEntity; import org.apache.ibatis.annotations.Mapper; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; /** * 令牌表 * @author sws * @date 2022-09-28 */ @Mapper @ResponseBody public interface TokenMapper { /** * 查询记录数 * * @param name * @param type * @return */ public Integer selectCount(String name, Integer type); /** * 分页查询 * * @param name * @param type * @param limit * @param offset * @return */ public List selectByPage(String name, Integer type, Integer limit, Integer offset); /** * 查询单条数据 * * @param id * @return */ public TokenEntity selectToken(int id); /** * 根据token值查询一条记录 * * @param token * @return */ public TokenEntity selectOneByToken(String token); /** * 查询所有 * * @return */ public List selectTokenAll(); /** * 插入一条 * * @param tokenEntity * @return */ public Integer insertToken(TokenEntity tokenEntity); /** * 插入多条 * * @param list * @return */ public Integer insertTokens(List list); /** * 删除一条 * * @param id * @return */ public Integer deleteToken(int id); /** * 删除多条 * * @param ids * @return */ public Integer deleteTokens(List ids); /** * 更新一条 * * @param tokenEntity * @return */ public Integer updateToken(TokenEntity tokenEntity); /** * 更新令牌为失效 * * @param tokenEntity * @return */ public Integer updateTokenExpire(TokenEntity tokenEntity); }