 drop view if EXISTS v_grade_class;
CREATE
VIEW `v_grade_class`AS
SELECT
       id, active,
       DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%S') as create_time,
       update_time,
       update_by,userid, name,
       trainId, trainName, perNum,
       DATE_FORMAT(practiceStartDate,'%Y-%m-%d %H:%i:%S') as practiceStartDate,
       DATE_FORMAT(practiceEndDate,'%Y-%m-%d %H:%i:%S') as practiceEndDate,
       startTime, endTime, approvalState,
       address,updateflag,approvalReson,approvalResonIn,gradeLevel,
       contactPerson,
       contactPersonTel,
       otherTel,
       contactPersonEmail,
       DATE_FORMAT(graduationStartTime,'%Y-%m-%d %H:%i:%S') as graduationStartTime,
       DATE_FORMAT(graduationEndTime,'%Y-%m-%d %H:%i:%S') as graduationEndTime,
       graduationStartAddress,
       graduationStartExamType,
       graduationStartExamPaper,
       DATE_FORMAT(graduationOperationStartTime,'%Y-%m-%d %H:%i:%S') as graduationOperationStartTime,
       DATE_FORMAT(graduationOperationEndTime,'%Y-%m-%d %H:%i:%S') as graduationOperationEndTime,
       graduationOperationAddress,
       DATE_FORMAT(appraisalStartTime,'%Y-%m-%d %H:%i:%S') as  appraisalStartTime,
       DATE_FORMAT(appraisalEndTime,'%Y-%m-%d %H:%i:%S') as  appraisalEndTime,
       appraisalAddress,
       DATE_FORMAT(appraisalOperationStartTime,'%Y-%m-%d %H:%i:%S') as  appraisalOperationStartTime,
       DATE_FORMAT(appraisalOperationEndTime,'%Y-%m-%d %H:%i:%S') as  appraisalOperationEndTime,
       appraisalOperationAddress,
       graduationQualified,
       graduationOperationQualified,
       appraisalQualified,
       appraisalOperationQualified,
       carefulMatter
from sb_grade_class
      WHERE
      active = TRUE