【修改】 软件环境根据试卷方案自动获取
This commit is contained in:
@@ -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