服务数据接口小变动

This commit is contained in:
lingwentao 2023-08-02 18:13:58 +08:00
parent 965e55119d
commit 118b224748
2 changed files with 3 additions and 1 deletions

View File

@ -26,6 +26,8 @@ export class OpenDataController {
if (!limitSize){
if (Number(type)){
limitSize=10
}else {
limitSize=24
}
}
return this.openDataService.userData(areaCode,type,limitSize);

View File

@ -296,7 +296,7 @@ class OpenDataMapper {
let sql
switch (type) {
case 0:
sql='SELECT a.stat_time AS time,a.`value`,c.address_code as addressCode from szja_live_stat_hour a LEFT JOIN szja_user_home b ON b.user_id=a.user_id LEFT JOIN szja_hcc_info c ON c.id=b.hcc_id WHERE TIMESTAMPDIFF(HOUR,a.create_time,now()) <= 24'
sql='SELECT a.stat_time AS time,a.`value`,c.address_code as addressCode from szja_live_stat_hour a LEFT JOIN szja_user_home b ON b.user_id=a.user_id LEFT JOIN szja_hcc_info c ON c.id=b.hcc_id WHERE TIMESTAMPDIFF(HOUR,a.create_time,now()) <= ?'
break
case 1:
sql='SELECT a.stat_time AS time,a.`value`,c.address_code as addressCode from szja_live_stat_day a LEFT JOIN szja_user_home b ON b.user_id=a.user_id LEFT JOIN szja_hcc_info c ON c.id=b.hcc_id WHERE TIMESTAMPDIFF(DAY,a.create_time,now()) <= ?'