package com.sky.ioc.mapper.job;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Map;

@Mapper
public interface TokenMapper {

    @Select("select * from  third_token ORDER BY update_time desc limit 1 ")
    Map<String,String> getNewToken();

    @Update("update third_token set token = #{token},update_time = now() where id= #{id}")
    Integer updateToken(@Param("id") Integer id,@Param("token") String token);

    @Update("insert into  third_token(id,username,password) values (#{id},#{username},#{password})")
    Integer addToken(@Param("id") Integer id,@Param("username") String username,
                     @Param("password") String password);



}
