# `sp_pitProductstoredata` (procedure)


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

## Parameters

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

## Body

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

## Narrative

**Business context:** Intended as a paged data fetch over `PitProductStore` — the 印件成品库存 / 未对账印件清单 table (printed-item finished-goods inventory). Header comment hints at "根据[系统设置]-->[未对账印件清单来源]" — pulling rows whose source bill is configured via system settings. Domain sits under 库存管理 → 成品库存.

**What it does:** Builds a temp table `TMP_PitProductStore_lGFn` and bulk-inserts from `PitProductStore A` filtered by `sBrandsId/sSubsidiaryId` plus the caller's JSON `bFilter` (parsed by `Fun_bFilter_toWhere`). Returns rows ordered by `tCreateDate` with paging applied via `pageNum/pageSize`. Standard `<proc>(…, totalCount, countMapJson, …)` paged-report contract — feeds list grids, not a write path.

**Invocation:** Status: appears orphaned. No caller found in any channel — no `gdsconfigformmaster.sSqlStr` reference, no `gdsmodule` hook, no other routine `CALL`s it, no xly-src grep hit (Java, XML, SQL, install scripts). Candidate for maintainer audit; likely a draft of a 未对账印件清单 query that was never wired to a form.
