All Downloads are FREE. Search and download functionalities are using the official Maven repository.

k.e.book.ddh.service.CcAuthRuleService 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.CcAuthRuleDO;
import k.e.book.ddh.entity.CcAuthRuleQueryDTO;
import k.e.book.ddh.mapper.CcAuthRuleMapper;
import org.springframework.stereotype.Service;

/**
 * @author kk
 * @date 2023-05-21 11:04
 */
@Service
public class CcAuthRuleService extends ServiceImpl {

    public IPage selectProductPage(CcAuthRuleQueryDTO dto) {
        LambdaQueryWrapper qr = new LambdaQueryWrapper<>();

        if(dto.getId() != null){
            qr.eq(CcAuthRuleDO::getId, dto.getId());
        }
        if(dto.getType() != null){
            qr.eq(CcAuthRuleDO::getType, dto.getType());
        }
        if(dto.getPid() != null){
            qr.eq(CcAuthRuleDO::getPid, dto.getPid());
        }
        if(dto.getName() != null){
            qr.eq(CcAuthRuleDO::getName, dto.getName());
        }
        if(dto.getTitle() != null){
            qr.eq(CcAuthRuleDO::getTitle, dto.getTitle());
        }
        if(dto.getIcon() != null){
            qr.eq(CcAuthRuleDO::getIcon, dto.getIcon());
        }
        if(dto.getUrl() != null){
            qr.eq(CcAuthRuleDO::getUrl, dto.getUrl());
        }
        if(dto.getCondition() != null){
            qr.eq(CcAuthRuleDO::getCondition, dto.getCondition());
        }
        if(dto.getRemark() != null){
            qr.eq(CcAuthRuleDO::getRemark, dto.getRemark());
        }
        if(dto.getIsmenu() != null){
            qr.eq(CcAuthRuleDO::getIsmenu, dto.getIsmenu());
        }
        if(dto.getMenutype() != null){
            qr.eq(CcAuthRuleDO::getMenutype, dto.getMenutype());
        }
        if(dto.getExtend() != null){
            qr.eq(CcAuthRuleDO::getExtend, dto.getExtend());
        }
        if(dto.getPy() != null){
            qr.eq(CcAuthRuleDO::getPy, dto.getPy());
        }
        if(dto.getPinyin() != null){
            qr.eq(CcAuthRuleDO::getPinyin, dto.getPinyin());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcAuthRuleDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getUpdatetime() != null){
            qr.eq(CcAuthRuleDO::getUpdatetime, dto.getUpdatetime());
        }
        if(dto.getWeigh() != null){
            qr.eq(CcAuthRuleDO::getWeigh, dto.getWeigh());
        }
        if(dto.getStatus() != null){
            qr.eq(CcAuthRuleDO::getStatus, dto.getStatus());
        }

        qr.orderByDesc(CcAuthRuleDO::getId);
        IPage page = new Page<>();
        page.setCurrent(dto.getPage());
        page.setSize(dto.getLimit());
        return baseMapper.selectPage(page, qr);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy