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

k.e.book.ddh.service.CcSnapshotOwnerService 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.CcSnapshotOwnerDO;
import k.e.book.ddh.entity.CcSnapshotOwnerQueryDTO;
import k.e.book.ddh.mapper.CcSnapshotOwnerMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcSnapshotOwnerDO::getId, dto.getId());
        }
        if(dto.getType() != null){
            qr.eq(CcSnapshotOwnerDO::getType, dto.getType());
        }
        if(dto.getUserId() != null){
            qr.eq(CcSnapshotOwnerDO::getUserId, dto.getUserId());
        }
        if(dto.getName() != null){
            qr.eq(CcSnapshotOwnerDO::getName, dto.getName());
        }
        if(dto.getMobile() != null){
            qr.eq(CcSnapshotOwnerDO::getMobile, dto.getMobile());
        }
        if(dto.getProductId() != null){
            qr.eq(CcSnapshotOwnerDO::getProductId, dto.getProductId());
        }
        if(dto.getItemId() != null){
            qr.eq(CcSnapshotOwnerDO::getItemId, dto.getItemId());
        }
        if(dto.getBoxId() != null){
            qr.eq(CcSnapshotOwnerDO::getBoxId, dto.getBoxId());
        }
        if(dto.getBoxqty() != null){
            qr.eq(CcSnapshotOwnerDO::getBoxqty, dto.getBoxqty());
        }
        if(dto.getOwnertime() != null){
            qr.eq(CcSnapshotOwnerDO::getOwnertime, dto.getOwnertime());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcSnapshotOwnerDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getSendstatus() != null){
            qr.eq(CcSnapshotOwnerDO::getSendstatus, dto.getSendstatus());
        }

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