You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
698 B
18 lines
698 B
using System;
|
|
using PetaPoco;
|
|
using Pingchuan.BeijingSafeguard.Model;
|
|
|
|
namespace Pingchuan.BeijingSafeguard.DAL
|
|
{
|
|
public class ComputeDAL : BaseDAL
|
|
{
|
|
public static Pagination<Statistic> Statistics(DateTime fromTime, DateTime toTime, int pageIndex, int pageSize)
|
|
{
|
|
string sql = $@"select user_id, count(*) total_count, max(create_time) last_time from computes
|
|
where create_time >= @0 and create_time <= @1
|
|
group by user_id";
|
|
Page<Statistic> page = db.Page<Statistic>(pageIndex, pageSize, sql, pageIndex, pageSize);
|
|
return Pagination<Statistic>.FromPage(page);
|
|
}
|
|
}
|
|
}
|
|
|