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

k.e.book.ddh.service.CcUserGuildService 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.CcUserGuildDO;
import k.e.book.ddh.entity.CcUserGuildQueryDTO;
import k.e.book.ddh.mapper.CcUserGuildMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcUserGuildDO::getId, dto.getId());
        }
        if(dto.getUserId() != null){
            qr.eq(CcUserGuildDO::getUserId, dto.getUserId());
        }
        if(dto.getName() != null){
            qr.eq(CcUserGuildDO::getName, dto.getName());
        }
        if(dto.getImage() != null){
            qr.eq(CcUserGuildDO::getImage, dto.getImage());
        }
        if(dto.getContent() != null){
            qr.eq(CcUserGuildDO::getContent, dto.getContent());
        }
        if(dto.getCode() != null){
            qr.eq(CcUserGuildDO::getCode, dto.getCode());
        }
        if(dto.getCount() != null){
            qr.eq(CcUserGuildDO::getCount, dto.getCount());
        }
        if(dto.getCreatedAt() != null){
            qr.eq(CcUserGuildDO::getCreatedAt, dto.getCreatedAt());
        }
        if(dto.getUpdatedAt() != null){
            qr.eq(CcUserGuildDO::getUpdatedAt, dto.getUpdatedAt());
        }
        if(dto.getDeletedAt() != null){
            qr.eq(CcUserGuildDO::getDeletedAt, dto.getDeletedAt());
        }

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