From 13f796dc50449ae2ec525ef02aaf4b49a91a564b Mon Sep 17 00:00:00 2001 From: qirong <2032486488@qq.com> Date: 星期三, 29 十一月 2023 11:16:42 +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