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

k.e.book.ddh.service.CcInviteService 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.CcInviteDO;
import k.e.book.ddh.entity.CcInviteQueryDTO;
import k.e.book.ddh.mapper.CcInviteMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcInviteDO::getId, dto.getId());
        }
        if(dto.getUserId() != null){
            qr.eq(CcInviteDO::getUserId, dto.getUserId());
        }
        if(dto.getInvitedUserId() != null){
            qr.eq(CcInviteDO::getInvitedUserId, dto.getInvitedUserId());
        }
        if(dto.getIp() != null){
            qr.eq(CcInviteDO::getIp, dto.getIp());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcInviteDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getCreatedAt() != null){
            qr.eq(CcInviteDO::getCreatedAt, dto.getCreatedAt());
        }
        if(dto.getUpdatedAt() != null){
            qr.eq(CcInviteDO::getUpdatedAt, dto.getUpdatedAt());
        }
        if(dto.getDeletedAt() != null){
            qr.eq(CcInviteDO::getDeletedAt, dto.getDeletedAt());
        }

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