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