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

import com.chenyang.nse.bussiness.dao.BaseDao;
import com.chenyang.nse.bussiness.entity.orm.table.core.scopeproject.TProAttributeGroup;
import org.springframework.stereotype.Repository;

@Repository
public class TProAttributeGroupDao extends BaseDao<TProAttributeGroup, String> {
   public void saveExcelData(StringBuilder sql) {
      this.getSession().createNativeQuery(sql.toString()).executeUpdate();
   }

   public void removeAssScope(String editionid) {
      String sql = "DELETE b FROM t_core_data_scope a,t_pro_attribute_group b WHERE a.id=b.group_id and a.edition_id = '" + editionid + "'";
      this.getSession().createNativeQuery(sql).executeUpdate();
   }

   public void removeAssSensitive(String editionid) {
      String sql = "DELETE b FROM t_core_sensitive_level a,t_pro_attribute_group b WHERE a.id=b.group_id and a.edition_id = '" + editionid + "'";
      this.getSession().createNativeQuery(sql).executeUpdate();
   }

   public void removeAssCompliance(String editionid) {
      String sql = "DELETE b FROM t_core_compliance_directory a,t_pro_attribute_group b WHERE a.id=b.group_id and a.edition_id = '" + editionid + "'";
      this.getSession().createNativeQuery(sql).executeUpdate();
   }
}
