|
|
@@ -15,7 +15,7 @@
|
|
|
<result column="is_deleted" property="isDeleted"/>
|
|
|
</resultMap>
|
|
|
|
|
|
- <resultMap id="deptLazyVOResultMap" type="org.springblade.modules.system.vo.DeptVO">
|
|
|
+ <resultMap id="deptVOResultMap" type="org.springblade.modules.system.vo.DeptVO">
|
|
|
<id column="id" property="id"/>
|
|
|
<result column="parent_id" property="parentId"/>
|
|
|
<result column="dept_name" property="deptName"/>
|
|
|
@@ -43,7 +43,7 @@
|
|
|
id, parent_id, dept_name, full_name, sort, remark, is_deleted
|
|
|
</sql>
|
|
|
|
|
|
- <select id="lazyList" resultMap="deptLazyVOResultMap">
|
|
|
+ <select id="lazyList" resultMap="deptVOResultMap">
|
|
|
SELECT
|
|
|
dept.* ,
|
|
|
(
|
|
|
@@ -52,24 +52,23 @@
|
|
|
FROM
|
|
|
blade_dept
|
|
|
WHERE
|
|
|
- parent_id = dept.id
|
|
|
+ parent_id = dept.id and is_deleted = 0
|
|
|
) AS "has_children"
|
|
|
FROM
|
|
|
blade_dept dept
|
|
|
- <where>
|
|
|
- <if test="param1!=null and param1!=''">
|
|
|
- and tenant_id = #{param1}
|
|
|
- </if>
|
|
|
- <if test="param2!=null and param2!=''">
|
|
|
- and parent_id = #{param2}
|
|
|
- </if>
|
|
|
- <if test="param.deptName!=null and param.deptName!=''">
|
|
|
- and dept.dept_name like concat('%', #{param.deptName},'%')
|
|
|
- </if>
|
|
|
- <if test="param.fullName!=null and param.fullName!=''">
|
|
|
- and dept.full_name like concat('%', #{param.fullName},'%')
|
|
|
- </if>
|
|
|
- </where>
|
|
|
+ WHERE dept.is_deleted = 0
|
|
|
+ <if test="param1!=null and param1!=''">
|
|
|
+ and dept.tenant_id = #{param1}
|
|
|
+ </if>
|
|
|
+ <if test="param2!=null">
|
|
|
+ and dept.parent_id = #{param2}
|
|
|
+ </if>
|
|
|
+ <if test="param.deptName!=null and param.deptName!=''">
|
|
|
+ and dept.dept_name like concat('%', #{param.deptName},'%')
|
|
|
+ </if>
|
|
|
+ <if test="param.fullName!=null and param.fullName!=''">
|
|
|
+ and dept.full_name like concat('%', #{param.fullName},'%')
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="tree" resultMap="treeNodeResultMap">
|
|
|
@@ -92,14 +91,14 @@
|
|
|
FROM
|
|
|
blade_dept
|
|
|
WHERE
|
|
|
- parent_id = dept.id
|
|
|
+ parent_id = dept.id and is_deleted = 0
|
|
|
) AS "has_children"
|
|
|
FROM
|
|
|
blade_dept dept
|
|
|
WHERE
|
|
|
- parent_id = #{param2}
|
|
|
+ dept.parent_id = #{param2} AND dept.is_deleted = 0
|
|
|
<if test="param1!=null and param1!=''">
|
|
|
- and tenant_id = #{param1}
|
|
|
+ and dept.tenant_id = #{param1}
|
|
|
</if>
|
|
|
</select>
|
|
|
|