string Sql = @"declare @AllCount int;---总人数
select @AllCount = COUNT(*) from HumanMainInfo where DATALENGTH(LizhiDate) <1
select Bumen as '部门' , COUNT(*) as '人数',CAST(COUNT(*) as decimal(10,2))/CAST(@AllCount as decimal(10,2))*100 as '百分比' from HumanMainInfo group by Bumen";
DataTable dt = new DataTable("Bumen");
using (IDbConnection con = DapperConnFactory.Instance.GetOpenConn())//获取con 执行Dapper查询
{
var reader = con.ExecuteReader(Sql);
dt.Load(reader);
return dt;
}
dapper读取数据库后获取DataTable
最新推荐文章于 2024-08-07 02:15:43 发布