# `viw_outsidecostmoney_ymw`（视图）


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

## 字段

| # | 名称 | 类型 | 可空 |
|---|---|---|---|
| 1 | `sId` | `varchar(100)` | NO |
| 2 | `sSlaveId` | `varchar(100)` | NO |
| 3 | `sSubsidiaryId` | `varchar(100)` | NO |
| 4 | `sBrandsId` | `varchar(100)` | NO |
| 5 | `sFormId` | `varchar(100)` | NO |
| 6 | `sCostPeriod` | `varchar(100)` | NO |
| 7 | `sSalesOrderNo` | `varchar(100)` | NO |
| 8 | `sWorkOrderNo` | `varchar(100)` | NO |
| 9 | `sProductId` | `varchar(100)` | NO |
| 10 | `sProductName` | `varchar(100)` | NO |
| 11 | `sProductNo` | `varchar(100)` | NO |
| 12 | `sProcessName` | `varchar(100)` | NO |
| 13 | `sBillNo` | `varchar(255)` | NO |
| 14 | `sOutsideType` | `varchar(255)` | NO |
| 15 | `dOutSideCostMoney1` | `decimal(40,6)` | YES |
| 16 | `dOutSideCostMoney2` | `decimal(40,6)` | YES |
| 17 | `dOutSideCostMoney3` | `decimal(40,6)` | YES |
| 18 | `dOutSideCostMoney4` | `decimal(40,6)` | YES |
| 19 | `dOutSideCostMoney5` | `decimal(40,6)` | YES |
| 20 | `dOutSideCostMoney6` | `decimal(40,6)` | YES |
| 21 | `dOutSideCostMoney8` | `decimal(40,6)` | YES |
| 22 | `dOutSideCostMoney7` | `decimal(40,6)` | YES |

## 定义

```sql
select `xlyweberp_saas_ai`.`accordercostanalysis`.`sId` AS `sId`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sId` AS `sSlaveId`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sSubsidiaryId` AS `sSubsidiaryId`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sBrandsId` AS `sBrandsId`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sFormId` AS `sFormId`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sCostPeriod` AS `sCostPeriod`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sSalesOrderNo` AS `sSalesOrderNo`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sWorkOrderNo` AS `sWorkOrderNo`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sProductId` AS `sProductId`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sProductName` AS `sProductName`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sProductNo` AS `sProductNo`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sProcessName` AS `sProcessName`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sBillNo` AS `sBillNo`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sOutsideType` AS `sOutsideType`,sum((case when ((`xlyweberp_saas_ai`.`accordercostanalysis`.`iType` = 5) and (`xlyweberp_saas_ai`.`accordercostanalysis`.`sOutsideType` = 'outside')) then ifnull(`xlyweberp_saas_ai`.`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney1`,sum((case when ((`xlyweberp_saas_ai`.`accordercostanalysis`.`iType` = 3) and (`xlyweberp_saas_ai`.`accordercostanalysis`.`sOutsideType` = 'outside')) then ifnull(`xlyweberp_saas_ai`.`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney2`,sum((case when ((`xlyweberp_saas_ai`.`accordercostanalysis`.`iType` = 7) and (`xlyweberp_saas_ai`.`accordercostanalysis`.`sOutsideType` = 'outside')) then ifnull(`xlyweberp_saas_ai`.`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney3`,sum((case when ((`xlyweberp_saas_ai`.`accordercostanalysis`.`iType` = 5) and (`xlyweberp_saas_ai`.`accordercostanalysis`.`sOutsideType` = 'productOutside')) then ifnull(`xlyweberp_saas_ai`.`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney4`,sum((case when ((`xlyweberp_saas_ai`.`accordercostanalysis`.`iType` = 3) and (`xlyweberp_saas_ai`.`accordercostanalysis`.`sOutsideType` = 'productOutside')) then ifnull(`xlyweberp_saas_ai`.`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney5`,sum((case when ((`xlyweberp_saas_ai`.`accordercostanalysis`.`iType` = 7) and (`xlyweberp_saas_ai`.`accordercostanalysis`.`sOutsideType` = 'productOutside')) then ifnull(`xlyweberp_saas_ai`.`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney6`,sum((case when (`xlyweberp_saas_ai`.`accordercostanalysis`.`sOutsideType` = 'productOutside') then ifnull(`xlyweberp_saas_ai`.`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney8`,sum((case when (`xlyweberp_saas_ai`.`accordercostanalysis`.`sOutsideType` = 'outside') then ifnull(`xlyweberp_saas_ai`.`accordercostanalysis`.`dOutSideCostMoney`,0) else 0 end)) AS `dOutSideCostMoney7` from `xlyweberp_saas_ai`.`accordercostanalysis` where (`xlyweberp_saas_ai`.`accordercostanalysis`.`iType` in (3,5,7)) group by `xlyweberp_saas_ai`.`accordercostanalysis`.`sCostPeriod`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sSalesOrderNo`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sWorkOrderNo`,`xlyweberp_saas_ai`.`accordercostanalysis`.`sProductId`
```

## 说明

_暂无人工说明。_
