linwei
2024-01-31 b3b566ebdfed4005aaa513da3d5d2fd3924903cc
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>