select id,
user_id,
create_by,
update_by,
dept_id,
dept_name,
create_time,
update_time,
remark,
course_id,
title,
parent_id,
position,
resources_id,
chapter_data,
description,
free,
type,
allowdownload,
duration,
is_assess,
assess_name
from el_course_chapter
select t.id,
t.user_id,
t.create_by,
t.update_by,
t.dept_id,
t.dept_name,
t.create_time,
t.update_time,
t.remark,
t.course_id,
t.title,
t.parent_id,
t.position,
t.resources_id,
t.chapter_data,
t.description,
t.free,
ifnull(r.type, t.type) type,
t.allowdownload,
t.duration,
r.postfix,
t.is_assess,
t.assess_name
from el_course_chapter as t
left join el_resources r on t.resources_id = r.id
insert into el_course_chapter
user_id,
create_by,
update_by,
dept_id,
dept_name,
create_time,
update_time,
remark,
course_id,
title,
parent_id,
position,
resources_id,
chapter_data,
description,
free,
type,
allowdownload,
duration,
is_assess,
assess_name,
#{userId},
#{createBy},
#{updateBy},
#{deptId},
#{deptName},
#{createTime},
#{updateTime},
#{remark},
#{courseId},
#{title},
#{parentId},
#{position},
#{resourcesId},
#{chapterData},
#{description},
#{free},
#{type},
#{allowdownload},
#{duration},
#{isAssess},
#{assessName},
update el_course_chapter
user_id = #{userId},
create_by = #{createBy},
update_by = #{updateBy},
dept_id = #{deptId},
dept_name = #{deptName},
create_time = #{createTime},
update_time = #{updateTime},
remark = #{remark},
course_id = #{courseId},
title = #{title},
parent_id = #{parentId},
position = #{position},
resources_id = #{resourcesId},
chapter_data = #{chapterData},
description = #{description},
free = #{free},
type = #{type},
allowdownload = #{allowdownload},
duration = #{duration},
is_assess = #{isAssess},
assess_name = #{assessName},
where id = #{id}
delete
from el_course_chapter
where id = #{id}
delete from el_course_chapter where id in
#{id}