k.e.book.ddh.service.CcSnapshotConfigService 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.CcSnapshotConfigDO;
import k.e.book.ddh.entity.CcSnapshotConfigQueryDTO;
import k.e.book.ddh.mapper.CcSnapshotConfigMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcSnapshotConfigService extends ServiceImpl {
public IPage selectProductPage(CcSnapshotConfigQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcSnapshotConfigDO::getId, dto.getId());
}
if(dto.getTitle() != null){
qr.eq(CcSnapshotConfigDO::getTitle, dto.getTitle());
}
if(dto.getType() != null){
qr.eq(CcSnapshotConfigDO::getType, dto.getType());
}
if(dto.getProductIds() != null){
qr.eq(CcSnapshotConfigDO::getProductIds, dto.getProductIds());
}
if(dto.getBoxIds() != null){
qr.eq(CcSnapshotConfigDO::getBoxIds, dto.getBoxIds());
}
if(dto.getStarttime() != null){
qr.eq(CcSnapshotConfigDO::getStarttime, dto.getStarttime());
}
if(dto.getCreatetime() != null){
qr.eq(CcSnapshotConfigDO::getCreatetime, dto.getCreatetime());
}
if(dto.getStatus() != null){
qr.eq(CcSnapshotConfigDO::getStatus, dto.getStatus());
}
qr.orderByDesc(CcSnapshotConfigDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}