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

k.e.book.ddh.service.CcAdszoneZoneService 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.CcAdszoneZoneDO;
import k.e.book.ddh.entity.CcAdszoneZoneQueryDTO;
import k.e.book.ddh.mapper.CcAdszoneZoneMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcAdszoneZoneDO::getId, dto.getId());
        }
        if(dto.getName() != null){
            qr.eq(CcAdszoneZoneDO::getName, dto.getName());
        }
        if(dto.getMark() != null){
            qr.eq(CcAdszoneZoneDO::getMark, dto.getMark());
        }
        if(dto.getType() != null){
            qr.eq(CcAdszoneZoneDO::getType, dto.getType());
        }
        if(dto.getWidth() != null){
            qr.eq(CcAdszoneZoneDO::getWidth, dto.getWidth());
        }
        if(dto.getHeight() != null){
            qr.eq(CcAdszoneZoneDO::getHeight, dto.getHeight());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcAdszoneZoneDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getUpdatetime() != null){
            qr.eq(CcAdszoneZoneDO::getUpdatetime, dto.getUpdatetime());
        }
        if(dto.getCode() != null){
            qr.eq(CcAdszoneZoneDO::getCode, dto.getCode());
        }

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