@Override
  public void edit(AcademicKPI domain) {
    logger.info("domain : " + BeanUtils.getBeanString(domain));

    this.jdbcTemplate.update(
        "update    academic_kpi set name=?,mark=?,unit_code=? ,rule_code=? ,order_no=?,description=? ,"
            + " special_p1=?,   special_p2=?, special_p3=?, special_p4=?, total_student_from=?, total_student_to=?,from_reg=? where academic_kpi_id=? ",
        domain.getName(),
        domain.getMark(),
        domain.getUnitCode(),
        domain.getMultiplyValue(),
        domain.getOrderNo(),
        domain.getDescription(),
        domain.getSpecialP1(),
        domain.getSpecialP2(),
        domain.getSpecialP3(),
        domain.getSpecialP4(),
        domain.getTotalStudentFrom(),
        domain.getTotalStudentTo(),
        domain.getFromRegis(),
        domain.getAcademicKPIId());

    List<AcademicKPIAttribute> academicKPIAttributeList = domain.getAcademicKPIAttributeList();
    if (academicKPIAttributeList != null && academicKPIAttributeList.size() > 0) {
      for (AcademicKPIAttribute tmp : academicKPIAttributeList) {
        logger.info(" checkValue:" + tmp.getIsCalculate());
        String isCheckFlage = "on".equalsIgnoreCase(tmp.getIsCalculate()) ? "Y" : "N";
        String isCheckFlage2 = "on".equalsIgnoreCase(tmp.getIsValidateNumber()) ? "Y" : "N";
        logger.info(
            "  Name :"
                + tmp.getName()
                + " isCal:"
                + isCheckFlage
                + " isValidateNumber:"
                + isCheckFlage2);
        this.jdbcTemplate.update(
            "update    academic_kpi_attribute set name=?, is_calculate=?,is_validate_number=?  where kpi_attribute_id=? ",
            tmp.getName(),
            isCheckFlage,
            isCheckFlage2,
            tmp.getAcademicKPIAtributeId());
      }
    }
  }
 @Override
 public boolean isAttributeExistCreate(AcademicKPIAttribute academicKPIAttribute) {
   boolean returnValue = false;
   try {
     String sqltmp =
         "select count(*) as totalItem  from academic_kpi_attribute t  where t.name='"
             + StringEscapeUtils.escapeSql(academicKPIAttribute.getName())
             + "'  and t.academic_kpi_code="
             + academicKPIAttribute.getAcademicKPICode()
             + " and t.academic_year='"
             + academicKPIAttribute.getAcademicYear()
             + "'";
     Long found = this.jdbcTemplate.queryForLong(sqltmp);
     if (found != null && found.intValue() > 0) {
       returnValue = true;
     }
   } catch (Exception ex) {
     ex.printStackTrace();
   }
   return returnValue;
 }