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

k.e.book.ddh.service.CcUserProductMergeService 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.CcUserProductMergeDO;
import k.e.book.ddh.entity.CcUserProductMergeQueryDTO;
import k.e.book.ddh.mapper.CcUserProductMergeMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcUserProductMergeDO::getId, dto.getId());
        }
        if(dto.getUserId() != null){
            qr.eq(CcUserProductMergeDO::getUserId, dto.getUserId());
        }
        if(dto.getMergeId() != null){
            qr.eq(CcUserProductMergeDO::getMergeId, dto.getMergeId());
        }
        if(dto.getItemIds() != null){
            qr.eq(CcUserProductMergeDO::getItemIds, dto.getItemIds());
        }
        if(dto.getMergeItemId() != null){
            qr.eq(CcUserProductMergeDO::getMergeItemId, dto.getMergeItemId());
        }
        if(dto.getLoseItemId() != null){
            qr.eq(CcUserProductMergeDO::getLoseItemId, dto.getLoseItemId());
        }
        if(dto.getMergeType() != null){
            qr.eq(CcUserProductMergeDO::getMergeType, dto.getMergeType());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcUserProductMergeDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getDeletetime() != null){
            qr.eq(CcUserProductMergeDO::getDeletetime, dto.getDeletetime());
        }

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