zhongrj
2024-01-31 a5c2a3b99f46866a666618bc461340aa4e679b1c
src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
@@ -111,11 +111,15 @@
        ) AS "has_children"
        FROM
        blade_dept dept
        WHERE
        dept.parent_id = #{param2} AND dept.is_deleted = 0
        <if test="param1!=null and param1!=''">
            and dept.tenant_id = #{param1}
        </if>
        <where>
            <if test="param2!=null and param2!=''">
                and dept.parent_id = #{param2}
            </if>
            AND dept.is_deleted = 0
            <if test="param1!=null and param1!=''">
                and dept.tenant_id = #{param1}
            </if>
        </where>
        ORDER BY dept.sort
    </select>