From 32ec64370ad5af7df86d59acdc134e697d936db2 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 23 九月 2024 20:41:11 +0800
Subject: [PATCH] 课目管理

---
 src/main/resources/mapper/SubjectMapper.xml |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/SubjectMapper.xml b/src/main/resources/mapper/SubjectMapper.xml
index e7d4ac5..7c75ea3 100644
--- a/src/main/resources/mapper/SubjectMapper.xml
+++ b/src/main/resources/mapper/SubjectMapper.xml
@@ -25,9 +25,9 @@
         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 (name, level,
                                level_name, item_order, deleted)
-        values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
+        values (#{name,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
                 #{levelName,jdbcType=VARCHAR}, #{itemOrder,jdbcType=INTEGER}, #{deleted,jdbcType=BIT})
     </insert>
     <insert id="insertSelective" parameterType="com.mindskip.xzs.domain.Subject" useGeneratedKeys="true"
@@ -135,6 +135,19 @@
         where ts.deleted = 0
     </select>
 
+    <select id="selectByName" resultType="com.mindskip.xzs.domain.Subject">
+        SELECT
+               name
+        FROM
+             t_subject
+        WHERE
+              name = #{name} AND deleted = 0
+            <if test="id != null">
+                AND id != #{id}
+            </if>
+        limit 1
+    </select>
+
 
     <select id="page" resultMap="BaseResultMap"
             parameterType="com.mindskip.xzs.viewmodel.admin.education.SubjectPageRequestVM">

--
Gitblit v1.8.0