package com.yeejoin.amos.boot.module.jg.biz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.netflix.discovery.converters.Auto;
import com.yeejoin.amos.boot.module.jg.api.entity.JgRegistrationHistory;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration;
import com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationManage;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationManageMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgUseRegistrationManageService;
import com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationManageDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 服务实现类
 *
 * @author system_generator
 * @date 2024-07-03
 */
@Service
public class JgUseRegistrationManageServiceImpl extends BaseService<JgUseRegistrationManageDto,JgUseRegistrationManage,JgUseRegistrationManageMapper> implements IJgUseRegistrationManageService {

    @Autowired
    private JgUseRegistrationManageMapper jgUseRegistrationManageMapper;

    @Autowired
    private JgUseRegistrationMapper jgUseRegistrationMapper;

    @Autowired
    private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;

    /**
     * 分页查询
     */
    public Page<JgUseRegistrationManageDto> queryForJgUseRegistrationManagePage(Page<JgUseRegistrationManageDto> page)   {
        return this.queryForPage(page, null, false);
    }
    /**
     * 列表查询
     */
    public List<JgUseRegistrationManageDto> queryByUseUnitCreditCode(JgUseRegistrationManageDto dto)   {
        return jgUseRegistrationManageMapper.queryByUseUnitCreditCode(dto);
    }

    /**
     * 根据证的sequenceNbr 查询证下面的所有设备
     */
    public List<Map<String, Object>> queryEquByCertificateSeq(Long sequenceNbr)   {
        // JgUseRegistrationManage jgUseRegistrationManage = this.baseMapper.selectOne(new LambdaQueryWrapper<JgUseRegistrationManage>()
        //         .eq(JgUseRegistrationManage::getSequenceNbr, sequenceNbr)
        //         .eq(JgUseRegistrationManage::getIsDelete, 0));
        // if (ValidationUtil.isEmpty(jgUseRegistrationManage.getApplyNo())){
        //     return new ArrayList<>();
        // }
        // JgUseRegistration useRegistration = jgUseRegistrationMapper.selectOne(new LambdaQueryWrapper<JgUseRegistration>()
        //         .eq(JgUseRegistration::getApplyNo, jgUseRegistrationManage.getApplyNo()));
        // JgRegistrationHistory jgRegistrationHistory = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>()
        //         .eq(JgRegistrationHistory::getCurrentDocumentId, useRegistration.getSequenceNbr()));
        // jgRegistrationHistory.
        return new ArrayList<Map<String, Object>>();
    }
}