课程、文章审核
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
<result column="duration" property="duration" jdbcType="INTEGER"/>
|
||||
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
|
||||
<result column="is_required" property="isRequired" jdbcType="INTEGER"/>
|
||||
<result column="is_audited" property="isAudited" jdbcType="BOOLEAN"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
@@ -46,7 +47,7 @@
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, node_id, chapter_id, name, content, node_type, resource_id, video_url, duration, order_num, is_required,
|
||||
id, node_id, chapter_id, name, content, node_type, resource_id, video_url, duration, order_num, is_required, is_audited,
|
||||
creator, updater, create_time, update_time, delete_time, deleted
|
||||
</sql>
|
||||
|
||||
@@ -98,6 +99,20 @@
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
<select id="selectByCourseId">
|
||||
SELECT
|
||||
tcn.id, tcn.node_id, tcn.chapter_id, tcn.name,
|
||||
tcn.content, tcn.node_type, tcn.resource_id, tcn.video_url, tcn.duration,
|
||||
tcn.order_num, tcn.is_required, tcn.is_audited, tcn.creator, tcn.updater,
|
||||
tcn.create_time, tcn.update_time, tcn.delete_time, tcn.deleted
|
||||
FROM tb_course_node tcn
|
||||
LEFT JOIN tb_course_chapter tcc ON tcc.chapter_id = tcn.chapter_id
|
||||
LEFT JOIN tb_course tc ON tcc.course_id = tc.course_id
|
||||
WHERE tc.course_id=#{courseId} AND tcn.deleted = 0
|
||||
ORDER BY order_num ASC, create_time ASC
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 根据节点名称查询节点 -->
|
||||
<select id="selectByName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
@@ -149,47 +164,48 @@
|
||||
<update id="updateCourseNode" parameterType="org.xyzh.common.dto.study.TbCourseNode">
|
||||
UPDATE tb_course_node
|
||||
<set>
|
||||
is_audited = 0
|
||||
<if test="chapterID != null and chapterID != ''">
|
||||
chapter_id = #{chapterID},
|
||||
,chapter_id = #{chapterID}
|
||||
</if>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
,name = #{name}
|
||||
</if>
|
||||
<if test="content != null and content != ''">
|
||||
content = #{content},
|
||||
,content = #{content}
|
||||
</if>
|
||||
<if test="nodeType != null">
|
||||
node_type = #{nodeType},
|
||||
,node_type = #{nodeType}
|
||||
</if>
|
||||
<if test="resourceID != null">
|
||||
resource_id = #{resourceID},
|
||||
,resource_id = #{resourceID}
|
||||
</if>
|
||||
<if test="videoUrl != null and videoUrl != ''">
|
||||
video_url = #{videoUrl},
|
||||
,video_url = #{videoUrl}
|
||||
</if>
|
||||
<if test="duration != null">
|
||||
duration = #{duration},
|
||||
,duration = #{duration}
|
||||
</if>
|
||||
<if test="orderNum != null">
|
||||
order_num = #{orderNum},
|
||||
,order_num = #{orderNum}
|
||||
</if>
|
||||
<if test="isRequired != null">
|
||||
is_required = #{isRequired},
|
||||
,is_required = #{isRequired}
|
||||
</if>
|
||||
<if test="updater != null and updater != ''">
|
||||
updater = #{updater},
|
||||
,updater = #{updater}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
,update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="deleteTime != null">
|
||||
delete_time = #{deleteTime},
|
||||
,delete_time = #{deleteTime}
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
,deleted = #{deleted}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
WHERE node_id = #{nodeID}
|
||||
</update>
|
||||
|
||||
<!-- 删除学习节点 -->
|
||||
@@ -222,6 +238,15 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- batchUpdateNodeAudited -->
|
||||
<update id="batchUpdateNodeAudited">
|
||||
<foreach collection="courseNodeList" item="item" separator=";">
|
||||
UPDATE tb_course_node
|
||||
SET is_audited = #{item.isAudited}
|
||||
WHERE node_id = #{item.nodeID}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<!-- 根据章节ID批量删除节点 -->
|
||||
<delete id="deleteByChapterId">
|
||||
DELETE FROM tb_course_node
|
||||
|
||||
Reference in New Issue
Block a user