From 8458e64aab474c0fc2f49ae4ff22fb11ce5cf6e2 Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: Mon, 11 Nov 2024 16:55:28 +0800
Subject: [PATCH] 批次新增学员查询条件,新增题目导入接口
---
exam-system/src/main/resources/mapper/system/ExCourseChapterMapper.xml | 53 +++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/exam-system/src/main/resources/mapper/system/ExCourseChapterMapper.xml b/exam-system/src/main/resources/mapper/system/ExCourseChapterMapper.xml
index 69815db..8ebafa9 100644
--- a/exam-system/src/main/resources/mapper/system/ExCourseChapterMapper.xml
+++ b/exam-system/src/main/resources/mapper/system/ExCourseChapterMapper.xml
@@ -14,18 +14,45 @@
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
- <collection property="chapterPeriods" ofType="com.gkhy.exam.system.domain.ExCourseChapterPeriod" select="getChapterPeriodById" column="{chapterId=id}"/>
+ <collection property="chapterPeriods" ofType="com.gkhy.exam.system.domain.ExCourseChapterPeriod" select="getChapterPeriodByChapterId" column="{chapterId=id,status=filterStatus}"/>
+ </resultMap>
+
+ <resultMap type="com.gkhy.exam.system.domain.ExCourseChapterPeriod" id="ExPeriodResult">
+ <result property="id" column="id" />
+ <result property="name" column="name" />
+ <result property="courseId" column="course_id" />
+ <result property="chapterId" column="chapter_id" />
+ <result property="status" column="status" />
+ <result property="companyId" column="company_id" />
+ <result property="resourceId" column="resource_id" />
+ <result property="period" column="period" />
+ <result property="sort" column="sort" />
+ <result property="version" column="version" />
+ <result property="createBy" column="create_by" />
+ <result property="createTime" column="create_time" />
+ <result property="updateBy" column="update_by" />
+ <result property="updateTime" column="update_time" />
+ <result property="remark" column="remark" />
+ <association property="resource" javaType="com.gkhy.exam.system.domain.ExResource" resultMap="ExResourceResult" />
+ </resultMap>
+
+ <resultMap type="com.gkhy.exam.system.domain.ExResource" id="ExResourceResult">
+ <result property="id" column="resource_id" />
+ <result property="name" column="resource_name" />
+ <result property="resourcePath" column="resource_path" />
+ <result property="resourceType" column="resource_type" />
+ <result property="resourceLength" column="period" />
+ <result property="docPage" column="doc_page" />
</resultMap>
<sql id="selectChapterVo">
- select a.id, a.name, a.course_id, a.status,a.company_id, a.sort,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
- b.id as period_id,a.id as chapter_id,b.name as period_name,b.resource_id
+ select a.id, a.name, a.course_id, a.status,a.company_id, a.sort,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark
from ex_course_chapter a
- left join ex_course_chapter_period b on b.chapter_id=a.id
</sql>
<select id="selectChapterList" resultMap="ExChapterResult">
- <include refid="selectChapterVo"/>
+ select a.id, a.name, a.course_id, a.status,a.company_id, a.sort,a.version, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,#{status} as filterStatus
+ from ex_course_chapter a
<where>
and a.course_id=#{courseId}
<if test="name != null and name != ''">
@@ -49,7 +76,10 @@
<select id="selectChapterByCourseId" resultMap="ExChapterResult">
- select * from ex_course_chapter where course_id=#{courseId}
+ select *,#{status} as filterStatus from ex_course_chapter where course_id=#{courseId}
+ <if test="status!=null">
+ and status=#{status}
+ </if>
order by sort asc,id desc
</select>
@@ -57,8 +87,15 @@
select count(1) from ex_course_chapter where course_id=#{courseId}
</select>
- <select id="getChapterPeriodById" resultType="com.gkhy.exam.system.domain.ExCourseChapterPeriod">
- select * from ex_course_chapter_period where chapter_id=#{chapterId}
+ <select id="getChapterPeriodByChapterId" resultMap="ExPeriodResult">
+ select a.id,a.name,a.course_id,a.chapter_id,a.status,a.company_id,a.resource_id,a.sort,
+ b.resource_length as period,b.name as resource_name,b.resource_path,b.doc_page,b.resource_type from ex_course_chapter_period a
+ left join ex_resource b on b.id=a.resource_id
+ where a.chapter_id=#{chapterId}
+ <if test="status!=null">
+ a.status=#{status}
+ </if>
+ order by a.sort asc,a.id desc
</select>
<select id="selectPeriodCountById" resultType="java.lang.Integer">
--
Gitblit v1.9.2