# `Fun_getProductMaxStyle` (function)

> 根据首字母拼音查询


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_sProductId` | `varchar(255)` |
| 2 | IN | `p_sProductParentId` | `varchar(255)` |

## Body

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

## Narrative

**Business context:** Largest-machine-style probe — for a given product (or, when `p_sProductId` is empty, a hard-coded product `sId`), returns the biggest `dMachineLength * dMachineWidth` formatted as `L*W` from `eleprocessstyle`. Used to pick a representative machine size for the product's process variants.

**What it does:** branches on whether `p_sProductId` is empty: empty path uses a hard-coded `eleprocess.sId` literal (`16850218330008220277598473420000`); non-empty path queries by `eleprocess.sParentId = '16850209050009530246638814024000'` (a process-classification root). Both joins to `eleprocessstyle` and `ORDER BY length*width DESC LIMIT 1`. Header comment `根据首字母拼音查询` is misleading — has nothing to do with pinyin.

**Invocation:** the only routine referencing it is `Sp_Ai_AddQuoQuoAfter`, which is part of the `ai_*` subsystem that the wiki excludes from its core ERP scope (see [the index](../../index.md#whats-out-of-scope)). No form-master, gdsmodule hook, in-scope routine, or xly-src reference invokes it. Status: appears orphaned for in-scope purposes — candidate for maintainer audit. Also flag: the hard-coded `sId` literals tie this function to one specific tenant's data and will quietly return `NULL` elsewhere.
