k.e.book.ddh.service.CcAdszoneAdsService 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.CcAdszoneAdsDO;
import k.e.book.ddh.entity.CcAdszoneAdsQueryDTO;
import k.e.book.ddh.mapper.CcAdszoneAdsMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CcAdszoneAdsService extends ServiceImpl {
public IPage selectProductPage(CcAdszoneAdsQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CcAdszoneAdsDO::getId, dto.getId());
}
if(dto.getTitle() != null){
qr.eq(CcAdszoneAdsDO::getTitle, dto.getTitle());
}
if(dto.getImageurl() != null){
qr.eq(CcAdszoneAdsDO::getImageurl, dto.getImageurl());
}
if(dto.getLinkurl() != null){
qr.eq(CcAdszoneAdsDO::getLinkurl, dto.getLinkurl());
}
if(dto.getTarget() != null){
qr.eq(CcAdszoneAdsDO::getTarget, dto.getTarget());
}
if(dto.getCode() != null){
qr.eq(CcAdszoneAdsDO::getCode, dto.getCode());
}
if(dto.getExpiretime() != null){
qr.eq(CcAdszoneAdsDO::getExpiretime, dto.getExpiretime());
}
if(dto.getWeigh() != null){
qr.eq(CcAdszoneAdsDO::getWeigh, dto.getWeigh());
}
if(dto.getCreatetime() != null){
qr.eq(CcAdszoneAdsDO::getCreatetime, dto.getCreatetime());
}
if(dto.getUpdatetime() != null){
qr.eq(CcAdszoneAdsDO::getUpdatetime, dto.getUpdatetime());
}
if(dto.getZoneId() != null){
qr.eq(CcAdszoneAdsDO::getZoneId, dto.getZoneId());
}
if(dto.getEffectime() != null){
qr.eq(CcAdszoneAdsDO::getEffectime, dto.getEffectime());
}
qr.orderByDesc(CcAdszoneAdsDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}