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

k.e.book.ddh.service.CcMergeMaterialService 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.CcMergeMaterialDO;
import k.e.book.ddh.entity.CcMergeMaterialQueryDTO;
import k.e.book.ddh.mapper.CcMergeMaterialMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcMergeMaterialDO::getId, dto.getId());
        }
        if(dto.getMergeId() != null){
            qr.eq(CcMergeMaterialDO::getMergeId, dto.getMergeId());
        }
        if(dto.getRuleId() != null){
            qr.eq(CcMergeMaterialDO::getRuleId, dto.getRuleId());
        }
        if(dto.getProductId() != null){
            qr.eq(CcMergeMaterialDO::getProductId, dto.getProductId());
        }
        if(dto.getQuantity() != null){
            qr.eq(CcMergeMaterialDO::getQuantity, dto.getQuantity());
        }
        if(dto.getLosegrade() != null){
            qr.eq(CcMergeMaterialDO::getLosegrade, dto.getLosegrade());
        }
        if(dto.getLogic() != null){
            qr.eq(CcMergeMaterialDO::getLogic, dto.getLogic());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcMergeMaterialDO::getCreatetime, dto.getCreatetime());
        }

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