k.e.book.ddh.service.CcGiveService 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.CcGiveDO;
import k.e.book.ddh.entity.CcGiveQueryDTO;
import k.e.book.ddh.mapper.CcGiveMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcGiveService extends ServiceImpl {
public IPage selectProductPage(CcGiveQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcGiveDO::getId, dto.getId());
}
if(dto.getUserId() != null){
qr.eq(CcGiveDO::getUserId, dto.getUserId());
}
if(dto.getReceiveUid() != null){
qr.eq(CcGiveDO::getReceiveUid, dto.getReceiveUid());
}
if(dto.getProductId() != null){
qr.eq(CcGiveDO::getProductId, dto.getProductId());
}
if(dto.getItemId() != null){
qr.eq(CcGiveDO::getItemId, dto.getItemId());
}
if(dto.getCollectId() != null){
qr.eq(CcGiveDO::getCollectId, dto.getCollectId());
}
if(dto.getCreatetime() != null){
qr.eq(CcGiveDO::getCreatetime, dto.getCreatetime());
}
if(dto.getUpdatetime() != null){
qr.eq(CcGiveDO::getUpdatetime, dto.getUpdatetime());
}
if(dto.getDeletetime() != null){
qr.eq(CcGiveDO::getDeletetime, dto.getDeletetime());
}
if(dto.getStatus() != null){
qr.eq(CcGiveDO::getStatus, dto.getStatus());
}
if(dto.getCreatedAt() != null){
qr.eq(CcGiveDO::getCreatedAt, dto.getCreatedAt());
}
if(dto.getUpdatedAt() != null){
qr.eq(CcGiveDO::getUpdatedAt, dto.getUpdatedAt());
}
if(dto.getDeletedAt() != null){
qr.eq(CcGiveDO::getDeletedAt, dto.getDeletedAt());
}
qr.orderByDesc(CcGiveDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}