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

k.e.book.ddh.service.CcProductMergeService 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.CcProductMergeDO;
import k.e.book.ddh.entity.CcProductMergeQueryDTO;
import k.e.book.ddh.mapper.CcProductMergeMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcProductMergeDO::getId, dto.getId());
        }
        if(dto.getSubject() != null){
            qr.eq(CcProductMergeDO::getSubject, dto.getSubject());
        }
        if(dto.getSeries() != null){
            qr.eq(CcProductMergeDO::getSeries, dto.getSeries());
        }
        if(dto.getContent() != null){
            qr.eq(CcProductMergeDO::getContent, dto.getContent());
        }
        if(dto.getProductIds() != null){
            qr.eq(CcProductMergeDO::getProductIds, dto.getProductIds());
        }
        if(dto.getQuantity() != null){
            qr.eq(CcProductMergeDO::getQuantity, dto.getQuantity());
        }
        if(dto.getSoldQty() != null){
            qr.eq(CcProductMergeDO::getSoldQty, dto.getSoldQty());
        }
        if(dto.getStarttime() != null){
            qr.eq(CcProductMergeDO::getStarttime, dto.getStarttime());
        }
        if(dto.getEndtime() != null){
            qr.eq(CcProductMergeDO::getEndtime, dto.getEndtime());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcProductMergeDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getUpdatetime() != null){
            qr.eq(CcProductMergeDO::getUpdatetime, dto.getUpdatetime());
        }
        if(dto.getBeforestarttime() != null){
            qr.eq(CcProductMergeDO::getBeforestarttime, dto.getBeforestarttime());
        }
        if(dto.getBeforeendtime() != null){
            qr.eq(CcProductMergeDO::getBeforeendtime, dto.getBeforeendtime());
        }
        if(dto.getWhitelist() != null){
            qr.eq(CcProductMergeDO::getWhitelist, dto.getWhitelist());
        }
        if(dto.getStatus() != null){
            qr.eq(CcProductMergeDO::getStatus, dto.getStatus());
        }

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