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