# `Sp_Sales_NotWorkOrderList` (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_NotWorkOrderList`'`._

## Narrative

**Business context:** 销售管理 → 待下达生产订单任务列表 — paged worklist of 销售订单 lines whose 工单 has not yet been issued. Drives the PMC / 计划员 screen used to pick the next batch of orders to release to production.

**What it does:** Builds temp `NotWorkOrderList`, `Insert INTO NotWorkOrderList` from a `JOIN` over `eleproduct`, `elecustomer`, `sissalesman`, `siswarehouse` plus `eleproductstock` / `PitProductStoreVirtual` for current and virtual stock, restricted to undispatched order slaves between `tStartDate` and `tEndDate`. `UPDATE NotWorkOrderList` folds in flags (`bComplete`, `iLag`, etc.). The standard `CALL Sp_Do_UpdateByPageSizeBefore` paging trailer slices out `pageNum/pageSize` and computes `countMapJson` from `countCloumn`.

**Invocation:** Status: appears orphaned in this snapshot — no `gdsconfigformmaster` binding and no Java/MyBatis hit. Install script `script/标版/30100101/Sp_Sales_NotWorkOrderList.sql` ships the standard definition, suggesting it was once bound; the form-master row may have been removed or renamed. Sibling `Sp_Sales_Lable_NotWorkOrderList` is the label-line variant. Maintainer audit recommended.
