【修改】 软件环境根据试卷方案自动获取
This commit is contained in:
@@ -5,36 +5,48 @@
|
||||
<mapper namespace="pc.exam.pp.module.exam.dal.mysql.paper.EducationPaperSchemeMapper">
|
||||
|
||||
<resultMap type="EducationPaperScheme" id="EducationPaperSchemeResult">
|
||||
<result property="schemeId" column="scheme_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="quTitle" column="qu_title" />
|
||||
<result property="spName" column="sp_name" />
|
||||
<result property="quLevel" column="qu_level" />
|
||||
<result property="keywords" column="keywords" />
|
||||
<result property="pointNames" column="point_names" />
|
||||
<result property="quNumbers" column="qu_numbers" />
|
||||
<result property="quScores" column="qu_scores" />
|
||||
<result property="subtotalScore" column="subtotal_score" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="schemeId" column="scheme_id"/>
|
||||
<result property="taskId" column="task_id"/>
|
||||
<result property="quTitle" column="qu_title"/>
|
||||
<result property="spName" column="sp_name"/>
|
||||
<result property="quLevel" column="qu_level"/>
|
||||
<result property="keywords" column="keywords"/>
|
||||
<result property="pointNames" column="point_names"/>
|
||||
<result property="quNumbers" column="qu_numbers"/>
|
||||
<result property="quScores" column="qu_scores"/>
|
||||
<result property="subtotalScore" column="subtotal_score"/>
|
||||
<result property="sort" column="sort"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEducationPaperSchemeVo">
|
||||
select scheme_id, task_id,qu_title,sp_name, qu_level, keywords, point_names, qu_numbers, qu_scores, subtotal_score,sort from education_paper_scheme
|
||||
select scheme_id,
|
||||
task_id,
|
||||
qu_title,
|
||||
sp_name,
|
||||
qu_level,
|
||||
keywords,
|
||||
point_names,
|
||||
qu_numbers,
|
||||
qu_scores,
|
||||
subtotal_score,
|
||||
sort
|
||||
from education_paper_scheme
|
||||
</sql>
|
||||
|
||||
<select id="selectEducationPaperSchemeList" parameterType="EducationPaperScheme" resultMap="EducationPaperSchemeResult">
|
||||
<select id="selectEducationPaperSchemeList" parameterType="EducationPaperScheme"
|
||||
resultMap="EducationPaperSchemeResult">
|
||||
<include refid="selectEducationPaperSchemeVo"/>
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="spName != null and spName != ''"> and sp_name like concat('%', #{spName}, '%')</if>
|
||||
<if test="quLevel != null and quLevel != ''"> and qu_level = #{quLevel}</if>
|
||||
<if test="keywords != null and keywords != ''"> and keywords = #{keywords}</if>
|
||||
<if test="pointNames != null and pointNames != ''"> and point_names = #{pointNames}</if>
|
||||
<if test="quNumbers != null and quNumbers != ''"> and qu_numbers = #{quNumbers}</if>
|
||||
<if test="quScores != null and quScores != ''"> and qu_scores = #{quScores}</if>
|
||||
<if test="subtotalScore != null and subtotalScore != ''"> and subtotal_score = #{subtotalScore}</if>
|
||||
<if test="taskId != null and taskId != ''">and task_id = #{taskId}</if>
|
||||
<if test="spName != null and spName != ''">and sp_name like concat('%', #{spName}, '%')</if>
|
||||
<if test="quLevel != null and quLevel != ''">and qu_level = #{quLevel}</if>
|
||||
<if test="keywords != null and keywords != ''">and keywords = #{keywords}</if>
|
||||
<if test="pointNames != null and pointNames != ''">and point_names = #{pointNames}</if>
|
||||
<if test="quNumbers != null and quNumbers != ''">and qu_numbers = #{quNumbers}</if>
|
||||
<if test="quScores != null and quScores != ''">and qu_scores = #{quScores}</if>
|
||||
<if test="subtotalScore != null and subtotalScore != ''">and subtotal_score = #{subtotalScore}</if>
|
||||
</where>
|
||||
order by sort asc
|
||||
order by sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectEducationPaperSchemeBySchemeId" parameterType="String" resultMap="EducationPaperSchemeResult">
|
||||
@@ -42,10 +54,16 @@
|
||||
where scheme_id = #{schemeId}
|
||||
</select>
|
||||
<select id="selectEducationPaperTaskByTaskId" resultMap="EducationPaperSchemeResult">
|
||||
select * from education_paper_scheme where task_id =#{taskid} order by sort asc
|
||||
select *
|
||||
from education_paper_scheme
|
||||
where task_id = #{taskid}
|
||||
order by sort asc
|
||||
</select>
|
||||
|
||||
<select id="selectEducationPaperSchemeCountsByTaskId" resultType="java.lang.Integer">
|
||||
select count(*) from education_paper_scheme where task_id =#{taskId}
|
||||
select count(*)
|
||||
from education_paper_scheme
|
||||
where task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
<insert id="insertEducationPaperScheme" parameterType="EducationPaperScheme">
|
||||
@@ -78,10 +96,12 @@
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertEducationPaperSchemeList">
|
||||
INSERT INTO education_paper_scheme (scheme_id, task_id, qu_title,sp_name, qu_level, keywords, point_names, qu_numbers, qu_scores, subtotal_score,sort) VALUES
|
||||
INSERT INTO education_paper_scheme (scheme_id, task_id, qu_title,sp_name, qu_level, keywords, point_names,
|
||||
qu_numbers, qu_scores, subtotal_score,sort) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(
|
||||
#{item.schemeId}, #{item.taskId}, #{item.quTitle},#{item.spName}, #{item.quLevel}, #{item.keywords}, #{item.pointNames}, #{item.quNumbers}, #{item.quScores}, #{item.subtotalScore}, #{item.sort}
|
||||
#{item.schemeId}, #{item.taskId}, #{item.quTitle},#{item.spName}, #{item.quLevel}, #{item.keywords},
|
||||
#{item.pointNames}, #{item.quNumbers}, #{item.quScores}, #{item.subtotalScore}, #{item.sort}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
@@ -95,7 +115,9 @@
|
||||
</update>
|
||||
|
||||
<delete id="deleteEducationPaperSchemeBySchemeId" parameterType="String">
|
||||
delete from education_paper_scheme where scheme_id = #{schemeId}
|
||||
delete
|
||||
from education_paper_scheme
|
||||
where scheme_id = #{schemeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEducationPaperSchemeBySchemeIds" parameterType="String">
|
||||
|
@@ -1,49 +1,69 @@
|
||||
<?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">
|
||||
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.specialty.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" />
|
||||
<result property="roles" column="roles" />
|
||||
<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"/>
|
||||
<result property="roles" column="roles"/>
|
||||
</resultMap>
|
||||
|
||||
<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" />
|
||||
<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="selectExamSpecialtyVo">
|
||||
select sp_id, parent_id, ancestors, sp_name, order_num, status, creator, create_time, updater, update_time, unite, tree_num, roles,tenant_id from exam_specialty
|
||||
select sp_id,
|
||||
parent_id,
|
||||
ancestors,
|
||||
sp_name,
|
||||
order_num,
|
||||
status,
|
||||
creator,
|
||||
create_time,
|
||||
updater,
|
||||
update_time,
|
||||
unite,
|
||||
tree_num,
|
||||
roles,
|
||||
tenant_id
|
||||
from exam_specialty
|
||||
</sql>
|
||||
|
||||
<select id="selectExamSpecialtyListVo" resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
|
||||
<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,roles 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>
|
||||
<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="selectExamSpecialtyAll" 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 deleted = 0 and status = 0
|
||||
<select id="selectExamSpecialtyAll"
|
||||
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 deleted = 0
|
||||
and status = 0
|
||||
</select>
|
||||
|
||||
<select id="selectExamSpecialtyByids" resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
|
||||
SELECT sp_id AS id, sp_name AS name, ancestors, parent_id, status, create_time from exam_specialty
|
||||
<select id="selectExamSpecialtyByids"
|
||||
resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
|
||||
SELECT sp_id AS id, sp_name AS name, ancestors, parent_id, status, create_time from exam_specialty
|
||||
WHERE sp_id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
@@ -51,30 +71,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND deleted = 0 and status = 0
|
||||
</select>
|
||||
|
||||
<select id="selectExamSpecialtyPart" resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
|
||||
<select id="selectExamSpecialtyPart"
|
||||
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
|
||||
(
|
||||
LENGTH(ancestors) - LENGTH(REPLACE(ancestors, ',', ''))
|
||||
) + 1 <= 2 and status = 0 and deleted = 0
|
||||
WHERE (
|
||||
LENGTH(ancestors) - LENGTH(REPLACE(ancestors, ',', ''))
|
||||
) + 1 <= 2
|
||||
and status = 0
|
||||
and deleted = 0
|
||||
</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>
|
||||
<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>-->
|
||||
<!-- <if test="spId != null "> and sp_id = #{spId}</if>-->
|
||||
<!-- </where>-->
|
||||
where sp_id in
|
||||
<foreach item="spId" collection="array" open="(" separator="," close=")">
|
||||
#{spId}
|
||||
@@ -101,17 +123,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where sp_id = #{spId}
|
||||
</select>
|
||||
|
||||
<select id="selectExamSpecialtyByParentId" resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
|
||||
SELECT sp_id AS id, sp_name AS name, ancestors, parent_id, status, create_time from exam_specialty
|
||||
<select id="selectExamSpecialtyBySpName" parameterType="String" resultType="pc.exam.pp.module.exam.dal.dataobject.specialty.ExamSpecialty">
|
||||
SELECT *
|
||||
from exam_specialty
|
||||
where sp_name = #{spName}
|
||||
</select>
|
||||
|
||||
<select id="selectExamSpecialtyByParentId"
|
||||
resultType="pc.exam.pp.module.exam.controller.admin.specialty.vo.SpecialtyQueryVo">
|
||||
SELECT sp_id AS id, sp_name AS name, ancestors, parent_id, status, create_time
|
||||
from exam_specialty
|
||||
where parent_id = #{parentId}
|
||||
</select>
|
||||
<select id="getRoleById" resultType="java.lang.String">
|
||||
select roles
|
||||
from exam_specialty where sp_id =#{id};
|
||||
from exam_specialty
|
||||
where sp_id = #{id};
|
||||
</select>
|
||||
<select id="selectBySpecCourseSub" resultMap="ExamSpecialtyResult">
|
||||
SELECT
|
||||
q3.*
|
||||
SELECT q3.*
|
||||
FROM exam_specialty q1
|
||||
JOIN exam_specialty q2 ON q2.parent_id = q1.sp_id
|
||||
JOIN exam_specialty q3 ON q3.parent_id = q2.sp_id
|
||||
@@ -120,12 +150,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND q3.sp_name = #{subjectName}
|
||||
AND q1.deleted = '0'
|
||||
AND q2.deleted = '0'
|
||||
AND q3.deleted = '0'
|
||||
LIMIT 1;
|
||||
AND q3.deleted = '0' LIMIT 1;
|
||||
</select>
|
||||
<select id="selectByPointsSub" resultMap="KnowledgePointsResult">
|
||||
SELECT
|
||||
q3.*
|
||||
SELECT q3.*
|
||||
FROM exam_knowledge_points q1
|
||||
JOIN exam_knowledge_points q2 ON q2.parent_id = q1.sp_id
|
||||
JOIN exam_knowledge_points q3 ON q3.parent_id = q2.sp_id
|
||||
@@ -134,19 +162,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND q3.sp_name = #{pointNames}
|
||||
AND q1.deleted = '0'
|
||||
AND q2.deleted = '0'
|
||||
AND q3.deleted = '0'
|
||||
LIMIT 1;
|
||||
AND q3.deleted = '0' LIMIT 1;
|
||||
</select>
|
||||
<select id="selectAllSpecialtyRelations"
|
||||
resultType="pc.exam.pp.module.exam.service.monitor.vo.SpecialtyRelation">
|
||||
SELECT sp_id AS spId, parent_id AS parentId
|
||||
FROM exam_specialty
|
||||
SELECT sp_id AS spId, parent_id AS parentId
|
||||
FROM exam_specialty
|
||||
|
||||
</select>
|
||||
<select id="selectAllIdToParent" resultType="pc.exam.pp.module.exam.service.monitor.vo.IdParentPair">
|
||||
SELECT sp_id AS spId, parent_id AS parentId
|
||||
FROM exam_specialty
|
||||
WHERE deleted = '0' and status ='0' and tenant_id =#{loginTenantId}
|
||||
SELECT sp_id AS spId, parent_id AS parentId
|
||||
FROM exam_specialty
|
||||
WHERE deleted = '0'
|
||||
and status = '0'
|
||||
and tenant_id = #{loginTenantId}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -155,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
deleted = 1
|
||||
</trim>
|
||||
where sp_id = #{spId}
|
||||
where sp_id = #{spId}
|
||||
</update>
|
||||
|
||||
<update id="deleteExamSpecialtyBySpIds" parameterType="String">
|
||||
@@ -163,7 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
deleted = 1
|
||||
</trim>
|
||||
where sp_id in
|
||||
where sp_id in
|
||||
<foreach item="spId" collection="array" open="(" separator="," close=")">
|
||||
#{spId}
|
||||
</foreach>
|
||||
|
Reference in New Issue
Block a user