INSERT INTO teacher
(id_,organ_id_,job_type_,job_nature_,is_probation_period_,education_background_,graduate_school_,technical_titles_,work_unit_,subject_id_,entry_date_,demission_date_,formal_staff_date_,certificate_type_,certificate_num_,flow_organ_range_,introduction_,update_time_,create_time_,is_support_course_schedule_rewards_rules_,idcard_front_img_,idcard_back_img_,idcard_hand_img_,memo_,is_settlement_salary_)
VALUES(#{id},#{organId},#{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{jobNature},#{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{educationBackground},#{graduateSchool},#{technicalTitles},#{workUnit},#{subjectId},#{entryDate},#{demissionDate},#{formalStaffDate},#{certificateType},#{certificateNum},#{flowOrganRange},#{introduction},now(),now(),#{isSupportCourseScheduleRewardsRules},#{idcardFrontImg},#{idcardBackImg},#{idcardHandImg},#{memo},#{isSettlementSalary})
INSERT INTO sys_user
(im_token_,id_,username_,salt_,phone_,avatar_,organ_id_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,gender_,nation_,birthdate_,email_,id_card_no_,wechat_id_,real_name_,password_)
VALUES(#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},#{organId},now(),now(),#{wxOpenid},#{qqOpenid},#{userType},
#{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{wechatId},#{realName},#{password})
UPDATE teacher
lecture_num_ = #{lectureNum},
graduate_school_ = #{graduateSchool},
subject_id_ = #{subjectId},
organ_id_ = #{organId},
technical_titles_ = #{technicalTitles},
entry_date_ = #{entryDate},
job_type_ = #{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
flow_organ_range_ = #{flowOrganRange},
certificate_type_ = #{certificateType},
job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
is_probation_period_ = #{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
update_time_ = NOW(),
education_background_ = #{educationBackground},
certificate_num_ = #{certificateNum},
work_unit_ = #{workUnit},
introduction_ = #{introduction},
is_support_course_schedule_rewards_rules_ = #{isSupportCourseScheduleRewardsRules},
is_support_extra_practice_lesson_ = #{isSupportExtraPracticeLesson},
idcard_front_img_ = #{idcardFrontImg},
idcard_back_img_ = #{idcardBackImg},
idcard_hand_img_ = #{idcardHandImg},
is_settlement_salary_ = #{isSettlementSalary},
WHERE id_ = #{id}
UPDATE teacher
lecture_num_ = #{lectureNum},
memo_ = #{memo},
graduate_school_ = #{graduateSchool},
subject_id_ = #{subjectId},
organ_id_ = #{organId},
technical_titles_ = #{technicalTitles},
entry_date_ = #{entryDate},
demission_date_ = #{demissionDate},
formal_staff_date_ = #{formalStaffDate},
job_type_ = #{jobType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
flow_organ_range_ = #{flowOrganRange},
certificate_type_ = #{certificateType},
job_nature_ = #{jobNature,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
is_probation_period_ = #{isProbationPeriod,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
update_time_ = NOW(),
education_background_ = #{educationBackground},
certificate_num_ = #{certificateNum},
work_unit_ = #{workUnit},
introduction_ = #{introduction},
is_support_course_schedule_rewards_rules_ = #{isSupportCourseScheduleRewardsRules},
is_support_extra_practice_lesson_ = #{isSupportExtraPracticeLesson},
idcard_front_img_ = #{idcardFrontImg},
idcard_back_img_ = #{idcardBackImg},
idcard_hand_img_ = #{idcardHandImg},
is_settlement_salary_ = #{isSettlementSalary},
WHERE id_ = #{id}
DELETE FROM teacher WHERE id_ = #{id}
UPDATE sys_user
del_flag_ = #{delFlag, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
wx_openid_ = #{wxOpenid},
password_ = #{password},
avatar_ = #{avatar},
email_ = #{email},
gender_ = #{gender},
salt_ = #{salt},
username_ = #{username},
real_name_ = #{realName},
user_type_ = #{userType},
update_time_ = NOW(),
lock_flag_ = #{lockFlag},
birthdate_ = #{birthdate},
phone_ = #{phone},
qq_openid_ = #{qqOpenid},
nation_ = #{nation},
organ_id_ = #{organId},
im_token_ = #{imToken},
WHERE id_ = #{id}
su.del_flag_ = 0
AND (CONCAT(',',t.organ_id_,',',IFNULL(t.flow_organ_range_,''),',') REGEXP CONCAT(',(',replace(#{organId},',','|'),'),'))
AND FIND_IN_SET(#{subjectId},t.subject_id_)
AND t.job_nature_ = #{jobNature}
AND t.is_probation_period_ = #{isProbationPeriod}
AND t.is_support_extra_practice_lesson_ = #{isSupportExtraPracticeLesson}
AND su.lock_flag_ = #{lockFlag}
AND t.id_ IN
#{item}
AND t.is_settlement_salary_ = #{isSettlementSalary}
AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%') OR t.id_ = #{search})
CONCAT(cs.class_date_,' ',cs.start_class_time_) < NOW() AND cgtm.teacher_role_ = 'BISHOP'
AND cs.class_date_ >= #{startTime}
AND cs.class_date_ <= #{endTime}
AND ta.music_group_id_ = #{musicGroupId}
AND su.real_name_ LIKE CONCAT('%',#{teacherName},'%')
sr.music_group_id_ = #{musicGroupId} AND sr.music_group_status_ != 'QUIT'
AND sr.actual_subject_id_ = #{subjectId}
AND sr.payment_status_ = #{paymentStatus}
CONCAT(cs.class_date_,' ',cs.start_class_time_) < NOW()
AND csts.user_id_ = #{teacherId}
AND cs.class_date_ >= #{courseStartDate}
AND cs.class_date_ <= #{courseEndDate}
AND cs.type_ = #{courseScheduleType}
AND csts.teacher_role_ = #{teacherRole}
AND ta.sign_in_status_ = #{signInStatus}
AND ta.sign_out_status_ = #{signOutStatus}
AND ta.sign_out_status_ IS NULL
AND ta.sign_in_status_ IS NULL
AND FIND_IN_SET(t.organ_id_,#{organId})
AND (CONCAT(',',t.organ_id_,',',IFNULL(t.flow_organ_range_,''),',') REGEXP CONCAT(',(',replace(#{organId},',','|'),'),'))
AND INTE_ARRAY(t.subject_id_,#{subjectIds})
AND t.job_nature_ = #{jobNature}
AND t.id_ = #{teacherId}
AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
cs.del_flag_=0 AND csts.group_type_='MUSIC' AND mg.del_flag_=0 AND mg.status_='PROGRESS'
AND csts.user_id_=#{teacherId}
AND mg.name_ LIKE CONCAT('%', #{search}, '%')
su.del_flag_=0 AND su.lock_flag_=0
AND tea.organ_id_ = #{organId}