k.e.book.ddh.service.CcIntegralCouponService 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.CcIntegralCouponDO;
import k.e.book.ddh.entity.CcIntegralCouponQueryDTO;
import k.e.book.ddh.mapper.CcIntegralCouponMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcIntegralCouponService extends ServiceImpl {
public IPage selectProductPage(CcIntegralCouponQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcIntegralCouponDO::getId, dto.getId());
}
if(dto.getUserId() != null){
qr.eq(CcIntegralCouponDO::getUserId, dto.getUserId());
}
if(dto.getUsername() != null){
qr.eq(CcIntegralCouponDO::getUsername, dto.getUsername());
}
if(dto.getTitle() != null){
qr.eq(CcIntegralCouponDO::getTitle, dto.getTitle());
}
if(dto.getSource() != null){
qr.eq(CcIntegralCouponDO::getSource, dto.getSource());
}
if(dto.getType() != null){
qr.eq(CcIntegralCouponDO::getType, dto.getType());
}
if(dto.getVolume() != null){
qr.eq(CcIntegralCouponDO::getVolume, dto.getVolume());
}
if(dto.getStatus() != null){
qr.eq(CcIntegralCouponDO::getStatus, dto.getStatus());
}
if(dto.getValidityStart() != null){
qr.eq(CcIntegralCouponDO::getValidityStart, dto.getValidityStart());
}
if(dto.getValidityEnd() != null){
qr.eq(CcIntegralCouponDO::getValidityEnd, dto.getValidityEnd());
}
if(dto.getRemark() != null){
qr.eq(CcIntegralCouponDO::getRemark, dto.getRemark());
}
if(dto.getCreatetime() != null){
qr.eq(CcIntegralCouponDO::getCreatetime, dto.getCreatetime());
}
if(dto.getUpdatetime() != null){
qr.eq(CcIntegralCouponDO::getUpdatetime, dto.getUpdatetime());
}
if(dto.getDeletetime() != null){
qr.eq(CcIntegralCouponDO::getDeletetime, dto.getDeletetime());
}
qr.orderByDesc(CcIntegralCouponDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}