package com.ruoyi.system.service.impl;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.domain.OdsQssHsjcxx;
import com.ruoyi.system.mapper.UserInfoMapper;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.OdsQssHsjcxxService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class OdsQssHsjcxxServiceImpl  implements OdsQssHsjcxxService {

    @Autowired
    private UserInfoMapper userInfoMapper;



    /**
     * 从第三方库获取核酸数据
     */
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    @DataSource(value = DataSourceType.SLAVE)
    @Override
    public List<OdsQssHsjcxx> thirdNucleicAcid(String startTime,String endTime, List<String> idCardList) {
        System.out.println("batchInsert 查询数据开始========");
        long start1 = System.currentTimeMillis();
        List<OdsQssHsjcxx> accountingDataVos = userInfoMapper.thirdNucleicAcid(startTime,endTime,idCardList);
        if(accountingDataVos!=null){
            //taskService.insertAccountingData(accountingDataVos);
        }
        long end1 = System.currentTimeMillis();
        System.out.println("---------------查询数据耗时" + (end1 - start1) + "---------------");
        return accountingDataVos;
    }
}
