From 2a64b537e8e3bce9ce030585a3da17d48379c0ad Mon Sep 17 00:00:00 2001
From: sfd <sun.sunshine@163.com>
Date: 星期一, 26 五月 2025 15:04:45 +0800
Subject: [PATCH] 修改json类型转换错误

---
 aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml b/aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml
index e6a6945..e631c42 100644
--- a/aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml
+++ b/aps-modules/aps-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -4,7 +4,7 @@
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.aps.system.mapper.SysDeptMapper">
 
-	<resultMap type="SysDept" id="SysDeptResult">
+	<resultMap type="com.aps.system.api.domain.SysDept" id="SysDeptResult">
 		<id     property="deptId"     column="dept_id"     />
 		<result property="parentId"   column="parent_id"   />
 		<result property="ancestors"  column="ancestors"   />
@@ -30,7 +30,7 @@
         from sys_dept d
     </sql>
     
-	<select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult">
+	<select id="selectDeptList" parameterType="com.aps.system.api.domain.SysDept" resultMap="SysDeptResult">
         <include refid="selectDeptVo"/>
         where d.del_flag = '0'
 		<if test="deptId != null and deptId != 0">
@@ -40,7 +40,7 @@
 			AND parent_id = #{parentId}
 		</if>
 		<if test="deptName != null and deptName != ''">
-			AND dept_name like concat('%', #{deptName}, '%')
+			AND dept_name like '%' || #{deptName} '%'
 		</if>
 		<if test="status != null and status != ''">
 			AND status = #{status}
@@ -88,7 +88,7 @@
 		where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
 	</select>
     
-    <insert id="insertDept" parameterType="SysDept">
+    <insert id="insertDept" parameterType="com.aps.system.api.domain.SysDept">
  		insert into sys_dept(
  			<if test="deptId != null and deptId != 0">dept_id,</if>
  			<if test="parentId != null and parentId != 0">parent_id,</if>
@@ -118,7 +118,7 @@
  		)
 	</insert>
 	
-	<update id="updateDept" parameterType="SysDept">
+	<update id="updateDept" parameterType="com.aps.system.api.domain.SysDept">
  		update sys_dept
  		<set>
  			<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
@@ -159,5 +159,13 @@
 	<delete id="deleteDeptById" parameterType="Long">
 		update sys_dept set del_flag = '2' where dept_id = #{deptId}
 	</delete>
+	<select id="selectDeptListByIdList" parameterType="Long" resultMap="SysDeptResult">
+		<include refid="selectDeptVo"/>
+		where d.del_flag = '0' and dept_id in
+		<foreach collection="deptIdList" item="deptId" open="(" separator="," close=")">
+			#{deptId}
+		</foreach>
+		order by d.parent_id, d.order_num
+	</select>
 
 </mapper> 
\ No newline at end of file

--
Gitblit v1.9.3