Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ncov
/
back
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
lintry
2020-02-13 14:21:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
553e3dc5fef5bca388d8df33f61178a742848f55
553e3dc5
1 parent
e4d993a1
调整对省的查询条件位置
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletions
server/entities/sars.js
server/routers/c/info_action.js
server/entities/sars.js
0 → 100644
View file @
553e3dc
"use strict"
;
/**
* SARS统计数据
*/
module
.
exports
=
function
(
sequelize
,
DataTypes
)
{
const
AbstractPO
=
require
(
'kml-po-abstract'
),
_
=
require
(
'lodash'
);
let
option
=
AbstractPO
.
RawOption
({
tableName
:
'tb_mf_sars'
});
let
entity
=
_
.
merge
({
"report_date"
:
{
"type"
:
DataTypes
.
STRING
(
40
),
"comment"
:
"report_date"
,
"field"
:
"report_date"
,
"allowNull"
:
false
,
"primaryKey"
:
true
},
"confirmed"
:
{
"type"
:
DataTypes
.
BIGINT
,
"comment"
:
"确认人数"
,
"field"
:
"confirmed"
},
"suspected"
:
{
"type"
:
DataTypes
.
BIGINT
,
"comment"
:
"疑似人数"
,
"field"
:
"suspected"
},
"dead"
:
{
"type"
:
DataTypes
.
BIGINT
,
"comment"
:
"死亡人数"
,
"field"
:
"dead"
},
"comment"
:
{
"type"
:
DataTypes
.
STRING
(
200
),
"comment"
:
"注释"
,
"field"
:
"comment"
},
"country"
:
{
"type"
:
DataTypes
.
STRING
(
40
),
"comment"
:
"国家"
,
"field"
:
"country"
}
});
return
sequelize
.
define
(
'sars'
,
entity
,
option
);
};
server/routers/c/info_action.js
View file @
553e3dc
...
...
@@ -48,7 +48,6 @@ module.exports = function (dbo) {
from days d
left join ta on ta.update_time = d.today
where country notnull
and province ~ :province
order by 1,2,3
)
, pr as (
...
...
@@ -76,6 +75,7 @@ module.exports = function (dbo) {
jsonb_agg(increase order by today) increase,
max(confirmed_sum) confirmed_sum
from ( select *, sum(confirmed_count) over(partition by country, today) confirmed_sum from rpt
where province ~ :province
) t
group by 1,2
union all
...
...
Please
register
or
login
to post a comment