package com.xunmei.core.resumption.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xunmei.common.core.vo.IdNameVo;
import com.xunmei.core.resumption.domain.Resumption;
import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRoleDto;
import com.xunmei.core.resumption.vo.resumptionRecord.AppResumptionDataInfoVo;
import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionNFCDto;
import com.xunmei.core.resumption.dto.resumptionRecord.ResumptionRecordPageDto;
import com.xunmei.core.resumption.vo.resumptionRecord.NFCRecordVo;
import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordInfoVo;
import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordPageVo;
import com.xunmei.core.resumption.vo.resumptionRecord.ResumptionRecordTempVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author jingyuanchao
 * @since 2022-05-11
 */
@Mapper
public interface ResumptionRecordMapper extends BaseMapper<Resumption> {
    //    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
    List<ResumptionRecordPageVo> selectListByCondition(@Param("pageDto") ResumptionRecordPageDto pageDto, @Param("hashMap") HashMap<String, Object> hashMap, @Param("isTime") Boolean isTime, @Param("ymdQuarters") Set<Integer> ymdQuarters);

    //@DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
    Page<ResumptionRecordPageVo> selectPageByCondition(@Param("page") Page<ResumptionRecordPageVo> page, @Param("pageDto") ResumptionRecordPageDto pageDto, @Param("hashMap") HashMap<String, Object> hashMap, @Param("isTime") Boolean isTime, @Param("ymdQuarters") Set<Integer> ymdQuarters);

    /**
     * 未使用
     *
     * @param resumptionId
     * @return
     */
    List<ResumptionRecordInfoVo> selectInfo(@Param("resumptionId") String resumptionId);

    //    List<ResumptionRoleVo> selectResumptionRole(@Param("roleDto") ResumptionRoleDto roleDto);
//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
    List<AppResumptionDataInfoVo> selectResumptionDataList(@Param("resumptionId") String resumptionId);

    //    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
    List<NFCRecordVo> selectNFCRecord(@Param("dto") ResumptionNFCDto dto);

//    List<SecBookDtInst> selectSecBookDtInstList();

    //    List<SecBookDtiInst> selectSecBookDtiInstList(@Param("secBookDtInstId") Long secBookDtInstId);
//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
    List<AppResumptionDataInfoVo> selectDataInfo(@Param("ruleItemId") Long ruleItemId, @Param("resumptionId") String resumptionId);

    List<Long> selectRuleItemIdList(@Param("resumptionId") String resumptionId);

    List<Long> selectRuleItemIdListByResumptionIdList(@Param("resumptionIdList") List<String> resumptionIdList);

    ResumptionRecordInfoVo selectRuleItemInfo(@Param("ruleItemId") Long ruleItemId);

    List<IdNameVo> selectResumptionPlan(@Param("query") ResumptionRoleDto planDto);

    //    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
//    RegisterBookItemInfoVo selectData(@Param("id") String id);
//    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
    List<Long> selectResumptionDataPointId(@Param("id") String id);

    List<IdNameVo> selectResumptionRoles(@Param("query") ResumptionRoleDto planDto);

    List<ResumptionRecordTempVo> selectAbnormalData(@Param("ruleItemIdList") List<Long> ruleItemIdList, @Param("resumptionIdList") List<String> resumptionIdList);

    //    @DS(DataSourceName.SHARDING_DATA_SOURCE_NAME)
    List<Long> selectItemIdList(@Param("resumptionId") String resumptionId);

    List<Long> selectRuleItemIdListNew(@Param("ruleItemIdList") List<Long> ruleItemIdList);
}
