# `viw_outstoretype` (view)


- **Updatable:** NO

## Columns

| # | Name | Type | Null |
|---|---|---|---|
| 1 | `sConfirmMonth` | `varchar(100)` | YES |
| 2 | `sId` | `varchar(63)` | YES |
| 3 | `sSlaveId` | `varchar(63)` | YES |
| 4 | `sMaterialsId` | `varchar(100)` | YES |
| 5 | `sBrandsId` | `varchar(100)` | YES |
| 6 | `sSubsidiaryId` | `varchar(100)` | YES |
| 7 | `sMaterialsStyle` | `varchar(255)` | YES |
| 8 | `sFormId` | `varchar(100)` | YES |
| 9 | `dMaterials1Money` | `decimal(40,2)` | YES |
| 10 | `dMaterials2Money` | `decimal(40,2)` | YES |
| 11 | `dMaterials3Money` | `decimal(40,2)` | YES |
| 12 | `dMaterials4Money` | `decimal(40,2)` | YES |
| 13 | `dMaterials5Money` | `decimal(40,2)` | YES |
| 14 | `dMaterials6Money` | `decimal(40,2)` | YES |
| 15 | `dMaterials7Money` | `decimal(40,2)` | YES |
| 16 | `dMaterials8Money` | `decimal(40,2)` | YES |

## Definition

```sql
select `accmaterialsstore`.`sConfirmMonth` AS `sConfirmMonth`,concat(date_format(now(),'%Y%m%d%H%i%s'),ceiling(((rand() * 9000000) + 1000000)),ceiling(((rand() * 9000000000) + 1000000000))) AS `sId`,concat(date_format(now(),'%Y%m%d%H%i%s'),ceiling(((rand() * 9000000) + 1000000)),ceiling(((rand() * 9000000000) + 1000000000))) AS `sSlaveId`,`accmaterialsstore`.`sMaterialsId` AS `sMaterialsId`,`accmaterialsstore`.`sBrandsId` AS `sBrandsId`,`accmaterialsstore`.`sSubsidiaryId` AS `sSubsidiaryId`,`accmaterialsstore`.`sMaterialsStyle` AS `sMaterialsStyle`,`accmaterialsstore`.`sFormId` AS `sFormId`,sum((case when (((`accmaterialsstore`.`sFormId` = '192116810113315226492535760') or (`accmaterialsstore`.`sFormId` = '101251240115015959856790260') or (`accmaterialsstore`.`sFormId` = '192116810113315222184074940') or (`accmaterialsstore`.`sFormId` = '101251240115016115406953760') or (`accmaterialsstore`.`sFormId` = '192116810113315226622476570') or (`accmaterialsstore`.`sFormId` = '101251240115016109404703250')) and (`accmaterialsstore`.`sWorkOrderNo` <> '') and (left(`accmaterialsstore`.`sWorkOrderNo`,2) <> 'DY')) then `accmaterialsstore`.`dMaterialsMoney` else 0 end)) AS `dMaterials1Money`,sum((case when (((`accmaterialsstore`.`sFormId` = '192116810113315226492535760') or (`accmaterialsstore`.`sFormId` = '101251240115015959856790260') or (`accmaterialsstore`.`sFormId` = '192116810113315222184074940') or (`accmaterialsstore`.`sFormId` = '101251240115016115406953760') or (`accmaterialsstore`.`sFormId` = '192116810113315226622476570') or (`accmaterialsstore`.`sFormId` = '101251240115016109404703250')) and (`accmaterialsstore`.`sWorkOrderNo` <> '') and (left(`accmaterialsstore`.`sWorkOrderNo`,2) = 'DY')) then `accmaterialsstore`.`dMaterialsMoney` else 0 end)) AS `dMaterials2Money`,sum((case when (((`accmaterialsstore`.`sFormId` = '192116810113315226492535760') or (`accmaterialsstore`.`sFormId` = '101251240115015959856790260') or (`accmaterialsstore`.`sFormId` = '192116810113315222184074940') or (`accmaterialsstore`.`sFormId` = '101251240115016115406953760') or (`accmaterialsstore`.`sFormId` = '192116810113315226622476570') or (`accmaterialsstore`.`sFormId` = '101251240115016109404703250')) and (`accmaterialsstore`.`sWorkOrderNo` = '')) then `accmaterialsstore`.`dMaterialsMoney` else 0 end)) AS `dMaterials3Money`,sum((case when (`accmaterialsstore`.`sFormId` = '101801153119616623578840440') then `accmaterialsstore`.`dMaterialsMoney` else 0 end)) AS `dMaterials4Money`,sum((case when (`accmaterialsstore`.`sFormId` = '101251240115015990257724500') then `accmaterialsstore`.`dMaterialsMoney` else 0 end)) AS `dMaterials5Money`,sum((case when (`accmaterialsstore`.`sFormId` = '101251168116315839165634020') then `accmaterialsstore`.`dMaterialsMoney` else 0 end)) AS `dMaterials6Money`,sum((case when (`accmaterialsstore`.`sFormId` = '986502008721788802615003001') then `accmaterialsstore`.`dMaterialsMoney` else 0 end)) AS `dMaterials7Money`,sum((case when ((`accmaterialsstore`.`sFormId` = '192116810113315226492535760') or (`accmaterialsstore`.`sFormId` = '192116810113315222184074940') or (`accmaterialsstore`.`sFormId` = '101251240115016115406953760') or (`accmaterialsstore`.`sFormId` = '192116810113315226622476570') or (`accmaterialsstore`.`sFormId` = '101251240115016109404703250') or (`accmaterialsstore`.`sFormId` = '101801153119616623578840440') or (`accmaterialsstore`.`sFormId` = '192116810113315268872698730') or (`accmaterialsstore`.`sFormId` = '986502008721788802615003001') or (`accmaterialsstore`.`sFormId` = '101251168116315839165634020') or (`accmaterialsstore`.`sFormId` = '101251240115016140459724020')) then `accmaterialsstore`.`dMaterialsMoney` else 0 end)) AS `dMaterials8Money` from `accmaterialsstore` where (0 <> locate(`accmaterialsstore`.`sFormId`,'192116810113315226492535760,192116810113315222184074940, 101251240115016115406953760, 192116810113315226622476570, 101251240115016109404703250,101801153119616623578840440,192116810113315268872698730、986502008721788802615003001,101251168116315839165634020,101251240115016140459724020')) group by `accmaterialsstore`.`sConfirmMonth`,`accmaterialsstore`.`sBrandsId`,`accmaterialsstore`.`sSubsidiaryId`,`accmaterialsstore`.`sMaterialsId`,`accmaterialsstore`.`sFormId`,`accmaterialsstore`.`sMaterialsStyle`
```

## Narrative

_No human-written narrative yet._
