wlzboy
2025-11-11 9529220c815bfe6e43c992fde2f392be823450eb
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
@@ -115,4 +115,39 @@
     * @return 结果
     */
    public int deleteDeptById(Long deptId);
    /**
     * 根据departmentId查询部门
     *
     * @param departmentId SQL Server中的部门ID
     * @return 部门信息
     */
    public SysDept selectDeptByDepartmentId(@Param("departmentId") Integer departmentId);
    /**
     * 根据departmentId和父部门ID查询部门
     *
     * @param departmentId SQL Server中的部门ID
     * @param parentId 父部门ID
     * @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);
}