k.e.book.ddh.service.CcUserBoxDetailService 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.CcUserBoxDetailDO;
import k.e.book.ddh.entity.CcUserBoxDetailQueryDTO;
import k.e.book.ddh.mapper.CcUserBoxDetailMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcUserBoxDetailService extends ServiceImpl {
public IPage selectProductPage(CcUserBoxDetailQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcUserBoxDetailDO::getId, dto.getId());
}
if(dto.getParentId() != null){
qr.eq(CcUserBoxDetailDO::getParentId, dto.getParentId());
}
if(dto.getUserId() != null){
qr.eq(CcUserBoxDetailDO::getUserId, dto.getUserId());
}
if(dto.getSellerId() != null){
qr.eq(CcUserBoxDetailDO::getSellerId, dto.getSellerId());
}
if(dto.getUserBoxId() != null){
qr.eq(CcUserBoxDetailDO::getUserBoxId, dto.getUserBoxId());
}
if(dto.getBoxId() != null){
qr.eq(CcUserBoxDetailDO::getBoxId, dto.getBoxId());
}
if(dto.getItemId() != null){
qr.eq(CcUserBoxDetailDO::getItemId, dto.getItemId());
}
if(dto.getAmount() != null){
qr.eq(CcUserBoxDetailDO::getAmount, dto.getAmount());
}
if(dto.getQuantity() != null){
qr.eq(CcUserBoxDetailDO::getQuantity, dto.getQuantity());
}
if(dto.getCreatetime() != null){
qr.eq(CcUserBoxDetailDO::getCreatetime, dto.getCreatetime());
}
if(dto.getStatus() != null){
qr.eq(CcUserBoxDetailDO::getStatus, dto.getStatus());
}
if(dto.getCreatedAt() != null){
qr.eq(CcUserBoxDetailDO::getCreatedAt, dto.getCreatedAt());
}
if(dto.getUpdatedAt() != null){
qr.eq(CcUserBoxDetailDO::getUpdatedAt, dto.getUpdatedAt());
}
if(dto.getDeletedAt() != null){
qr.eq(CcUserBoxDetailDO::getDeletedAt, dto.getDeletedAt());
}
qr.orderByDesc(CcUserBoxDetailDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}