当前位置 : 主页 > 网络编程 > net编程 >

sqlsugar 统计总数超级方便写法

来源:互联网 收集:自由互联 发布时间:2023-09-06
list = list.GroupBy(f = f.ShipmentNum).Select(f = { var o = f.FirstOrDefault(); var number = f.Sum(f1 = f1.Number); o.Number = number; var weight = f.Sum(x = x.Weight); o.Weight = weight; var meterweight = f.Sum(x = x.MeterWeight); o.MeterW
        list = list.GroupBy(f => f.ShipmentNum).Select(f =>
{
var o = f.FirstOrDefault();

var number = f.Sum(f1 => f1.Number);
o.Number = number;

var weight = f.Sum(x => x.Weight);
o.Weight = weight;

var meterweight = f.Sum(x => x.MeterWeight);
o.MeterWeight = meterweight;

o.DeclareTotalPrice = o.DeclarePrice * number; // 申报总价

return o;

}).ToList();

return list;


上一篇:【VB.NET】绘制管道接口圆环
下一篇:没有了
网友评论