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