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

k.e.book.ddh.service.CcAdminService 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.CcAdminDO;
import k.e.book.ddh.entity.CcAdminQueryDTO;
import k.e.book.ddh.mapper.CcAdminMapper;
import org.springframework.stereotype.Service;

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

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

        if(dto.getId() != null){
            qr.eq(CcAdminDO::getId, dto.getId());
        }
        if(dto.getUsername() != null){
            qr.eq(CcAdminDO::getUsername, dto.getUsername());
        }
        if(dto.getNickname() != null){
            qr.eq(CcAdminDO::getNickname, dto.getNickname());
        }
        if(dto.getPassword() != null){
            qr.eq(CcAdminDO::getPassword, dto.getPassword());
        }
        if(dto.getSalt() != null){
            qr.eq(CcAdminDO::getSalt, dto.getSalt());
        }
        if(dto.getAvatar() != null){
            qr.eq(CcAdminDO::getAvatar, dto.getAvatar());
        }
        if(dto.getEmail() != null){
            qr.eq(CcAdminDO::getEmail, dto.getEmail());
        }
        if(dto.getMobile() != null){
            qr.eq(CcAdminDO::getMobile, dto.getMobile());
        }
        if(dto.getLoginfailure() != null){
            qr.eq(CcAdminDO::getLoginfailure, dto.getLoginfailure());
        }
        if(dto.getLogintime() != null){
            qr.eq(CcAdminDO::getLogintime, dto.getLogintime());
        }
        if(dto.getLoginip() != null){
            qr.eq(CcAdminDO::getLoginip, dto.getLoginip());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcAdminDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getUpdatetime() != null){
            qr.eq(CcAdminDO::getUpdatetime, dto.getUpdatetime());
        }
        if(dto.getToken() != null){
            qr.eq(CcAdminDO::getToken, dto.getToken());
        }
        if(dto.getStatus() != null){
            qr.eq(CcAdminDO::getStatus, dto.getStatus());
        }

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