# `viw_mainplan_mftmaterials`（视图）


- **是否可更新：** YES
- **定义者：** `xlyprint@%`

## 字段

| # | 名称 | 类型 | 可空 |
|---|---|---|---|
| 1 | `iIncrement` | `int` | NO |
| 2 | `sId` | `varchar(100)` | NO |
| 3 | `sBrandsId` | `varchar(100)` | NO |
| 4 | `sSubsidiaryId` | `varchar(100)` | NO |
| 5 | `iOrder` | `int` | NO |
| 6 | `sParentId` | `varchar(100)` | NO |
| 7 | `sControlId` | `varchar(100)` | NO |
| 8 | `sType` | `varchar(255)` | NO |
| 9 | `sMaterialsId` | `varchar(100)` | NO |
| 10 | `sMaterialsStyle` | `varchar(255)` | NO |
| 11 | `dAuxiliaryQty` | `decimal(18,6)` | NO |
| 12 | `sAuxiliaryUnit` | `varchar(255)` | NO |
| 13 | `dMaterialsQty` | `decimal(18,6)` | NO |
| 14 | `iReelPaper` | `int` | NO |
| 15 | `dConversionQty` | `decimal(18,6)` | NO |
| 16 | `dCostMaterialsPrice` | `decimal(18,6)` | NO |
| 17 | `dCostMaterialsMoney` | `decimal(18,6)` | NO |
| 18 | `dMaterialsPrice` | `decimal(18,6)` | NO |
| 19 | `dMaterialsMoney` | `decimal(18,6)` | NO |
| 20 | `dMaterialsKQty` | `decimal(18,6)` | NO |
| 21 | `bPurchaseApplyComplete` | `bit(1)` | NO |
| 22 | `dPurchaseApplyAuxiliaryQty` | `decimal(18,6)` | NO |
| 23 | `dPurchaseApplyQty` | `decimal(18,6)` | NO |
| 24 | `bPurchaseComplete` | `bit(1)` | NO |
| 25 | `dPurchaseAuxiliaryQty` | `decimal(18,6)` | NO |
| 26 | `dPurchaseQty` | `decimal(18,6)` | NO |
| 27 | `dProductionAuxiliaryQty` | `decimal(18,6)` | NO |
| 28 | `dProductionQty` | `decimal(18,6)` | NO |
| 29 | `bProductionComplete` | `bit(1)` | NO |
| 30 | `bComMaterials` | `bit(1)` | NO |
| 31 | `bOutsideBandMaterials` | `bit(1)` | NO |
| 32 | `sProcessId` | `varchar(100)` | NO |
| 33 | `sProcessTbId` | `varchar(100)` | NO |
| 34 | `sSelectProcess` | `varchar(255)` | NO |
| 35 | `sSrcId` | `varchar(100)` | NO |
| 36 | `sMaterialsMemo` | `text` | YES |
| 37 | `sAReserve1` | `varchar(255)` | YES |
| 38 | `sAReserve2` | `varchar(255)` | YES |
| 39 | `sAReserve3` | `varchar(255)` | YES |
| 40 | `sAReserve4` | `varchar(255)` | YES |
| 41 | `sAReserve5` | `varchar(255)` | YES |
| 42 | `sAReserve6` | `varchar(255)` | YES |
| 43 | `dAReserve1` | `decimal(18,6)` | YES |
| 44 | `dAReserve2` | `decimal(18,6)` | YES |
| 45 | `dAReserve3` | `decimal(18,6)` | YES |
| 46 | `iAReserve1` | `int` | YES |
| 47 | `iAReserve2` | `int` | YES |
| 48 | `iAReserve3` | `int` | YES |
| 49 | `tAReserve1` | `datetime` | YES |
| 50 | `tAReserve2` | `datetime` | YES |
| 51 | `bComComplete` | `bit(1)` | NO |
| 52 | `dComAuxiliaryQty` | `decimal(18,6)` | NO |
| 53 | `dComQty` | `decimal(18,6)` | NO |
| 54 | `bCutComplete` | `bit(1)` | NO |
| 55 | `dCutAuxiliaryQty` | `decimal(18,6)` | NO |
| 56 | `dCutQty` | `decimal(18,6)` | NO |
| 57 | `bMarginalComplete` | `bit(1)` | NO |
| 58 | `dMarginalAuxiliaryQty` | `decimal(18,6)` | NO |
| 59 | `dMarginalQty` | `decimal(18,6)` | NO |
| 60 | `bNotAuto` | `bit(1)` | NO |
| 61 | `sMakePerson` | `varchar(255)` | NO |
| 62 | `tCreateDate` | `datetime` | NO |
| 63 | `sSrcControlId` | `varchar(100)` | NO |
| 64 | `sSrcMaterialsTbId` | `varchar(100)` | NO |
| 65 | `bPlanMaterialCheck` | `bit(1)` | NO |
| 66 | `bPlanMaterialCheckResult` | `bit(1)` | NO |
| 67 | `sWorkOrderId` | `varchar(100)` | NO |
| 68 | `sSrcNo` | `varchar(255)` | NO |
| 69 | `sState` | `varchar(255)` | NO |
| 70 | `dCheckQty` | `decimal(18,6)` | YES |
| 71 | `imorder` | `int` | YES |

## 定义

```sql
select `mm`.`iIncrement` AS `iIncrement`,`mm`.`sId` AS `sId`,`mm`.`sBrandsId` AS `sBrandsId`,`mm`.`sSubsidiaryId` AS `sSubsidiaryId`,`mm`.`iOrder` AS `iOrder`,`mm`.`sParentId` AS `sParentId`,`mm`.`sControlId` AS `sControlId`,`mm`.`sType` AS `sType`,`mm`.`sMaterialsId` AS `sMaterialsId`,`mm`.`sMaterialsStyle` AS `sMaterialsStyle`,`mm`.`dAuxiliaryQty` AS `dAuxiliaryQty`,`mm`.`sAuxiliaryUnit` AS `sAuxiliaryUnit`,`mm`.`dMaterialsQty` AS `dMaterialsQty`,`mm`.`iReelPaper` AS `iReelPaper`,`mm`.`dConversionQty` AS `dConversionQty`,`mm`.`dCostMaterialsPrice` AS `dCostMaterialsPrice`,`mm`.`dCostMaterialsMoney` AS `dCostMaterialsMoney`,`mm`.`dMaterialsPrice` AS `dMaterialsPrice`,`mm`.`dMaterialsMoney` AS `dMaterialsMoney`,`mm`.`dMaterialsKQty` AS `dMaterialsKQty`,`mm`.`bPurchaseApplyComplete` AS `bPurchaseApplyComplete`,`mm`.`dPurchaseApplyAuxiliaryQty` AS `dPurchaseApplyAuxiliaryQty`,`mm`.`dPurchaseApplyQty` AS `dPurchaseApplyQty`,`mm`.`bPurchaseComplete` AS `bPurchaseComplete`,`mm`.`dPurchaseAuxiliaryQty` AS `dPurchaseAuxiliaryQty`,`mm`.`dPurchaseQty` AS `dPurchaseQty`,`mm`.`dProductionAuxiliaryQty` AS `dProductionAuxiliaryQty`,`mm`.`dProductionQty` AS `dProductionQty`,`mm`.`bProductionComplete` AS `bProductionComplete`,`mm`.`bComMaterials` AS `bComMaterials`,`mm`.`bOutsideBandMaterials` AS `bOutsideBandMaterials`,`mm`.`sProcessId` AS `sProcessId`,`mm`.`sProcessTbId` AS `sProcessTbId`,`mm`.`sSelectProcess` AS `sSelectProcess`,`mm`.`sSrcId` AS `sSrcId`,`mm`.`sMaterialsMemo` AS `sMaterialsMemo`,`mm`.`sAReserve1` AS `sAReserve1`,`mm`.`sAReserve2` AS `sAReserve2`,`mm`.`sAReserve3` AS `sAReserve3`,`mm`.`sAReserve4` AS `sAReserve4`,`mm`.`sAReserve5` AS `sAReserve5`,`mm`.`sAReserve6` AS `sAReserve6`,`mm`.`dAReserve1` AS `dAReserve1`,`mm`.`dAReserve2` AS `dAReserve2`,`mm`.`dAReserve3` AS `dAReserve3`,`mm`.`iAReserve1` AS `iAReserve1`,`mm`.`iAReserve2` AS `iAReserve2`,`mm`.`iAReserve3` AS `iAReserve3`,`mm`.`tAReserve1` AS `tAReserve1`,`mm`.`tAReserve2` AS `tAReserve2`,`mm`.`bComComplete` AS `bComComplete`,`mm`.`dComAuxiliaryQty` AS `dComAuxiliaryQty`,`mm`.`dComQty` AS `dComQty`,`mm`.`bCutComplete` AS `bCutComplete`,`mm`.`dCutAuxiliaryQty` AS `dCutAuxiliaryQty`,`mm`.`dCutQty` AS `dCutQty`,`mm`.`bMarginalComplete` AS `bMarginalComplete`,`mm`.`dMarginalAuxiliaryQty` AS `dMarginalAuxiliaryQty`,`mm`.`dMarginalQty` AS `dMarginalQty`,`mm`.`bNotAuto` AS `bNotAuto`,`mm`.`sMakePerson` AS `sMakePerson`,`mm`.`tCreateDate` AS `tCreateDate`,`mm`.`sSrcControlId` AS `sSrcControlId`,`mm`.`sSrcMaterialsTbId` AS `sSrcMaterialsTbId`,`mm`.`bPlanMaterialCheck` AS `bPlanMaterialCheck`,`mm`.`bPlanMaterialCheckResult` AS `bPlanMaterialCheckResult`,`mp`.`sWorkOrderId` AS `sWorkOrderId`,`mp`.`sSrcNo` AS `sSrcNo`,`mp`.`sState` AS `sState`,`mm`.`dCheckQty` AS `dCheckQty`,`mp`.`imorder` AS `imorder` from (`xlyweberp_saas_ai`.`mftworkordermaterials` `mm` join (select `xlyweberp_saas_ai`.`mftproductionplan`.`sWorkOrderId` AS `sWorkOrderId`,`xlyweberp_saas_ai`.`mftproductionplan`.`sSrcNo` AS `sSrcNo`,`xlyweberp_saas_ai`.`mftproductionplan`.`sState` AS `sState`,min(`xlyweberp_saas_ai`.`mftproductionplan`.`iOrder`) AS `imorder` from `xlyweberp_saas_ai`.`mftproductionplan` where (`xlyweberp_saas_ai`.`mftproductionplan`.`sState` in (2,3,7)) group by `xlyweberp_saas_ai`.`mftproductionplan`.`sWorkOrderId`,`xlyweberp_saas_ai`.`mftproductionplan`.`sSrcNo`,`xlyweberp_saas_ai`.`mftproductionplan`.`sState` order by `xlyweberp_saas_ai`.`mftproductionplan`.`sState` desc,`xlyweberp_saas_ai`.`mftproductionplan`.`iOrder`) `mp` on((`mm`.`sParentId` = `mp`.`sWorkOrderId`))) order by `mp`.`imorder`
```

## 说明

_暂无人工说明。_
