From 05d651ca0168025ec451702f1df88dab4f2a9559 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期五, 10 五月 2024 17:58:19 +0800
Subject: [PATCH] feat:新增补考按钮
---
src/main/resources/mapper/SubjectMapper.xml | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 51 insertions(+), 6 deletions(-)
diff --git a/src/main/resources/mapper/SubjectMapper.xml b/src/main/resources/mapper/SubjectMapper.xml
index 9f40fea..965f9c1 100644
--- a/src/main/resources/mapper/SubjectMapper.xml
+++ b/src/main/resources/mapper/SubjectMapper.xml
@@ -13,20 +13,20 @@
id, name, level, level_name, item_order, deleted
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
+ select
<include refid="Base_Column_List" />
from t_subject
- where id = #{id,jdbcType=INTEGER}
+ where id = #{id,jdbcType=INTEGER} and deleted = 0
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from t_subject
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.mindskip.xzs.domain.Subject" useGeneratedKeys="true" keyProperty="id">
- insert into t_subject (id, name, level,
+ insert into t_subject (id, name, level,
level_name, item_order, deleted
)
- values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
+ values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
#{levelName,jdbcType=VARCHAR}, #{itemOrder,jdbcType=INTEGER}, #{deleted,jdbcType=BIT}
)
</insert>
@@ -108,7 +108,7 @@
<select id="getSubjectByLevel" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
- from t_subject where level= #{level}
+ from t_subject where level= #{level} and deleted = 0
order by item_order
</select>
@@ -116,7 +116,7 @@
<select id="allSubject" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
- from t_subject
+ from t_subject where deleted = 0
</select>
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.education.SubjectPageRequestVM">
@@ -131,7 +131,52 @@
<if test="level != null ">
and level= #{level}
</if>
+ <if test="name != null ">
+ and name like concat('%',#{name},'%')
+ </if>
</where>
</select>
+ <select id="getName" resultMap="BaseResultMap">
+ SELECT
+ <include refid="Base_Column_List"/>
+ FROM t_subject
+ where name = #{name} and deleted = 0
+ </select>
+
+ <select id="getNames" resultMap="BaseResultMap">
+ SELECT
+ <include refid="Base_Column_List"/>
+ FROM t_subject
+ where name in
+ <foreach item="name" collection="names" open="(" separator=","
+ close=")">
+ #{name}
+ </foreach>
+ and deleted = 0
+
+ </select>
+
+ <select id="selectByIds" resultMap="BaseResultMap">
+ select
+ <include refid="Base_Column_List" />
+ from t_subject
+ where id in
+ <foreach item="id" collection="ids" open="(" separator=","
+ close=")">
+ #{id}
+ </foreach>
+ and deleted = 0
+ </select>
+
+ <select id="selectSubjectName" resultType="string">
+ SELECT
+ name
+ FROM
+ t_subject
+ WHERE
+ id IN <foreach collection="ids" open="(" separator="," close=")" item="id">#{id}</foreach>
+ </select>
+
+
</mapper>
--
Gitblit v1.8.0