# `viw_product_m`（视图）


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

## 字段

| # | 名称 | 类型 | 可空 |
|---|---|---|---|
| 1 | `sProductName` | `varchar(100)` | NO |
| 2 | `sProductNo` | `varchar(50)` | NO |
| 3 | `sProductStyle` | `varchar(50)` | NO |
| 4 | `sProductUnit` | `varchar(50)` | YES |
| 5 | `sCustomerProductNo` | `varchar(50)` | YES |
| 6 | `sId` | `varchar(50)` | NO |
| 7 | `sAllPartsName` | `varchar(100)` | YES |
| 8 | `sProductId` | `varchar(50)` | NO |
| 9 | `sProductClassifyId` | `varchar(50)` | YES |
| 10 | `sType` | `varchar(50)` | YES |
| 11 | `tCreateDate` | `datetime` | NO |
| 12 | `sCustomerId` | `varchar(50)` | YES |
| 13 | `sParentId` | `varchar(50)` | NO |
| 14 | `sProductClassifyName` | `varchar(100)` | YES |
| 15 | `sParentProductId` | `varchar(50)` | YES |
| 16 | `sBrandsId` | `varchar(50)` | NO |
| 17 | `sSubsidiaryId` | `varchar(50)` | NO |

## 定义

```sql
select distinct `a`.`sProductName` AS `sProductName`,`a`.`sProductNo` AS `sProductNo`,`a`.`sProductStyle` AS `sProductStyle`,`a`.`sProductUnit` AS `sProductUnit`,`a`.`sCustomerProductNo` AS `sCustomerProductNo`,`a`.`sId` AS `sId`,`b`.`sAllPartsName` AS `sAllPartsName`,`a`.`sId` AS `sProductId`,`b`.`sId` AS `sProductClassifyId`,`b`.`sType` AS `sType`,`a`.`tCreateDate` AS `tCreateDate`,(case when ((`c`.`sCustomerId` is null) or (`a`.`sParentProductId` = '2')) then `a`.`sCustomerId` else `c`.`sCustomerId` end) AS `sCustomerId`,`a`.`sParentId` AS `sParentId`,`b`.`sName` AS `sProductClassifyName`,`a`.`sParentProductId` AS `sParentProductId`,`a`.`sBrandsId` AS `sBrandsId`,`a`.`sSubsidiaryId` AS `sSubsidiaryId` from ((`xlyweberp_saas_ai`.`eleproduct` `a` left join `xlyweberp_saas_ai`.`sisproductclassify` `b` on(((`a`.`sParentId` = `b`.`sId`) and (`a`.`sBrandsId` = `b`.`sBrandsId`) and (`a`.`sSubsidiaryId` = `b`.`sSubsidiaryId`)))) left join `xlyweberp_saas_ai`.`eleproductcustomer` `c` on(((`a`.`sId` = `c`.`sParentId`) and (`a`.`sBrandsId` = `c`.`sBrandsId`) and (`a`.`sSubsidiaryId` = `c`.`sSubsidiaryId`)))) where ((`a`.`bInvalid` = 0) or (`a`.`sParentProductId` = '2'))
```

## 说明

_暂无人工说明。_
