# `Sp_Calc_sMpd` (procedure)

> 设计排版单


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `iFlag` | `int` |
| 2 | IN | `iTmpCheck` | `int` |
| 3 | IN | `sFormGuid` | `varchar(100)` |
| 4 | IN | `sGuid` | `varchar(100)` |
| 5 | IN | `sLoginId` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(4000)` |
| 7 | IN | `sBrId` | `varchar(100)` |
| 8 | IN | `sSuId` | `varchar(100)` |
| 9 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 设计排版单 — pre-press / 印前 design-layout doc audit / un-audit on `MftPrintBeforeDesignMaster`. The 设计排版单 captures the imposition (排版) decisions (sheet size, up-count, color layout) that the prepress designer finalises before plate-making.

**What it does:** Standard `Sp_Calc_s<Code>` skeleton: defaults the IN params, declares `iDefineCheck` (suggesting it consults a workflow-required flag), validates `sGuid`, and branches on `iFlag` to flip `MftPrintBeforeDesignMaster.bCheck` plus audit person/date.

**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no other routine refs. xly-src contains only `script/标版/30100101/Sp_Calc_sMpd.sql` (install script) with no caller code. The 设计排版单 module may have been retired or its audit re-routed to a Java handler. Candidate for maintainer audit.
