# `Sp_Sales_PurchaseAnalysiseOfSupplyCount` (procedure)

> 供应商采购频次


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

## Parameters

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

## Body

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

## Narrative

**Business context:** 采购管理 → 采购分析报表 → 供应商采购频次 — paged report that counts how many distinct purchase orders each 供应商 received in the window. Helps procurement spot under- or over-used suppliers.

**What it does:** Builds temp `SAS`/`tempSAS`, `INSERT INTO SAS` from `viw_purpurchaseorder` `JOIN elesupply`, grouping by supplier with `COUNT(*)` / `SUM(qty)` aggregates. Filtered by `tStartDate`/`tEndDate` and `bFilter`. Final paging via `Sp_Do_UpdateByPageSizeBefore` returning `pageNum/pageSize` slice plus `countMapJson` from `countCloumn`.

**Invocation:** Status: appears orphaned in this snapshot. No `gdsconfigformmaster` binding and no xly-src reference at all (no install script, no customer override). Sibling procs in the `Sp_Sales_PurchaseAnalysiseOfSupply*` family are wired to live forms — this one may have been a planned report whose form-master row was never persisted, or was pruned. Maintainer audit recommended.
