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

import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.desensitizationselftask.TCoreMonitorTmporary;
import com.chenyang.nse.bussiness.tools.xml.XmlTool;
import java.util.List;
import java.util.Map;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Repository;

@Repository
public class TCoreMonitorTmporaryDao extends BaseDao<TCoreMonitorTmporary, String> {
   public List queryTaskList(String taskid) {
      String sql = "select t.* from t_core_monitor_tmporary t where t.taskid = '" + taskid + "'  group by t.sourcename,createtime order by createtime desc";
      List list = this.getSession().createNativeQuery(sql).getResultList();
      return list;
   }

   public List<Map<String, Object>> querySelfMonitorNumber(String id) {
      String sql = XmlTool.getSql("getalltask", "selectSelfMonitorCountByProjectid");
      List<Map<String, Object>> vo = this.getSession().createNativeQuery(sql).setParameter("projectid", id).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
      return vo;
   }
}
