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

k.e.book.ddh.service.CcUserGroupService 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.CcUserGroupDO;
import k.e.book.ddh.entity.CcUserGroupQueryDTO;
import k.e.book.ddh.mapper.CcUserGroupMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcUserGroupDO::getId, dto.getId());
        }
        if(dto.getName() != null){
            qr.eq(CcUserGroupDO::getName, dto.getName());
        }
        if(dto.getRules() != null){
            qr.eq(CcUserGroupDO::getRules, dto.getRules());
        }
        if(dto.getType() != null){
            qr.eq(CcUserGroupDO::getType, dto.getType());
        }
        if(dto.getAvatar() != null){
            qr.eq(CcUserGroupDO::getAvatar, dto.getAvatar());
        }
        if(dto.getServicefeerebate() != null){
            qr.eq(CcUserGroupDO::getServicefeerebate, dto.getServicefeerebate());
        }
        if(dto.getConsumerebate() != null){
            qr.eq(CcUserGroupDO::getConsumerebate, dto.getConsumerebate());
        }
        if(dto.getSigninrebate() != null){
            qr.eq(CcUserGroupDO::getSigninrebate, dto.getSigninrebate());
        }
        if(dto.getCreditshigher() != null){
            qr.eq(CcUserGroupDO::getCreditshigher, dto.getCreditshigher());
        }
        if(dto.getCreditslower() != null){
            qr.eq(CcUserGroupDO::getCreditslower, dto.getCreditslower());
        }
        if(dto.getRightdata() != null){
            qr.eq(CcUserGroupDO::getRightdata, dto.getRightdata());
        }
        if(dto.getProductIds() != null){
            qr.eq(CcUserGroupDO::getProductIds, dto.getProductIds());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcUserGroupDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getUpdatetime() != null){
            qr.eq(CcUserGroupDO::getUpdatetime, dto.getUpdatetime());
        }
        if(dto.getStatus() != null){
            qr.eq(CcUserGroupDO::getStatus, dto.getStatus());
        }

        qr.orderByDesc(CcUserGroupDO::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