# `Sp_Manufacture_SalSalesOrderReport` (procedure)

> MES产量统计表


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sBrId` | `varchar(100)` |
| 2 | IN | `sSuId` | `varchar(100)` |
| 3 | IN | `sLoginId` | `varchar(100)` |
| 4 | IN | `bFilter` | `varchar(5000)` |
| 5 | IN | `pageNum` | `int` |
| 6 | IN | `pageSize` | `int` |
| 7 | OUT | `totalCount` | `int` |
| 8 | IN | `countCloumn` | `varchar(5000)` |
| 9 | OUT | `countMapJson` | `longtext` |
| 10 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 11 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 12 | IN | `sGroupby_group_sql` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** 生产管理 / 销售管理 — `MES产量统计表` (MES output-statistics report). Per `eleprocess` × `sisproductclassify`, returns current-month and YTD sales money plus 平印 (lithography) and 轮印 (rotary) transfer counts, with a four-bucket sales-money classification (≤3000 / 3000–5000 / 5000–10000 / >10000).

**What it does:** Creates temp `SalSalesOrderReport` with columns `sProductId, sProductclassifyId, dSalesMoneyMonth, dSalesMoneyYear, dLithographyMonthQyt, dLithographyYearQyt, dRotateMonthQyt, dRotateYearQyt, dSalesClassificat_1..4`. Seeds rows from `eleprocess` joined to `sisproductclassify`. Calls `Sp_Do_UpdateByPageSizeBefore` to set up paging, then enriches the temp from sales-order and production-report sources (full body via `SHOW CREATE PROCEDURE` — ~4.5K).

**Invocation:** No form-master binding, no `gdsmodule` hook, no other-routine caller in `information_schema.ROUTINES`. xly-src only ships the install script `script/标版/30100101/Sp_Manufacture_SalSalesOrderReport.sql`. Status: appears orphaned in the metadata channels — likely registered under a customer-specific form not present in 标版. Candidate for maintainer audit.
