diff --git a/NX.ERP.U8/Mom/BomDAL.cs b/NX.ERP.U8/Mom/BomDAL.cs index 3bf7e83..14e7ecd 100644 --- a/NX.ERP.U8/Mom/BomDAL.cs +++ b/NX.ERP.U8/Mom/BomDAL.cs @@ -18,7 +18,10 @@ namespace NX.ERP.U8.Mom /// public IEnumerable GetList(string strWhere="", object Params = null) { - var strSQL = @"select ISNULL(a.ModifyDate,CreateDate) ModifyDate,CONVERT(BIGINT,a.Ufts) AS pubufts,a.BomId,a.Version,a.Status, a.VersionDesc,a.BomType,c.InvCode as ParentCode ,x.cInvName as ParentName ,x.cInvStd as ParentSpecsModel,' ' as id ,d.BomId, d.SortSeq, + var strSQL = @"select ISNULL(a.ModifyDate,CreateDate) ModifyDate, + --CONVERT(BIGINT,a.Ufts) AS pubufts, + case when(d.Ufts>a.Ufts) then CONVERT(BIGINT,d.Ufts) else CONVERT(BIGINT,a.Ufts) end AS pubufts, + a.BomId,a.Version,a.Status, a.VersionDesc,a.BomType,c.InvCode as ParentCode ,x.cInvName as ParentName ,x.cInvStd as ParentSpecsModel,' ' as id ,d.BomId, d.SortSeq, e.InvCode as ComponentCode ,y.cInvName as ComponentName,y.cInvStd as ComponentSpecsModel ,d.BaseQtyN, d.BaseQtyD ,f.WIPType,d.EffBegDate,d.EffEndDate from bom_bom as a left join bom_parent as b on a.BomId=b.BomId left join bas_part as c on b.ParentId=c.PartId @@ -55,7 +58,7 @@ namespace NX.ERP.U8.Mom public IEnumerable GetList(long Pubufts) { - return this.GetList("CONVERT(BIGINT,a.Ufts) >@Pubufts", new { Pubufts }); + return this.GetList("CONVERT(BIGINT,a.Ufts) > @Pubufts or CONVERT(BIGINT,d.Ufts) > @Pubufts", new { Pubufts }); }