sql:=fmt.Sprintf("SELECT time,sum(fee) AS fee FROM bills WHERE uid='%d' and time >= '%s' and time <= '%s' SAMPLE BY 1M ALIGN TO CALENDAR ORDER BY time DESC LIMIT %d,%d;",info.UserID,startTime,endTime,offset,appRequest.Size)
timeCondition=fmt.Sprintf(" and time >= '%s' and time <= '%s'",startTime,endTime)
}
sql:=fmt.Sprintf("SELECT id,type,time,fee,result FROM bills WHERE uid='%d'%s ORDER BY time DESC LIMIT %d,%d;",info.UserID,timeCondition,offset,appRequest.Size)
timeCondition=fmt.Sprintf(" and worker_acc = '%s'",appRequest.WorkerAcc)
}
sql:=fmt.Sprintf("SELECT id,type,time,workload,profit_acc,worker_acc,result FROM bills WHERE %s ORDER BY time DESC LIMIT %d,%d;",timeCondition,offset,appRequest.Size)
sql:=fmt.Sprintf("SELECT id,type,time,workload,profit_acc,worker_acc,result FROM bills %s ORDER BY time DESC LIMIT %d,%d;",timeCondition,offset,appRequest.Size)
sql:=fmt.Sprintf("SELECT time,count(*) FROM bills WHERE time >= '%s' and time <= '%s' %s SAMPLE BY 1d ALIGN TO CALENDAR;",startTime,endTime,timeCondition)
sql:=fmt.Sprintf("SELECT time,count(*) FROM tasks WHERE uid='%d' and time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;",info.UserID,startTime,endTime)
sql:=fmt.Sprintf("SELECT type, time,count(*) FROM tasks WHERE uid='%d' and time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;",info.UserID,startTime,endTime)
sql:=fmt.Sprintf("SELECT time,sum(fee) FROM bills WHERE uid='%d' and time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;",info.UserID,startTime,endTime)
sql:=fmt.Sprintf("SELECT time,sum(fee) AS fee FROM bills WHERE uid='%d' and time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;",info.UserID,startTime,endTime)
sql:=fmt.Sprintf("SELECT type, time,sum(fee) FROM bills WHERE uid='%d' and time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;",info.UserID,startTime,endTime)
sql:=fmt.Sprintf("SELECT type, time,sum(fee) AS fee FROM bills WHERE uid='%d' and time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;",info.UserID,startTime,endTime)
sql:=fmt.Sprintf("SELECT type, sum(fee) AS fee FROM bills WHERE uid='%d' and time >= '%s' and time <= '%s' GROUP BY type;",info.UserID,startTime,endTime)
sql:=fmt.Sprintf("SELECT id, `name` AS tit,type,`desc` AS content, tags ,examples,codes,base_model,api_path,version FROM task_type WHERE deleted = 0 %s LIMIT %d,%d;",where,offset,appRequest.Size)