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

k.e.book.ddh.service.CcElectronicAccountService 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.CcElectronicAccountDO;
import k.e.book.ddh.entity.CcElectronicAccountQueryDTO;
import k.e.book.ddh.mapper.CcElectronicAccountMapper;
import org.springframework.stereotype.Service;

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

    /***
     *
     * @param userId 用户id
     * @return 获取易宝云账号id
     */
    public CcElectronicAccountDO getYiBaoElec(Long userId){
        LambdaQueryWrapper qr = new LambdaQueryWrapper<>();
        qr.eq(CcElectronicAccountDO::getUserId,userId).eq(CcElectronicAccountDO::getType,5);
        qr.select(CcElectronicAccountDO::getEid);
        return this.getOne(qr);
    }

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

        if(dto.getId() != null){
            qr.eq(CcElectronicAccountDO::getId, dto.getId());
        }
        if(dto.getUserId() != null){
            qr.eq(CcElectronicAccountDO::getUserId, dto.getUserId());
        }
        if(dto.getExternalUserid() != null){
            qr.eq(CcElectronicAccountDO::getExternalUserid, dto.getExternalUserid());
        }
        if(dto.getType() != null){
            qr.eq(CcElectronicAccountDO::getType, dto.getType());
        }
        if(dto.getMerchantId() != null){
            qr.eq(CcElectronicAccountDO::getMerchantId, dto.getMerchantId());
        }
        if(dto.getEid() != null){
            qr.eq(CcElectronicAccountDO::getEid, dto.getEid());
        }
        if(dto.getCreatetime() != null){
            qr.eq(CcElectronicAccountDO::getCreatetime, dto.getCreatetime());
        }
        if(dto.getUpdatetime() != null){
            qr.eq(CcElectronicAccountDO::getUpdatetime, dto.getUpdatetime());
        }
        if(dto.getDeletetime() != null){
            qr.eq(CcElectronicAccountDO::getDeletetime, dto.getDeletetime());
        }
        if(dto.getRemark() != null){
            qr.eq(CcElectronicAccountDO::getRemark, dto.getRemark());
        }
        if(dto.getStatus() != null){
            qr.eq(CcElectronicAccountDO::getStatus, dto.getStatus());
        }
        if(dto.getOriTxt() != null){
            qr.eq(CcElectronicAccountDO::getOriTxt, dto.getOriTxt());
        }
        if(dto.getMobile() != null){
            qr.eq(CcElectronicAccountDO::getMobile, dto.getMobile());
        }
        if(dto.getName() != null){
            qr.eq(CcElectronicAccountDO::getName, dto.getName());
        }
        if(dto.getIdcard() != null){
            qr.eq(CcElectronicAccountDO::getIdcard, dto.getIdcard());
        }
        if(dto.getCreatedAt() != null){
            qr.eq(CcElectronicAccountDO::getCreatedAt, dto.getCreatedAt());
        }
        if(dto.getUpdatedAt() != null){
            qr.eq(CcElectronicAccountDO::getUpdatedAt, dto.getUpdatedAt());
        }
        if(dto.getDeletedAt() != null){
            qr.eq(CcElectronicAccountDO::getDeletedAt, dto.getDeletedAt());
        }

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