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

k.e.book.ddh.service.CcIntegralLuckService 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.CcIntegralLuckDO;
import k.e.book.ddh.entity.CcIntegralLuckQueryDTO;
import k.e.book.ddh.mapper.CcIntegralLuckMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcIntegralLuckDO::getId, dto.getId());
        }
        if(dto.getType() != null){
            qr.eq(CcIntegralLuckDO::getType, dto.getType());
        }
        if(dto.getName() != null){
            qr.eq(CcIntegralLuckDO::getName, dto.getName());
        }
        if(dto.getImage() != null){
            qr.eq(CcIntegralLuckDO::getImage, dto.getImage());
        }
        if(dto.getDesc() != null){
            qr.eq(CcIntegralLuckDO::getDesc, dto.getDesc());
        }
        if(dto.getChance() != null){
            qr.eq(CcIntegralLuckDO::getChance, dto.getChance());
        }
        if(dto.getQuantity() != null){
            qr.eq(CcIntegralLuckDO::getQuantity, dto.getQuantity());
        }
        if(dto.getDrawQty() != null){
            qr.eq(CcIntegralLuckDO::getDrawQty, dto.getDrawQty());
        }
        if(dto.getNum() != null){
            qr.eq(CcIntegralLuckDO::getNum, dto.getNum());
        }
        if(dto.getSort() != null){
            qr.eq(CcIntegralLuckDO::getSort, dto.getSort());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcIntegralLuckDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getUpdatetime() != null){
            qr.eq(CcIntegralLuckDO::getUpdatetime, dto.getUpdatetime());
        }
        if(dto.getDeletetime() != null){
            qr.eq(CcIntegralLuckDO::getDeletetime, dto.getDeletetime());
        }

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