Merge branch refs/heads/master into refs/heads/hyc
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?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.classs.ClassMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
<select id="getClassName" resultType="pc.exam.pp.module.exam.controller.admin.classs.vo.ClassNameReturnVO">
|
||||
select name as className from exam_class
|
||||
</select>
|
||||
|
||||
<select id="getClassIdName" resultType="pc.exam.pp.module.exam.controller.admin.classs.vo.ClassDoReturnVO">
|
||||
select id, name from exam_class
|
||||
</select>
|
||||
|
||||
<select id="getClassNameOne" resultType="pc.exam.pp.module.exam.dal.dataobject.classs.ClassDO">
|
||||
select * from exam_class where name = #{className}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -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.knowledge.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>
|
||||
@@ -0,0 +1,100 @@
|
||||
<?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.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" />
|
||||
</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="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
|
||||
</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>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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.student.StudentClassMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?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.student.StudentMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
<select id="getBindingStudents" resultType="pc.exam.pp.module.exam.dal.dataobject.student.StudentDO">
|
||||
SELECT *
|
||||
FROM exam_student
|
||||
WHERE id NOT IN (
|
||||
SELECT student_id FROM exam_student_class
|
||||
)
|
||||
AND deleted = 0;
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user