|
|
@@ -208,6 +208,27 @@
|
|
|
${params.dataScope}
|
|
|
order by d.parent_id, d.order_num
|
|
|
</select>
|
|
|
+ <select id="treeDeptSubSel" resultType="com.zd.model.entity.SysDept">
|
|
|
+ select d.* from (
|
|
|
+ select d.dept_id,d.parent_id,d.ancestors,d.dept_name,d.del_flag
|
|
|
+ from sys_dept d
|
|
|
+
|
|
|
+ union all
|
|
|
+
|
|
|
+ select s.build_id dept_id,s.dept_id parent_id,(select dt.ancestors
|
|
|
+ from sys_dept dt where dt.dept_id = s.build_id) ancestors,s.name dept_name,s.is_del del_flag from lab_subject s
|
|
|
+ )d
|
|
|
+ where d.del_flag = '0'
|
|
|
+ <if test="parentId != null and parentId != 0">
|
|
|
+ AND d.parent_id = #{parentId}
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null and deptName != ''">
|
|
|
+ AND d.dept_name like concat('%', #{deptName}, '%')
|
|
|
+ </if>
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
+ ${params.dataScope}
|
|
|
+ order by d.parent_id
|
|
|
+ </select>
|
|
|
|
|
|
<insert id="insertDept" parameterType="com.zd.model.entity.SysDept">
|
|
|
insert into sys_dept(
|