package api.dao; import api.bean.AccessEntity; import org.apache.ibatis.annotations.*; import org.springframework.stereotype.Repository; /** * @program: wog * @description: * @author: YSS * @create: 2020-09-25 14:44 **/ @Mapper @Repository public interface AccessDao { @Select("select * from wog_user_access where access_key = #{accessKey} limit 1") AccessEntity selectAccessEntityByKey(@Param("accessKey") String accessKey); @Update("update wog_user_access set access_token = #{accessToken}, update_time = #{updateTime} where access_key = #{accessKey}") void update(AccessEntity accessEntity); @Select("select user_id from wog_user_access where access_token = #{token}") Long selectUserIdByToken(@Param("token")String accessToken); @Select("select role_id from sys_user_role where user_id = #{userId}") Long selectRoleIdByUserId(@Param("userId") Long userId); }