//sql = fmt.Sprintf("SELECT id,type,time,fee,in_len FROM tasks WHERE uid='%d'%s%s ORDER BY time DESC LIMIT %d,%d;", info.UserID, cond, timeCondition, offset, size)
//if info.Role == 1 || info.Role == 2 {
//sql = fmt.Sprintf("SELECT id,type,time,fee,in_len FROM tasks WHERE uid='%d'%s%s ORDER BY time DESC LIMIT %d,%d;", token.UserID, cond, timeCondition, offset, size)
//if token.Role == 1 || token.Role == 2 {
// sql = fmt.Sprintf("SELECT id,type,time,fee,in_len FROM tasks WHERE %s ORDER BY time DESC LIMIT %d,%d;", timeCondition, offset, size)
//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)
//if info.Role == 1 || info.Role == 2 {
//sql := fmt.Sprintf("SELECT time,count(*) FROM tasks WHERE uid='%d' and time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;", token.UserID, startTime, endTime)
//if token.Role == 1 || token.Role == 2 {
// sql = fmt.Sprintf("SELECT time,count(*) FROM tasks WHERE time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;", 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)
//if info.Role == 1 || info.Role == 2 {
//sql := fmt.Sprintf("SELECT type, time,count(*) FROM tasks WHERE uid='%d' and time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;", token.UserID, startTime, endTime)
//if token.Role == 1 || token.Role == 2 {
// sql = fmt.Sprintf("SELECT type, time,count(*) FROM tasks WHERE time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;", startTime, endTime)
//sql := fmt.Sprintf("SELECT type, count(type) FROM tasks WHERE uid='%d' and time >= '%s' and time <= '%s' GROUP BY type;", info.UserID, startTime, endTime)
//if info.Role == 1 || info.Role == 2 {
//sql := fmt.Sprintf("SELECT type, count(type) FROM tasks WHERE uid='%d' and time >= '%s' and time <= '%s' GROUP BY type;", token.UserID, startTime, endTime)
//if token.Role == 1 || token.Role == 2 {
// sql = fmt.Sprintf("SELECT type, count(type) FROM tasks WHERE time >= '%s' and time <= '%s' GROUP BY type;", 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)
//if info.Role == 1 || info.Role == 2 {
//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;", token.UserID, startTime, endTime)
//if token.Role == 1 || token.Role == 2 {
// sql = fmt.Sprintf("SELECT time,sum(fee) AS fee FROM bills WHERE time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;", 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)
//if info.Role == 1 || info.Role == 2 {
//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;", token.UserID, startTime, endTime)
//if token.Role == 1 || token.Role == 2 {
// sql = fmt.Sprintf("SELECT time,sum(fee) AS fee FROM bills WHERE time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;", 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)
//if info.Role == 1 || info.Role == 2 {
//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;", token.UserID, startTime, endTime)
//if token.Role == 1 || token.Role == 2 {
// sql = fmt.Sprintf("SELECT type, time,sum(fee) AS fee FROM bills WHERE time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR;", 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)
//if info.Role == 1 || info.Role == 2 {
//sql := fmt.Sprintf("SELECT type, sum(fee) AS fee FROM bills WHERE uid='%d' and time >= '%s' and time <= '%s' GROUP BY type;", token.UserID, startTime, endTime)
//if token.Role == 1 || token.Role == 2 {
// sql = fmt.Sprintf("SELECT type, sum(fee) AS fee FROM bills WHERE time >= '%s' and time <= '%s' GROUP BY type;", startTime, endTime)