【新增】专业-课程-题型功能迁移,知识点半迁移没有调试

This commit is contained in:
任维炳
2025-04-21 15:33:19 +08:00
parent e58a23079c
commit 09afc46c92
21 changed files with 1272 additions and 1 deletions

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pc.exam.pp.module.exam.dal.mysql.ExamKnowledgePointsMapper">
<resultMap type="ExamKnowledgePoints" id="KnowledgePointsResult">
<result property="spId" column="sp_id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="spName" column="sp_name" />
<result property="orderNum" column="order_num" />
<result property="status" column="status" />
<result property="treeNum" column="tree_num" />
</resultMap>
<sql id="selectKnowledgePointsVo">
select sp_id, parent_id, ancestors, sp_name, order_num, status, creator, create_time, updater, update_time, tree_num, tenant_id from exam_knowledge_points
</sql>
<select id="selectKnowledgePointsList" parameterType="ExamKnowledgePoints" resultMap="KnowledgePointsResult">
<include refid="selectKnowledgePointsVo"/>
<where>
<if test="knowledgePoints.parentId != null "> and parent_id = #{knowledgePoints.parentId}</if>
<if test="knowledgePoints.ancestors != null and knowledgePoints.ancestors != ''"> and ancestors = #{knowledgePoints.ancestors}</if>
<if test="knowledgePoints.spName != null and knowledgePoints.spName != ''"> and sp_name like concat('%', #{knowledgePoints.spName}, '%')</if>
<if test="knowledgePoints.orderNum != null "> and order_num = #{knowledgePoints.orderNum}</if>
<if test="knowledgePoints.status != null and knowledgePoints.status != ''"> and status = #{knowledgePoints.status}</if>
and deleted = 0
</where>
</select>
<select id="selectKnowledgePointsBySpId" parameterType="Long" resultMap="KnowledgePointsResult">
<include refid="selectKnowledgePointsVo"/>
where sp_id = #{spId}
</select>
<update id="deleteKnowledgePointsBySpId" parameterType="Long">
update exam_knowledge_points
<trim prefix="SET" suffixOverrides=",">
deleted = 1
</trim>
where sp_id = #{spId}
</update>
<update id="deleteKnowledgePointsBySpIds" parameterType="String">
-- delete from knowledge_points
update exam_knowledge_points
<trim prefix="SET" suffixOverrides=",">
deleted = 1
</trim>
where sp_id in
<foreach item="spId" collection="array" open="(" separator="," close=")">
#{spId}
</foreach>
</update>
</mapper>

View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pc.exam.pp.module.exam.dal.mysql.ExamSpecialtyMapper">
<resultMap type="ExamSpecialty" id="ExamSpecialtyResult">
<result property="spId" column="sp_id" />
<result property="parentId" column="parent_id" />
<result property="ancestors" column="ancestors" />
<result property="spName" column="sp_name" />
<result property="orderNum" column="order_num" />
<result property="status" column="status" />
<result property="unite" column="unite" />
<result property="treeNum" column="tree_num" />
</resultMap>
<sql id="selectExamSpecialtyVo">
select sp_id, parent_id, ancestors, sp_name, order_num, status, creator, create_time, updater, update_time, unite, tree_num, tenant_id from exam_specialty
</sql>
<select id="selectExamSpecialtyListVo" resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
select sp_id as id, sp_name as name, parent_id, status, create_time from exam_specialty
<where>
<if test="name != null and name != ''"> and sp_name like concat('%', #{name}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
and deleted = 0
</where>
</select>
<select id="selectExamSpecialtyList" resultType="ExamSpecialty">
<include refid="selectExamSpecialtyVo"/>
<where>
<if test="name != null and name != ''"> and sp_name like concat('%', #{name}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
and deleted = 0
</where>
</select>
<select id="selectSpIds" parameterType="ExamSpecialty" resultMap="ExamSpecialtyResult">
<include refid="selectExamSpecialtyVo"/>
<!-- <where>-->
<!-- <if test="spId != null "> and sp_id = #{spId}</if>-->
<!-- </where>-->
where sp_id in
<foreach item="spId" collection="array" open="(" separator="," close=")">
#{spId}
</foreach>
</select>
<update id="updateExamSpecialty" parameterType="ExamSpecialty">
update exam_specialty
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="ancestors != null">ancestors = #{ancestors},</if>
<if test="spName != null">sp_name = #{spName},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="status != null">status = #{status},</if>
<if test="unite != null">unite = #{unite},</if>
<if test="treeNum != null">tree_num = #{treeNum},</if>
</trim>
where sp_id = #{spId}
</update>
<select id="selectExamSpecialtyBySpId" parameterType="Long" resultMap="ExamSpecialtyResult">
<include refid="selectExamSpecialtyVo"/>
where sp_id = #{spId}
</select>
<update id="deleteExamSpecialtyBySpId" parameterType="Long">
update exam_specialty
<trim prefix="SET" suffixOverrides=",">
deleted = 1
</trim>
where sp_id = #{spId}
</update>
<update id="deleteExamSpecialtyBySpIds" parameterType="String">
update exam_specialty
<trim prefix="SET" suffixOverrides=",">
deleted = 1
</trim>
where sp_id in
<foreach item="spId" collection="array" open="(" separator="," close=")">
#{spId}
</foreach>
</update>
</mapper>