# `mftworkordermaster`

> 工单主表


- **Engine:** InnoDB
- **Collation:** utf8mb3_general_ci

## Columns

| # | Name | Type | Null | Key | Default | Extra | Comment |
|---|---|---|---|---|---|---|---|
| 1 | `iIncrement` | `int` | NO | PRI |  | auto_increment | 自增列 |
| 2 | `sId` | `varchar(100)` | NO | MUL |  |  | 标准Id |
| 3 | `sBrandsId` | `varchar(100)` | NO | MUL |  |  | 加工商Id |
| 4 | `sSubsidiaryId` | `varchar(100)` | NO |  |  |  | 子公司ID |
| 5 | `tCreateDate` | `datetime` | NO | MUL | CURRENT_TIMESTAMP | DEFAULT_GENERATED | 制单日期 |
| 6 | `sMakePerson` | `varchar(255)` | NO |  |  |  | 制单人 |
| 7 | `sFormId` | `varchar(100)` | NO |  |  |  | 窗体ID |
| 8 | `iOrder` | `int` | NO |  | 0 |  | 排序号 |
| 9 | `sBillNo` | `varchar(255)` | NO |  |  |  | 单据号 |
| 10 | `sManualNo` | `varchar(255)` | NO | MUL |  |  | 手工单号 |
| 11 | `sType` | `varchar(255)` | NO |  | 正常生产 |  | { "0": "打样工单","1": "正常生产","2": "生产补单","3": "加急生产","4": "生产翻单"} |
| 12 | `sMemo` | `text` | YES |  |  |  | 备注 |
| 13 | `bCheck` | `bit(1)` | NO |  | b'0' |  | 是否审核 |
| 14 | `tCheckDate` | `datetime` | YES |  |  |  | 审核日期 |
| 15 | `sCheckPerson` | `varchar(255)` | YES |  |  |  | 审核人 |
| 16 | `dAdvanceMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 订金金额 |
| 17 | `dRealAdvanceMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 订金反写金额 |
| 18 | `tAdvanceDate` | `datetime` | YES |  |  |  | 收取订金日期 |
| 19 | `bAdvanceComplete` | `bit(1)` | NO |  | b'0' |  | 订金强制完工 |
| 20 | `bPrint` | `bit(1)` | NO |  | b'0' |  | 是否打印 |
| 21 | `bBillComplete` | `bit(1)` | NO |  | b'0' |  | 单据完工 |
| 22 | `tBillCompleteDate` | `datetime` | YES |  |  |  | 单据完工日期 |
| 23 | `bBillOutside` | `bit(1)` | NO |  | b'0' |  | 整单发外 |
| 24 | `bCopyLimit` | `bit(1)` | NO |  | b'0' |  | 禁止拷贝 |
| 25 | `sStatus` | `varchar(255)` | YES |  |  |  | 状态（未审核 已审核 作废 一到四级审核） |
| 26 | `bInvalid` | `bit(1)` | NO |  | b'0' |  | 是否作废 |
| 27 | `sPlateMaking` | `varchar(255)` | NO |  |  |  | 大版号 |
| 28 | `sMReserve1` | `varchar(255)` | YES |  |  |  | 预留字符1 |
| 29 | `sMReserve2` | `varchar(255)` | YES |  |  |  | 预留字符2 |
| 30 | `sMReserve3` | `varchar(255)` | YES |  |  |  | 预留字符3 |
| 31 | `sMReserve4` | `varchar(255)` | YES |  |  |  | 预留字符4 |
| 32 | `sMReserve5` | `varchar(255)` | YES |  |  |  | 预留字符5 |
| 33 | `sMReserve6` | `varchar(255)` | YES |  |  |  | 预留字符6 |
| 34 | `dMReserve1` | `decimal(18,6)` | YES |  |  |  | 预留数字1 |
| 35 | `dMReserve2` | `decimal(18,6)` | YES |  |  |  | 预留数字2 |
| 36 | `dMReserve3` | `decimal(18,6)` | YES |  |  |  | 预留数字3 |
| 37 | `iMReserve1` | `int` | YES |  |  |  | 预留整型1 |
| 38 | `iMReserve2` | `int` | YES |  |  |  | 预留整型2 |
| 39 | `iMReserve3` | `int` | YES |  |  |  | 预留整型3 |
| 40 | `tMReserve1` | `datetime` | YES |  |  |  | 预留日期1 |
| 41 | `tMReserve2` | `datetime` | YES |  |  |  | 预留日期2 |
| 42 | `bProduction` | `bit(1)` | NO |  | b'0' |  | 正在生产 |
| 43 | `dPrintBeforeMoney` | `decimal(18,6) unsigned` | NO |  | 0.000000 |  | 印前费用 |
| 44 | `dPrintMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 印刷费用 |
| 45 | `dPrintAfterMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 印后费用 |
| 46 | `dPrintProductMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 印刷成品费用 |
| 47 | `dMasterMaterialsMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 主料费用 |
| 48 | `dAuxiliaryMaterialsMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 辅料费用 |
| 49 | `dPackMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 包装费用 |
| 50 | `dTransportMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 运输费用 |
| 51 | `dAllMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 总报价 |
| 52 | `bCarryOver` | `bit(1)` | NO |  | b'0' |  | 是否结转 |
| 53 | `dProductCarryOverQty` | `decimal(18,6)` | NO |  | 0.000000 |  | 结转成本数量 |
| 54 | `tFactCountCost` | `datetime` | YES |  |  |  | 交货日期 |
| 55 | `bNotInStorageOverdueComplete` | `bit(1)` | NO |  | b'0' |  | 是否入库超期 |
| 56 | `sNoFormat` | `varchar(255)` | NO |  |  |  | 工单单据号生成类型 |
| 57 | `bSealingComplete` | `bit(1)` | NO |  | b'0' |  | 是否封样 |
| 58 | `bCustomerSureComplete` | `bit(1)` | NO |  | b'0' |  | 是否客户确认 |
| 59 | `sProcessType` | `varchar(255)` | NO |  |  |  | 工艺类别 |
| 60 | `sProductionClassify` | `varchar(255)` | NO |  |  |  | 生管分类 |
| 61 | `sFinalConfirmation` | `varchar(255)` | NO |  |  |  | 最终确认 |
| 62 | `dPlatediameter` | `decimal(18,6)` | NO |  | 0.000000 |  | 版直径 |
| 63 | `sPrintingSequence` | `varchar(255)` | NO |  |  |  | 印刷顺序 |
| 64 | `sTestStandardId` | `varchar(100)` | NO |  |  |  | 检验标准id |
| 65 | `sStockup` | `char(1)` | NO |  | 0 |  | 货物状态；0：未备货，1是备货  2是送货 3是收款 |
| 66 | `dSumProductMoney` | `decimal(18,6)` | NO |  | 0.000000 |  | 总金额 |
| 67 | `sCompletePerson` | `varchar(255)` | NO |  |  |  | 工单审核人 |
| 68 | `bPlanFrozen` | `bit(1)` | NO |  | b'0' |  | 是否变更 |
| 69 | `sProductId` | `varchar(100)` | NO |  |  |  | 主产品Id |
| 70 | `dQty` | `decimal(18,6)` | NO |  | 0.000000 |  | 主产品数量 |
| 71 | `sCustomerId` | `varchar(100)` | NO |  |  |  | 客户Id |
| 72 | `dInStoreQty` | `decimal(18,6)` | NO |  | 0.000000 |  | 主产品入库数 |
| 73 | `dOutDeliverQty` | `decimal(18,6)` | NO |  | 0.000000 |  | 主产品出库数 |
| 74 | `sMasterOrderNo` | `varchar(100)` | NO |  |  |  | 订单号 |
| 75 | `sOrderId` | `varchar(100)` | NO |  |  |  | 订单Id |
| 76 | `dOrderQty` | `decimal(18,6)` | NO |  | 0.000000 |  | 订单数 |
| 77 | `iPrintCount` | `int` | YES |  |  |  |  |
| 78 | `tAccountDate` | `datetime` | YES |  | CURRENT_TIMESTAMP | DEFAULT_GENERATED | 核算时间 |
| 79 | `tSaveDate` | `datetime` | YES |  | CURRENT_TIMESTAMP | DEFAULT_GENERATED |  |
| 80 | `bAccountComplete` | `bit(1)` | YES |  | b'0' |  | 核算完成 |
| 81 | `bProductQty` | `bit(1)` | NO |  | b'0' |  | 合版按产品合计 |
| 82 | `dMCostMoney` | `decimal(18,6)` | YES |  | 0.000000 |  | 成本金额 |
| 83 | `iChangeType` | `int` | NO |  | 0 |  | 变更类型 |
| 84 | `iCheckStatus` | `int` | YES |  | 0 |  | 0：未审核，1：已审核，2：已消审，用于记录材料更改 |
| 85 | `sAccountPerson` | `varchar(255)` | YES |  |  |  | 核算人员 |
| 86 | `sBillCompleteMemo` | `varchar(2000)` | YES |  |  |  | 单据完工备注 |
| 87 | `sChangeBeforeMemo` | `text` | YES |  |  |  |  |
| 88 | `sChangeMemo` | `text` | YES |  |  |  | 材料变更记录 |
| 89 | `sComRecordPerson` | `varchar(255)` | YES |  |  |  | 完工人员 |
| 90 | `sFSC` | `varchar(50)` | YES |  |  |  | FSC标识 |
| 91 | `sMasterMaterialsMemo` | `text` | YES |  |  |  | 材料名称名称 |
| 92 | `sMouldNoMemo` | `text` | YES |  |  |  | 工单模具号 |
| 93 | `sQualityId` | `varchar(255)` | YES |  |  |  | 质量事故报告id |
| 94 | `sQualityNo` | `varchar(255)` | YES |  |  |  | 质量事故报告编号 |
| 95 | `sReasonMemo` | `longtext` | YES |  |  |  | 完工备注 |
| 96 | `sSaveName` | `varchar(255)` | YES |  |  |  |  |

## Indexes

| Name | Unique | Type | Columns |
|---|---|---|---|
| `IndexN_mftworkordermastersManualNo` |  | BTREE | `sManualNo`, `sBrandsId`, `sSubsidiaryId` |
| `IndexU_mftworkordermaster` | ✓ | BTREE | `sId`, `sBrandsId`, `sSubsidiaryId` |
| `IndexU_mftworkordermasterCreateDate` |  | BTREE | `tCreateDate`, `sBrandsId`, `sSubsidiaryId` |
| `IndexU_mftworkordermasterNo` | ✓ | BTREE | `sBrandsId`, `sSubsidiaryId`, `sBillNo`, `sFormId` |
| `PRIMARY` | ✓ | BTREE | `iIncrement` |

## Narrative

_No human-written narrative yet — when this table is exercised by a [vertical slice](../../slices/index.md), link from there back to this page._
