package com.chenyang.nse.bussiness.dao.table.core.findcharts;

import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.findCharts.EchartsOne;
import java.util.List;
import java.util.Map;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Repository;

@Repository
public class EchartsOneDao extends BaseDao<EchartsOne, String> {
   public List<Map<String, Object>> findNameByTaskid(String taskid) {
      String sql = "select nonsensitiveNumber,sensitiveNumber,nonsensitiveNumber+sensitiveNumber,taskName FROM t_core_findcharts_one WHERE taskid ='" + taskid + "'";
      List<Map<String, Object>> list = this.getSession().createNativeQuery(sql).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
      return list;
   }

   public List<EchartsOne> findAllTaskid() {
      String sql = "select taskid,taskName FROM t_core_findcharts_one order by taskid+0";
      List<EchartsOne> list = this.getSession().createNativeQuery(sql).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
      return list;
   }

   public List<EchartsOne> findArrAllTaskid(String[] taskidarr) {
      String sql = "select nonsensitiveNumber,sensitiveNumber,taskName,nonsensitiveNumber+sensitiveNumber  FROM t_core_findcharts_one WHERE taskid in(" + taskidarr + ")";
      List<EchartsOne> list = this.getSession().createNativeQuery(sql).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
      return list;
   }
}
