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