# `Sp_Sales_SalesAnalysiseProduct1` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `tStartDate` | `datetime` |
| 2 | IN | `tEndDate` | `datetime` |
| 3 | IN | `iBillType` | `int` |
| 4 | IN | `iClassify_type` | `int` |
| 5 | IN | `iStatistics_type` | `int` |
| 6 | IN | `sBrId` | `varchar(100)` |
| 7 | IN | `sSuId` | `varchar(100)` |
| 8 | IN | `bFilter` | `varchar(5000)` |
| 9 | IN | `page_num` | `int` |
| 10 | IN | `page_size` | `int` |
| 11 | OUT | `totalCount` | `int` |
| 12 | IN | `countCloumn` | `varchar(5000)` |
| 13 | OUT | `countMapJson` | `longtext` |
| 14 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 15 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 16 | 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_SalesAnalysiseProduct1`'`._

## Narrative

**Business context:** Verbatim duplicate of `Sp_Sales_SalesAnalysiseProduct` (same parameters, same body — diffed byte-for-byte). Generic product-axis sales-pivot template parameterised by source bill (`iBillType` 0=`Viw_SalSalesOrder` / 1=`Viw_SalDeliverGoods` / 2=`Viw_SalSalesInvoice`), classification axis (`iClassify_type` 0/1) and statistics axis (`iStatistics_type` 0/1/2).

**What it does:** Identical to `Sp_Sales_SalesAnalysiseProduct` — builds a dynamic `SELECT ... FROM :sTableName WHERE bCheck=1 AND tCreateDate ∈ window GROUP BY :sGroupBy`, fills the placeholders from the three int switches, and pages via `Sp_Outstanding_Query`. See that proc's narrative for full mechanism.

**Invocation:** Status: appears orphaned. No `gdsconfigformmaster.sSqlStr` binding, no `gdsmodule` hook, no other-routine caller. Only reference is the install script `script/标版/30100101/Sp_Sales_SalesAnalysiseProduct1.sql`. The `1` suffix suggests a snapshot copy taken during refactoring of `Sp_Sales_SalesAnalysiseProduct`. Per wiki convention, backup objects are not narrated separately — see `Sp_Sales_SalesAnalysiseProduct`. Candidate for maintainer audit / removal.
