# `viw_outstroredepart` (view)


- **Updatable:** NO

## Columns

| # | Name | Type | Null |
|---|---|---|---|
| 1 | `sId` | `varchar(63)` | YES |
| 2 | `sSlaveId` | `varchar(63)` | YES |
| 3 | `sDepartId` | `varchar(100)` | YES |
| 4 | `sMaterialsId` | `varchar(100)` | YES |
| 5 | `sBillNo` | `varchar(255)` | YES |
| 6 | `dMaterials1Money` | `decimal(40,2)` | YES |
| 7 | `sConfirmMonth` | `varchar(100)` | YES |
| 8 | `sBrandsId` | `varchar(100)` | YES |
| 9 | `sSubsidiaryId` | `varchar(100)` | YES |

## Definition

```sql
select 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`.`sDepartId` AS `sDepartId`,`accmaterialsstore`.`sMaterialsId` AS `sMaterialsId`,`accmaterialsstore`.`sBillNo` AS `sBillNo`,(case when ((`accmaterialsstore`.`sFormId` = '192116810113315226492535760') or (`accmaterialsstore`.`sFormId` = '101251240115015959856790260') or (`accmaterialsstore`.`sFormId` = '192116810113315226622476570') or (`accmaterialsstore`.`sFormId` = '101251240115016109404703250')) then sum(`accmaterialsstore`.`dMaterialsMoney`) else 0 end) AS `dMaterials1Money`,`accmaterialsstore`.`sConfirmMonth` AS `sConfirmMonth`,`accmaterialsstore`.`sBrandsId` AS `sBrandsId`,`accmaterialsstore`.`sSubsidiaryId` AS `sSubsidiaryId` from `accmaterialsstore` where (`accmaterialsstore`.`sFormId` in ('192116810113315226492535760','101251240115015959856790260','192116810113315226622476570','101251240115016109404703250')) group by `accmaterialsstore`.`sDepartId`,`accmaterialsstore`.`sMaterialsId`,`accmaterialsstore`.`sConfirmMonth`,`accmaterialsstore`.`sBrandsId`,`accmaterialsstore`.`sSubsidiaryId`
```

## Narrative

_No human-written narrative yet._
