Skip to content

Commit

Permalink
repair the bug "no bound to statement"
Browse files Browse the repository at this point in the history
  • Loading branch information
Chever-John committed Apr 27, 2021
1 parent 85459e7 commit a37a476
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int">
select count(*) from sys_dept where status = '0' and del_flag = '0' and find_in_set(#{deptId}, ancestors)
</select>
<select id="selectDeptListByRoleId" resultType="java.lang.Integer">
select d.dept_id
from sys_dept d
left join sys_role_dept rd on d.dept_id = rd.dept_id
where rd.role_id = #{roleId}
<if test="deptCheckStrictly">
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
</if>
order by d.parent_id, d.order_num
</select>

<insert id="insertDept" parameterType="SysDept">
<insert id="insertDept" parameterType="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>
Expand Down

0 comments on commit a37a476

Please sign in to comment.