From 7351ad6176c2abd7076d1bbcb3d21ea2b35e3d2e Mon Sep 17 00:00:00 2001
From: baizonghao <1719256278@qq.com>
Date: 星期四, 15 六月 2023 11:56:46 +0800
Subject: [PATCH] 接口拦截

---
 src/main/resources/mapper/DepartmentMapper.xml |   39 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/DepartmentMapper.xml b/src/main/resources/mapper/DepartmentMapper.xml
index 4df30ab..7146268 100644
--- a/src/main/resources/mapper/DepartmentMapper.xml
+++ b/src/main/resources/mapper/DepartmentMapper.xml
@@ -7,19 +7,24 @@
         <result column="deleted" jdbcType="VARCHAR" property="deleted"/>
     </resultMap>
 
+    <sql id="Base_Column_List">
+        id
+        , name,deleted
+    </sql>
+
     <insert id="add" parameterType="com.mindskip.xzs.domain.Department" useGeneratedKeys="true" keyProperty="id">
         insert into t_department (name, deleted)
         values (#{name,jdbcType=VARCHAR}, #{deleted,jdbcType=VARCHAR})
     </insert>
 
     <update id="update" parameterType="com.mindskip.xzs.domain.Department">
-        update t_user
+        update t_department
         <set>
             <if test="name != null">
                 name = #{name,jdbcType=VARCHAR},
             </if>
             <if test="deleted != null">
-                name = #{deleted,jdbcType=VARCHAR},
+                deleted = #{deleted,jdbcType=VARCHAR},
             </if>
         </set>
         where id = #{id,jdbcType=INTEGER}
@@ -30,4 +35,34 @@
         <include refid="Base_Column_List"/>
         from t_department where deleted=0
     </select>
+
+    <select id="getById" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from t_department where deleted=0
+        and id = #{id}
+    </select>
+
+    <select id="page" resultMap="BaseResultMap"
+            parameterType="com.mindskip.xzs.viewmodel.admin.department.DepartmentResponseVM">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM t_department
+        <where>
+            and deleted=0
+            <if test="id != null ">
+                and id= #{id}
+            </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_department where deleted=0 and name = #{name}
+    </select>
 </mapper>

--
Gitblit v1.8.0