# `viw_accproductstoreoutstoredetail`（视图）


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

## 字段

| # | 名称 | 类型 | 可空 |
|---|---|---|---|
| 1 | `sId` | `varchar(100)` | NO |
| 2 | `sSubsidiaryId` | `varchar(100)` | NO |
| 3 | `sBrandsId` | `varchar(100)` | NO |
| 4 | `sProductId` | `varchar(100)` | NO |
| 5 | `tCreateDate` | `datetime` | NO |
| 6 | `sDefineNo` | `varchar(100)` | YES |
| 7 | `sBillno` | `varchar(255)` | YES |
| 8 | `sCustomerId` | `varchar(50)` | YES |
| 9 | `dProductQty` | `decimal(18,6)` | NO |
| 10 | `iDay` | `bigint` | YES |
| 11 | `dCostPrice` | `decimal(25,13)` | YES |
| 12 | `dCostMoney` | `decimal(18,2)` | YES |
| 13 | `sConfirmMonth` | `varchar(100)` | YES |

## 定义

```sql
select `a`.`sId` AS `sId`,`a`.`sSubsidiaryId` AS `sSubsidiaryId`,`a`.`sBrandsId` AS `sBrandsId`,`a`.`sProductId` AS `sProductId`,`a`.`tCreateDate` AS `tCreateDate`,`a`.`sDefineNo` AS `sDefineNo`,`a`.`sBillNo` AS `sBillno`,`b`.`sCustomerId` AS `sCustomerId`,(case when (`a`.`sFormId` = '11811781131121915184849572550') then -(`a`.`dProductQty`) else `a`.`dProductQty` end) AS `dProductQty`,(to_days(now()) - to_days(`a`.`tCreateDate`)) AS `iDay`,`a`.`dCostPrice` AS `dCostPrice`,(case when (`a`.`sFormId` = '11811781131121915184849572550') then -(`a`.`dCostMoney`) else `a`.`dCostMoney` end) AS `dCostMoney`,`a`.`sConfirmMonth` AS `sConfirmMonth` from (`xlyweberp_saas_ai`.`accproductstore` `a` left join `xlyweberp_saas_ai`.`eleproduct` `b` on((`a`.`sProductId` = `b`.`sId`))) where ((`a`.`bConfirm` = 1) and (`a`.`sFormId` in ('11811781131121915179924491520','11811781131121915179924871530','101251240115015959853077870','11811781131121915184849572550'))) union all select `xlyweberp_saas_ai`.`b`.`sSlaveId` AS `sSlaveId`,`xlyweberp_saas_ai`.`b`.`sSubsidiaryId` AS `sSubsidiaryId`,`xlyweberp_saas_ai`.`b`.`sBrandsId` AS `sBrandsId`,`xlyweberp_saas_ai`.`b`.`sProductId` AS `sProductId`,`xlyweberp_saas_ai`.`b`.`tCreateDate` AS `tCreateDate`,`xlyweberp_saas_ai`.`b`.`sDefineNo` AS `sDefineNo`,`xlyweberp_saas_ai`.`b`.`sSrcNo` AS `sSrcno`,`xlyweberp_saas_ai`.`b`.`sCustomerId` AS `sCustomerId`,`xlyweberp_saas_ai`.`b`.`dProductQty` AS `dProductQty`,(to_days(now()) - to_days(`xlyweberp_saas_ai`.`b`.`tCreateDate`)) AS `datediff(NOW(), tCreateDate)`,`xlyweberp_saas_ai`.`b`.`dCostPrice` AS `dCostPrice`,`xlyweberp_saas_ai`.`b`.`dCostMoney` AS `dCostMoney`,date_format(`xlyweberp_saas_ai`.`b`.`tCreateDate`,'%Y%m') AS `DATE_FORMAT(tCreateDate,'%Y%m')` from `xlyweberp_saas_ai`.`viw_accproductinit` `b` where (`xlyweberp_saas_ai`.`b`.`bCheck` = 1)
```

## 说明

_暂无人工说明。_
