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

k.e.book.ddh.service.CcUserGuildDetailService 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.CcUserGuildDetailDO;
import k.e.book.ddh.entity.CcUserGuildDetailQueryDTO;
import k.e.book.ddh.mapper.CcUserGuildDetailMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcUserGuildDetailDO::getId, dto.getId());
        }
        if(dto.getUserGuildId() != null){
            qr.eq(CcUserGuildDetailDO::getUserGuildId, dto.getUserGuildId());
        }
        if(dto.getIsGuild() != null){
            qr.eq(CcUserGuildDetailDO::getIsGuild, dto.getIsGuild());
        }
        if(dto.getUserId() != null){
            qr.eq(CcUserGuildDetailDO::getUserId, dto.getUserId());
        }
        if(dto.getJoinUserGuildId() != null){
            qr.eq(CcUserGuildDetailDO::getJoinUserGuildId, dto.getJoinUserGuildId());
        }
        if(dto.getTop() != null){
            qr.eq(CcUserGuildDetailDO::getTop, dto.getTop());
        }
        if(dto.getCreatedAt() != null){
            qr.eq(CcUserGuildDetailDO::getCreatedAt, dto.getCreatedAt());
        }
        if(dto.getUpdatedAt() != null){
            qr.eq(CcUserGuildDetailDO::getUpdatedAt, dto.getUpdatedAt());
        }

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