INSERT INTO subject (id_,name_,code_,parent_subject_id_,img_,create_time_,update_time_,tenant_id_)
VALUES(#{id},#{name},#{code},#{parentSubjectId},#{img},now(),now(),#{tenantId})
UPDATE subject
del_flag_ = #{delFlag},
parent_subject_id_ = #{parentSubjectId},
code_ = #{code},
img_ = #{img},
update_time_ = NOW(),
name_ = #{name},
tenant_id_ = #{tenantId},
WHERE id_ = #{id}
UPDATE `subject` SET del_flag_ = 1 WHERE id_ = #{id} OR parent_subject_id_ = #{id}
AND s.tenant_id_ = #{tenantId}
AND s.parent_subject_id_ = #{parentId}
AND s.parent_subject_id_ != 0
AND s.del_flag_ = #{delFlag}