• Linq 多连接及 left join 实例 记录


    var retList = from d in mbExList.Cast<MaterialBaseEx>().ToList()
    join c in umcList.Cast<ClassifyBaseEx>().ToList() on d.ClsCode equals c.ClsCode
    join b in collectItem.Cast<CollectItem>().ToList() on d.Guid equals b.MatID into temp
    join e in mlpList.Cast<MaterialLastPrice>().ToList() on d.MatCode equals e.MatCode into tempxx
    from tt in temp.DefaultIfEmpty()
    from xx in tempxx.DefaultIfEmpty()
    where (d.IsPublish.Equals(true)) || tt != null
    select new MaterialPriceCollect
    {
    Guid = Guid.NewGuid().ToString(),
    MatCode = d.MatCode,
    //Area = areaRec.Text,
    PriceType = 1,
    State = 2,
    MatName = d.MatName==null?"":d.MatName,
    Unit = d.MatUnit == null ? "" : d.MatUnit,
    MatType = d.MatModel == null ? "" : d.MatModel,
    LastPrice = (xx==null || xx.LastPrice == null) ? 0 : xx.LastPrice,
    UserId = "_" + userId + ",",
    MatId = d.Guid == null ? "" : d.Guid,
    IsFrequently = (int)EumIsFrequently.否,
    //ReportTime = DateTime.Now,
    Weight = (tt==null ||tt.Weight == null) ? 1 : tt.Weight,
    //AreaCode = areaRec.Id,
    //PeriodNo = objMat.CurPeriodNo,
    };

  • 相关阅读:
    (01)Hadoop简介
    (08)java程序连接kafka示例
    (02)使用 java -classpath 命令运行jar包脚本
    (01)Eclipse中导出jar包
    (07)Kafka核心配置详解
    (06)Kafka工作原理解析
    HDU
    HDU
    POJ3525:Most Distant Point from the Sea(二分+半平面交)
    POJ
  • 原文地址:https://www.cnblogs.com/xiaoruilin/p/6100785.html
Copyright © 2020-2023  润新知