|
@@ -247,7 +247,7 @@ func getCreatePeriodCount(dateBeginTime string, dateEndTime string, hourBeginTim |
|
|
func getRunPeriodCount(dateBeginTime string, dateEndTime string, hourBeginTime string, hourEndTime string) (int64, error) { |
|
|
func getRunPeriodCount(dateBeginTime string, dateEndTime string, hourBeginTime string, hourEndTime string) (int64, error) { |
|
|
countSql := "SELECT count(*) FROM " + |
|
|
countSql := "SELECT count(*) FROM " + |
|
|
"public.cloudbrain where not ((to_char(to_timestamp(start_time), ' HH24:MI:SS') > '" + hourEndTime + |
|
|
"public.cloudbrain where not ((to_char(to_timestamp(start_time), ' HH24:MI:SS') > '" + hourEndTime + |
|
|
"') or (to_char(to_timestamp(end_time), 'HH24:MI:SS') < '" + hourBeginTime + "'))" + |
|
|
|
|
|
|
|
|
"') or (to_char(to_timestamp(COALESCE(end_time,EXTRACT(epoch FROM now()))), 'HH24:MI:SS') < '" + hourBeginTime + "'))" + |
|
|
" and (to_char(to_timestamp(start_time), 'YYYY-MM-DD') >= '" + dateBeginTime + |
|
|
" and (to_char(to_timestamp(start_time), 'YYYY-MM-DD') >= '" + dateBeginTime + |
|
|
"' and to_char(to_timestamp(start_time), 'YYYY-MM-DD') < '" + dateEndTime + "')" |
|
|
"' and to_char(to_timestamp(start_time), 'YYYY-MM-DD') < '" + dateEndTime + "')" |
|
|
return x.SQL(countSql).Count() |
|
|
return x.SQL(countSql).Count() |
|
|