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

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

@Repository
public class TCoreFieldSensitiveDao extends BaseDao<TCoreFieldSensitive, String> {
   public void saveTCoreFieldSensitive(StringBuilder sql) {
      System.out.println(sql);
      this.getSession().createNativeQuery(sql.toString()).executeUpdate();
   }

   public List<TCoreFieldSensitive> getTCoreFieldSensitive(StringBuilder sql) {
      List<TCoreFieldSensitive> vo = this.getSession().createNativeQuery(sql.toString()).setResultTransformer(Transformers.aliasToBean(TCoreFieldSensitive.class)).getResultList();
      return vo;
   }

   public List<Object> getTCoreFieldSensitiveCount(StringBuilder sql) {
      new ArrayList();
      List list = this.getSession().createNativeQuery(sql.toString()).getResultList();
      return list;
   }

   public List<Object> getTCoreFieldSensitiveInfo(StringBuilder sql) {
      new ArrayList();
      List list = this.getSession().createNativeQuery(sql.toString()).getResultList();
      return list;
   }

   public List<Map<String, Object>> queryTCoreFieldSensitive(String project_id, String edition_id, String tschemas, String datasystem_id) {
      String sql = "select names from t_core_field_sensitive WHERE projectid = :project_id and edition_id = :edition_id and tschemas = :tschemas and datasystem_id = :datasystem_id";
      return this.getSession().createNativeQuery(sql).setParameter("project_id", project_id).setParameter("edition_id", edition_id).setParameter("tschemas", tschemas).setParameter("datasystem_id", datasystem_id).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP).getResultList();
   }
}
