TokensServiceImpl.java
1.04 KB
package com.huaheng.pc.config.token.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huaheng.common.utils.StringUtils;
import com.huaheng.common.utils.Wrappers;
import com.huaheng.pc.config.token.domain.Token;
import com.huaheng.pc.config.token.mapper.TokenMapper;
import com.huaheng.pc.shipment.kuaidiHeader.domain.KuaidiHeader;
import org.springframework.stereotype.Service;
/**
* 【请填写功能名称】 服务层实现
*
* @author huaheng
* @date 2022-08-26
*/
@Service("tokens")
public class TokensServiceImpl extends ServiceImpl<TokenMapper, Token> implements ITokensService {
@Override
public Token getTokenByParam(Token token){
LambdaQueryWrapper<Token> lambdaQueryWrapper = Wrappers.lambdaQueryNoWarehouse();
lambdaQueryWrapper.eq(StringUtils.isNotEmpty(token.getType()),Token::getType,token.getType());
lambdaQueryWrapper.last("limit 1");
return this.getOne(lambdaQueryWrapper);
}
}