13693261870
19 小时以前 4c6dcf757cc7962a8dbaefd83588cc576ee44594
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.terra.common.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.terra.common.entity.lf.OperatePo;
import com.terra.common.entity.lf.TokenPo;
import com.terra.common.entity.lf.UserPo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
 
import java.util.Map;
 
@Mapper
@Repository
public interface OperatePoMapper extends BaseMapper<OperatePo> {
    @Insert("INSERT INTO lf.sys_operate(url, ip, exec, clazz, type, userid, bak, modular1, modular2) VALUES (#{url}, #{ip}, #{exec}, #{clazz}, #{type}, #{userid}, #{bak}, #{modular1}, #{modular2})")
    int insertOperate(Map<String, Object> map);
 
    @Select("select * from lf.sys_user where id = (select create_user from lf.sys_token where token=#{token} and expire > now() limit 1)")
    public UserPo selectByToken(String token);
 
    @Select("select a.* from lf.sys_token a where token = #{token} and expire > now() limit 1")
    public TokenPo selectOneByToken(String token);
}