INSERT INTO exam_registration (id_,examination_basic_id_,student_id_,organ_id_,subject_id_,level_,song_json_,last_exam_level_,last_exam_certificate_url_,adviser_name_,adviser_phone_,card_no_,status_,memo_,create_time_,update_time_,tenant_id_)
VALUES(#{id},#{examinationBasicId},#{studentId},#{organId},#{subjectId},#{level},#{songJson},#{lastExamLevel},#{lastExamCertificateUrl},#{adviserName},#{adviserPhone},#{cardNo},#{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{memo},NOW(), NOW(),#{tenantId})
UPDATE exam_registration
examination_basic_id_ = #{examinationBasicId},
subject_id_ = #{subjectId},
adviser_phone_ = #{adviserPhone},
last_exam_level_ = #{lastExamLevel},
id_ = #{id},
tenant_id_ = #{tenantId},
level_ = #{level},
organ_id_ = #{organId},
song_json_ = #{songJson},
adviser_name_ = #{adviserName},
student_id_ = #{studentId},
last_exam_certificate_url_ = #{lastExamCertificateUrl},
card_no_ =#{cardNo},
status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
memo_ = #{memo}
update_time_ = NOW()
WHERE id_ = #{id}
DELETE FROM exam_registration WHERE id_ = #{id}
AND er.organ_id_ IN
#{organId}
AND er.examination_basic_id_ = #{examId}
AND er.organ_id_ = #{organId}
AND er.subject_id_ = #{subjectId}
AND er.level_ = #{level}
AND er.status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
er.student_id_ = #{studentId}
er.id_ = #{examRegistrationId}
er.tenant_id_ = #{tenantId}
er.status_ = #{status}