k.e.book.ddh.service.CcUserTokenService Maven / Gradle / Ivy
package k.e.book.ddh.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import k.e.book.ddh.entity.CcUserTokenDO;
import k.e.book.ddh.entity.CcUserTokenQueryDTO;
import k.e.book.ddh.mapper.CcUserTokenMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcUserTokenService extends ServiceImpl {
public IPage selectProductPage(CcUserTokenQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcUserTokenDO::getId, dto.getId());
}
if(dto.getToken() != null){
qr.eq(CcUserTokenDO::getToken, dto.getToken());
}
if(dto.getUserId() != null){
qr.eq(CcUserTokenDO::getUserId, dto.getUserId());
}
if(dto.getLoginIp() != null){
qr.eq(CcUserTokenDO::getLoginIp, dto.getLoginIp());
}
if(dto.getCreatetime() != null){
qr.eq(CcUserTokenDO::getCreatetime, dto.getCreatetime());
}
if(dto.getExpiretime() != null){
qr.eq(CcUserTokenDO::getExpiretime, dto.getExpiretime());
}
if(dto.getCreatedAt() != null){
qr.eq(CcUserTokenDO::getCreatedAt, dto.getCreatedAt());
}
if(dto.getUpdatedAt() != null){
qr.eq(CcUserTokenDO::getUpdatedAt, dto.getUpdatedAt());
}
if(dto.getDeletedAt() != null){
qr.eq(CcUserTokenDO::getDeletedAt, dto.getDeletedAt());
}
qr.orderByDesc(CcUserTokenDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}