wlzboy
2025-12-06 5d75fcaea0a3774052b7484a4ffe755258502363
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
@@ -36,6 +36,7 @@
     */
    public SysDept selectDeptById(Long deptId);
    public List<SysDept> selectDeptListByParentId(Long parentId);
    /**
     * 根据ID查询所有子部门
     * 
@@ -132,4 +133,30 @@
     * @return 部门信息
     */
    public SysDept selectDeptByDepartmentIdAndParentId(@Param("departmentId") Integer departmentId, @Param("parentId") Long parentId);
    /**
     * 获取指定部门ID的分公司ID(parent_id=100的部门)
     * 如果传入的就是分公司,直接返回;否则从ancestors中查找分公司ID
     *
     * @param deptId 部门ID
     * @return 分公司ID,如果找不到则返回null
     */
    public Long selectBranchCompanyIdByDeptId(@Param("deptId") Long deptId);
    /**
     * 根据编码列表查询分公司
     * 在service_order_class或dispatch_order_class中匹配
     *
     * @param orderCodes 编码列表
     * @return 分公司列表
     */
    public List<SysDept> selectBranchCompaniesByOrderCodes(@Param("orderCodes") List<String> orderCodes);
    /**
     * 根据service_class查询部门信息
     *
     * @param serviceClass 服务类别编码
     * @return 部门信息
     */
    public SysDept selectDeptByServiceClass(@Param("serviceClass") String serviceClass);
}