INSERT INTO examination_basic (id_,name_,exam_mode_,exam_location_id_list_,exam_location_name_list_,status_,enroll_start_time_,enroll_end_time_, expect_exam_start_time_,expect_exam_end_time_,actual_exam_start_time_,actual_exam_end_time_, poster_title_,poster_profile_,poster_background_img_,custom_poster_,creator_id_,create_time_,update_time_,tenant_id_,memo_,organ_id_) VALUES(#{id},#{name},#{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examLocationIdList},#{examLocationNameList}, #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{enrollStartTime},#{enrollEndTime}, #{expectExamStartTime},#{expectExamEndTime},#{actualExamStartTime},#{actualExamEndTime}, #{posterTitle},#{posterProfile},#{posterBackgroundImg},#{customPoster},#{creatorId},NOW(),NOW(),#{tenantId},#{memo},#{organId}) UPDATE examination_basic name_ = #{name}, exam_mode_ = #{examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}, exam_location_id_list_ = #{examLocationIdList}, exam_location_name_list_ = #{examLocationNameList}, status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}, enroll_start_time_ = #{enrollStartTime}, enroll_end_time_ = #{enrollEndTime}, expect_exam_start_time_ = #{expectExamStartTime}, expect_exam_end_time_ = #{expectExamEndTime}, actual_exam_start_time_ = #{actualExamStartTime}, actual_exam_end_time_ = #{actualExamEndTime}, poster_title_ = #{posterTitle}, poster_profile_ = #{posterProfile}, poster_background_img_ = #{posterBackgroundImg}, custom_poster_ = #{customPoster}, tenant_id_ = #{tenantId}, memo_=#{memo}, creator_id_=#{creatorId}, update_time_ = NOW() WHERE id_ = #{id} UPDATE examination_basic name_ = #{exam.name}, exam_mode_ = #{exam.examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}, exam_location_id_list_ = #{exam.examLocationIdList}, exam_location_name_list_ = #{exam.examLocationNameList}, status_ = #{exam.status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}, enroll_start_time_ = #{exam.enrollStartTime}, enroll_end_time_ = #{exam.enrollEndTime}, expect_exam_start_time_ = #{exam.expectExamStartTime}, expect_exam_end_time_ = #{exam.expectExamEndTime}, actual_exam_start_time_ = #{exam.actualExamStartTime}, actual_exam_end_time_ = #{exam.actualExamEndTime}, poster_title_ = #{exam.posterTitle}, poster_profile_ = #{exam.posterProfile}, poster_background_img_ = #{exam.posterBackgroundImg}, custom_poster_ = #{exam.customPoster}, tenant_id_ = #{exam.tenantId}, memo_=#{exam.memo}, creator_id_=#{exam.creatorId}, update_time_ = NOW() WHERE id_ = #{exam.id} DELETE FROM examination_basic WHERE id_ = #{id} AND organ_id_ IN #{organId} AND status_=#{examStatus} AND (id_=#{search} OR name_ LIKE CONCAT('%', #{search}, '%')) eb.status_!='DELETE' AND (eor.organ_id_ = #{organId} OR eb.organ_id_ IN #{organId} ) AND eb.status_=#{examStatus} AND (eb.id_=#{search} OR eb.name_ LIKE CONCAT('%', #{search}, '%'))