k.e.book.ddh.service.CccConfigService 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.CccConfigDO;
import k.e.book.ddh.entity.CccConfigQueryDTO;
import k.e.book.ddh.mapper.CccConfigMapper;
import org.springframework.stereotype.Service;
/**
* @author kk
* @date 2023-05-21 11:04
*/
@Service
public class CccConfigService extends ServiceImpl {
public IPage selectProductPage(CccConfigQueryDTO dto) {
LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
if(dto.getId() != null){
qr.eq(CccConfigDO::getId, dto.getId());
}
if(dto.getName() != null){
qr.eq(CccConfigDO::getName, dto.getName());
}
if(dto.getGroup() != null){
qr.eq(CccConfigDO::getGroup, dto.getGroup());
}
if(dto.getTitle() != null){
qr.eq(CccConfigDO::getTitle, dto.getTitle());
}
if(dto.getTip() != null){
qr.eq(CccConfigDO::getTip, dto.getTip());
}
if(dto.getType() != null){
qr.eq(CccConfigDO::getType, dto.getType());
}
if(dto.getVisible() != null){
qr.eq(CccConfigDO::getVisible, dto.getVisible());
}
if(dto.getValue() != null){
qr.eq(CccConfigDO::getValue, dto.getValue());
}
if(dto.getContent() != null){
qr.eq(CccConfigDO::getContent, dto.getContent());
}
if(dto.getRule() != null){
qr.eq(CccConfigDO::getRule, dto.getRule());
}
if(dto.getExtend() != null){
qr.eq(CccConfigDO::getExtend, dto.getExtend());
}
if(dto.getSetting() != null){
qr.eq(CccConfigDO::getSetting, dto.getSetting());
}
qr.orderByDesc(CccConfigDO::getId);
IPage page = new Page<>();
page.setCurrent(dto.getPage());
page.setSize(dto.getLimit());
return baseMapper.selectPage(page, qr);
}
}