k.e.book.ddh.service.CcDrawLogService 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.CcDrawLogDO;
import k.e.book.ddh.entity.CcDrawLogQueryDTO;
import k.e.book.ddh.mapper.CcDrawLogMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcDrawLogService extends ServiceImpl {
public IPage selectProductPage(CcDrawLogQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcDrawLogDO::getId, dto.getId());
}
if(dto.getDrawConfigId() != null){
qr.eq(CcDrawLogDO::getDrawConfigId, dto.getDrawConfigId());
}
if(dto.getUserId() != null){
qr.eq(CcDrawLogDO::getUserId, dto.getUserId());
}
if(dto.getType() != null){
qr.eq(CcDrawLogDO::getType, dto.getType());
}
if(dto.getRelationId() != null){
qr.eq(CcDrawLogDO::getRelationId, dto.getRelationId());
}
if(dto.getIsUse() != null){
qr.eq(CcDrawLogDO::getIsUse, dto.getIsUse());
}
if(dto.getStatus() != null){
qr.eq(CcDrawLogDO::getStatus, dto.getStatus());
}
if(dto.getCreatetime() != null){
qr.eq(CcDrawLogDO::getCreatetime, dto.getCreatetime());
}
if(dto.getUpdatetime() != null){
qr.eq(CcDrawLogDO::getUpdatetime, dto.getUpdatetime());
}
if(dto.getDeletetime() != null){
qr.eq(CcDrawLogDO::getDeletetime, dto.getDeletetime());
}
qr.orderByDesc(CcDrawLogDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}