# 收案人數統計
## 查詢列表
```url=
POST /statistics/case
```
| 欄位 | 型態 | 必填 | 說明 |
|---|---|---|---|---|
| startDate | number | true | 查尋起始日期 |
| endDate | number | true | 查尋結束日期 |
| organizationId | array | true | 單位組織
| caseTypeList | array | true| null: 個案新增日 array: 收案日
Payload:
```json=
{
"startDate": 1591001165037,
"endDate": 1591001165037,
"organizationId": [1,2,3],
"caseCreated" : false,
"caseTypeList": [
{
"caseTypeId": 5,
"caseStatusId": 10
},
{
"caseTypeId": 6,
"caseStatusId": 14
}
]
}
```
| 欄位 | 型態 | 預設 | 說明 |
|---|---|---|---|---|
| beforeTotal | object |無| 搜尋起始日之前累計資料 |
| - male | number |無| 男 |
| - female | number | 無 | 女
| - sum | number | 無 | 加總
| - total | number | 無 | 累計
| - date | timestamp | 無 | 日期
| statistics | array |無| 查詢時間內的資料 |
| - male | number |無| 男 |
| - female | number | 無 | 女
| - sum | number | 無 | 加總
| - total | number | 無 | 累計
| - date | timestamp | 無 | 日期
Response (成功):
```json=
{
"success": true,
"data": {
"beforeTotal": {
"male": 100,
"female": 200,
"sum": 300,
"total":3500,
"date": 1593561600000,
},
"statistics": [
{
"male": 100,
"female": 200,
"sum": 300,
"total":3800,
"date": 1593561600000,
},
{
"male": 100,
"female": 200,
"sum": 300,
"total":4100,
"date": 1596240000000,
},
]
}
}
```
## 匯出
```url=
POST /statistics/case/export
```
| 欄位 | 型態 | 必填 | 說明 |
|---|---|---|---|---|
| startDate | number |true| 報表期間起始日期 |
| endDate | number |true| 報表期間結束日期 |
| organizationId | array | true | 單位組織 |
| caseTypeList | array | true| null: 個案新增日 array: 收案日
| statistics | boolean | true | 統計
| detail | boolean | true | 明細
Payload:
```json=
{
"startDate": 1591001165037,
"endDate": 1591001165037,
"
"detail": true,
"organizationId": [1,2,3]
"caseTypeList": [
{
"caseTypeId": 5,
"caseStatusId": 10,
"operator": "or"
},
{
"caseTypeId": 6,
"caseStatusId": 14,
"operator": "and"
}
]
}
```
Response (成功):
```json=
{
"success": true,
"data": {
}
}
```