package com.hzya.frame.sysnew.comparison.masterData.dao.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.execsql.service.IExecSqlService;
import com.hzya.frame.mdm.mdmModuleSource.entity.MdmModuleSourceEntity;
import com.hzya.frame.sysnew.comparison.entity.ComparisonEntity;
import com.hzya.frame.sysnew.comparison.masterData.dao.IMasterDataDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

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

@Repository(value = "masterDataDaoImpl")
public class MasterDataDaoImpl extends BaseService<ComparisonEntity, String> implements IMasterDataDao {

    @Autowired
    private IExecSqlService execSqlService;

    @DS("swu8c")
    @Override
    public List<HashMap<String, Object>> queryArchives(String str) {
        try {
            List<HashMap<String, Object>> hashMaps = execSqlService.execSelectSql(str, "");
            return hashMaps;
        }catch (Exception e){
            logger.info("U8C主数据档案用户档案没有需要同步中台的数据");
            return null;
        }
    }
    @DS("#entity.dataSourceCode")
    @Override
    public List<HashMap<String, Object>> queryArchivesByDataSource(String str, MdmModuleSourceEntity entity) {
        try {
            List<HashMap<String, Object>> hashMaps = execSqlService.execSelectSql(str, "");
            return hashMaps;
        }catch (Exception e){
            logger.info("U8C主数据档案用户档案没有需要同步中台的数据");
            return null;
        }
    }
}
