# `Sp_Manufacture_SetTimeDivRow` (procedure)

> @author:钱豹
							@date:20210530 封存
							@describe: 按当前机台的排单次序,重算开始时间，耗时，结束时间，考虑因素有 单双休，工作时间
							条件为： 已排程 或 已下达 的未撤单记录


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_sMachineId` | `varchar(100)` |
| 2 | IN | `sMakePerson` | `varchar(100)` |
| 3 | IN | `p_tCStartTime` | `datetime` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(1000)` |
| 7 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 生产管理 → 机台作业任务执行 — row-splitting variant in the SetTime family. When a work-order row exceeds a single shift's worth of work, this proc splits one `mftproductionplanslave` row into multiple sub-rows so each fits within the machine's shift window, then writes the recomputed start/end/hour for each piece.

**What it does:** For machine `p_sMachineId` starting at `p_tCStartTime`, walks pending 排程/已下达 rows; on each row computes the per-shift slice using the same single/double-shift calendar as `Sp_Manufacture_SetTime`, and issues `UPDATE mftproductionplanslave` per slice with new `tCStartTime / dHour / tCEndTime`. Only DML target is `mftproductionplanslave` (no machine-state or material-side writes).

**Invocation:** No caller found in any channel — no gdsmodule binding, no form-master ref, no other proc CALLing it, no Java reference. Install script ships at `script/标版/30100101/schedule/Sp_Manufacture_SetTimeDivRow.sql`. Status: appears orphaned — kept as an alternative row-split implementation; candidate for maintainer audit. Author 钱豹, 封存.
