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

k.e.book.ddh.service.CcConfigService 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.CcConfigDO;
import k.e.book.ddh.entity.CcConfigQueryDTO;
import k.e.book.ddh.mapper.CcConfigMapper;
import org.springframework.stereotype.Service;

import java.util.List;

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

    public List listByNotify() {
        LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
        qr.eq(CcConfigDO::getGroup, "one");
        return this.list(qr);
    }

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

        if (dto.getId() != null) {
            qr.eq(CcConfigDO::getId, dto.getId());
        }
        if (dto.getName() != null) {
            qr.eq(CcConfigDO::getName, dto.getName());
        }
        if (dto.getGroup() != null) {
            qr.eq(CcConfigDO::getGroup, dto.getGroup());
        }
        if (dto.getTitle() != null) {
            qr.eq(CcConfigDO::getTitle, dto.getTitle());
        }
        if (dto.getTip() != null) {
            qr.eq(CcConfigDO::getTip, dto.getTip());
        }
        if (dto.getType() != null) {
            qr.eq(CcConfigDO::getType, dto.getType());
        }
        if (dto.getValue() != null) {
            qr.eq(CcConfigDO::getValue, dto.getValue());
        }
        if (dto.getContent() != null) {
            qr.eq(CcConfigDO::getContent, dto.getContent());
        }
        if (dto.getRule() != null) {
            qr.eq(CcConfigDO::getRule, dto.getRule());
        }
        if (dto.getExtend() != null) {
            qr.eq(CcConfigDO::getExtend, dto.getExtend());
        }
        if (dto.getSetting() != null) {
            qr.eq(CcConfigDO::getSetting, dto.getSetting());
        }
        if (dto.getVisible() != null) {
            qr.eq(CcConfigDO::getVisible, dto.getVisible());
        }

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