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

k.e.book.ddh.service.CcUserBoxEggService 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.CcUserBoxEggDO;
import k.e.book.ddh.entity.CcUserBoxEggQueryDTO;
import k.e.book.ddh.mapper.CcUserBoxEggMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcUserBoxEggDO::getId, dto.getId());
        }
        if(dto.getUserId() != null){
            qr.eq(CcUserBoxEggDO::getUserId, dto.getUserId());
        }
        if(dto.getQuantity() != null){
            qr.eq(CcUserBoxEggDO::getQuantity, dto.getQuantity());
        }
        if(dto.getItemId() != null){
            qr.eq(CcUserBoxEggDO::getItemId, dto.getItemId());
        }
        if(dto.getBoxId() != null){
            qr.eq(CcUserBoxEggDO::getBoxId, dto.getBoxId());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcUserBoxEggDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getStatus() != null){
            qr.eq(CcUserBoxEggDO::getStatus, dto.getStatus());
        }

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