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

k.e.book.ddh.service.CcProductCalendarService 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.CcProductCalendarDO;
import k.e.book.ddh.entity.CcProductCalendarQueryDTO;
import k.e.book.ddh.mapper.CcProductCalendarMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcProductCalendarDO::getId, dto.getId());
        }
        if(dto.getType() != null){
            qr.eq(CcProductCalendarDO::getType, dto.getType());
        }
        if(dto.getProductId() != null){
            qr.eq(CcProductCalendarDO::getProductId, dto.getProductId());
        }
        if(dto.getFlag() != null){
            qr.eq(CcProductCalendarDO::getFlag, dto.getFlag());
        }
        if(dto.getWeigh() != null){
            qr.eq(CcProductCalendarDO::getWeigh, dto.getWeigh());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcProductCalendarDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getUpdatetime() != null){
            qr.eq(CcProductCalendarDO::getUpdatetime, dto.getUpdatetime());
        }
        if(dto.getDeletetime() != null){
            qr.eq(CcProductCalendarDO::getDeletetime, dto.getDeletetime());
        }
        if(dto.getCreatedAt() != null){
            qr.eq(CcProductCalendarDO::getCreatedAt, dto.getCreatedAt());
        }
        if(dto.getUpdatedAt() != null){
            qr.eq(CcProductCalendarDO::getUpdatedAt, dto.getUpdatedAt());
        }
        if(dto.getDeletedAt() != null){
            qr.eq(CcProductCalendarDO::getDeletedAt, dto.getDeletedAt());
        }

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