13693261870
3 天以前 80247f1b5e00fab2ce6c9e8474cfeceefb902d95
se-common/src/main/java/com/terra/common/mapper/CommonMapper.java
@@ -2,8 +2,11 @@
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;
@@ -13,4 +16,10 @@
public interface CommonMapper 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);
}