# `fun_getreportId_byMaterialsType` (function)

> 根据物料分类获取报表id


- **Type:** FUNCTION
- **Returns:** `varchar(255)`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_sMaterialsType` | `varchar(255)` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE FUNCTION `fun_getreportId_byMaterialsType`'`._

## Narrative

**Business context:** Materials-class report-id dispatch — sibling of [`fun_getreportId_byArrMaterialsType`](fun_getreportId_byArrMaterialsType.md), maps a materials-class flag (`paper` vs everything-else) onto one of two hard-coded `report.sId` GUIDs so the print/print-export step can pick a class-appropriate template. The `byArr*` sibling targets a different document context (到货/goods-arrival); this one is the general-purpose materials variant.

**What it does:** `IF p_sMaterialsType='paper' RETURN '17013...'` (纸张 report) else `RETURN '17107...'` (辅料 report).

**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Tenant-specific report `sId`s.
