# `viw_sysmsg` (view)


- **Updatable:** NO

## Columns

| # | Name | Type | Null |
|---|---|---|---|
| 1 | `iIncrement` | `int` | YES |
| 2 | `sId` | `varchar(100)` | YES |
| 3 | `sBrandsId` | `varchar(100)` | YES |
| 4 | `sSubsidiaryId` | `varchar(100)` | YES |
| 5 | `tCreateDate` | `datetime` | YES |
| 6 | `sMakePerson` | `varchar(255)` | YES |
| 7 | `iOrder` | `int` | YES |
| 8 | `sBillId` | `varchar(100)` | YES |
| 9 | `tBillDate` | `datetime` | YES |
| 10 | `sType` | `varchar(255)` | YES |
| 11 | `sCheckPerson` | `longtext` | YES |
| 12 | `sCheckPersonName` | `longtext` | YES |
| 13 | `sTitle` | `varchar(255)` | YES |
| 14 | `sContent` | `text` | YES |
| 15 | `sBillNo` | `varchar(255)` | YES |
| 16 | `sFormId` | `varchar(100)` | YES |
| 17 | `sCheckModelId` | `varchar(100)` | YES |
| 18 | `sMemo` | `text` | YES |
| 19 | `sCheckStatus` | `varchar(255)` | YES |
| 20 | `sParentId` | `varchar(100)` | YES |
| 21 | `sUserId` | `varchar(100)` | YES |
| 22 | `bIsView` | `bit(1)` | YES |
| 23 | `bReply` | `bit(1)` | YES |
| 24 | `sStatus` | `varchar(1)` | NO |

## Definition

```sql
select `s`.`iIncrement` AS `iIncrement`,`s`.`sId` AS `sId`,`s`.`sBrandsId` AS `sBrandsId`,`s`.`sSubsidiaryId` AS `sSubsidiaryId`,`s`.`tCreateDate` AS `tCreateDate`,`s`.`sMakePerson` AS `sMakePerson`,`s`.`iOrder` AS `iOrder`,`s`.`sBillId` AS `sBillId`,`s`.`tBillDate` AS `tBillDate`,`s`.`sType` AS `sType`,if((ifnull((select group_concat(`b`.`sUserName` separator ',') from `sftlogininfo` `b` where (find_in_set(`b`.`sId`,`s`.`sCheckPerson`) > 0)),'') = ''),`s`.`sCheckPerson`,(select group_concat(`b`.`sUserName` separator ',') from `sftlogininfo` `b` where (find_in_set(`b`.`sId`,`s`.`sCheckPerson`) > 0))) AS `sCheckPerson`,(select group_concat(`b`.`sUserName` separator ',') from `sftlogininfo` `b` where (find_in_set(`b`.`sId`,`s`.`sCheckPerson`) > 0)) AS `sCheckPersonName`,`s`.`sTitle` AS `sTitle`,`s`.`sContent` AS `sContent`,`s`.`sBillNo` AS `sBillNo`,`s`.`sFormId` AS `sFormId`,`s`.`sCheckModelId` AS `sCheckModelId`,`s`.`sMemo` AS `sMemo`,`s`.`sCheckStatus` AS `sCheckStatus`,`u`.`sParentId` AS `sParentId`,`u`.`sUserId` AS `sUserId`,`u`.`bIsView` AS `bIsView`,`u`.`bReply` AS `bReply`,(case when (ifnull(`u`.`bIsView`,0) = 0) then '0' else (case when (`s`.`sCheckStatus` = '1') then '1' when (`s`.`sCheckStatus` = '2') then '2' when (`s`.`sCheckStatus` = '0') then '3' else if((`s`.`sCheckStatus` is null),'4','5') end) end) AS `sStatus` from (`sysmsg` `s` left join `sysmsguser` `u` on((`s`.`sId` = `u`.`sParentId`)))
```

## Narrative

_No human-written narrative yet._
