This commit is contained in:
杰 朱
2021-10-20 21:20:25 +08:00
parent 0cd0b70837
commit d47cd74f95

View File

@@ -905,141 +905,143 @@ select *from tempdb..tablepzck20210526
// where.Add(" a.iQuantity - isnull(d.cqty,0) >0 and b.cVerifier is not null "); // where.Add(" a.iQuantity - isnull(d.cqty,0) >0 and b.cVerifier is not null ");
where.Add(" mm.wfiQuantity >0 and mm.cVerifier is not null "); where.Add(" mm.wfiQuantity >0 and mm.cVerifier is not null ");
if(info1 !=null)
if (!string.IsNullOrEmpty(info1.cCusAbbName))
{ {
where.Add(" mm.cCusAbbName like @cCusAbbName ");
}
if (!string.IsNullOrEmpty(info1.dDate)) if (!string.IsNullOrEmpty(info1.cCusAbbName))
{
where.Add(" mm.dDate = @dDate ");
}
if (!string.IsNullOrEmpty(info1.cSOCode))
{
where.Add(" mm.cSOCode = @cSOCode ");
}
if (!string.IsNullOrEmpty(info1.cInvCode))
{
where.Add(" mm.cInvCode like @cInvCode ");
}
if (!string.IsNullOrEmpty(info1.cInvName))
{
where.Add(" mm.cInvName like @cInvName ");
}
if (!string.IsNullOrEmpty(info1.cInvStd))
{
where.Add(" mm.cInvStd like @cInvStd ");
}
if (!string.IsNullOrEmpty(info1.cMemo))
{
where.Add(" mm.cMemo like @cMemo ");
}
if (!string.IsNullOrEmpty(info1.dPreDate))
{
where.Add(" mm.dPreDate = @dPreDate ");
}
if (!string.IsNullOrEmpty(info1.wfiQuantity))
{
where.Add(" mm.wfiQuantity = @wfiQuantity ");
}
if (!string.IsNullOrEmpty(info1.kcyl))
{
where.Add(" mm.kcyl = @kcyl ");
}
if (!string.IsNullOrEmpty(info1.jandate))
{
where.Add(" mm.jandate = @jandate ");
}
if (!string.IsNullOrEmpty(info1.kcyl2))
{
if (info1.kcyl2 == "1")
{ {
where.Add(" mm.kcyl <= 0 "); where.Add(" mm.cCusAbbName like @cCusAbbName ");
}
else if (info1.kcyl2 == "2")
{
where.Add(" mm.kcyl > 0 ");
} }
} if (!string.IsNullOrEmpty(info1.dDate))
if (!string.IsNullOrEmpty(info1.datewaring))
{
if (info1.datewaring == "1")
{ {
where.Add(" (mm.jandate > -15 AND mm.jandate < 0) "); where.Add(" mm.dDate = @dDate ");
}
else if (info1.datewaring == "2")
{
where.Add("(mm.jandate <= -15) ");
}
else if (info1.datewaring == "3")
{
where.Add("(mm.jandate >= 0) ");
} }
} if (!string.IsNullOrEmpty(info1.cSOCode))
/*
if (info1.InvCodes != null)
{
where.Add(" mm.cinvcode in @cinvcode");
}
if (!string.IsNullOrEmpty(info1.InvStd))
{
where.Add(" mm.cInvStd like @cInvStd ");
}
if (info1.SoCodes != null)
{
where.Add(" mm.cSOCode in @SoCodes ");
}
*/
if (info1.flag != null && info1.flag.ToList().Count>0)
{
List<string> str = new List<string>();
foreach (var item in info1.flag)
{ {
if (item == "1") where.Add(" mm.cSOCode = @cSOCode ");
}
if (!string.IsNullOrEmpty(info1.cInvCode))
{
where.Add(" mm.cInvCode like @cInvCode ");
}
if (!string.IsNullOrEmpty(info1.cInvName))
{
where.Add(" mm.cInvName like @cInvName ");
}
if (!string.IsNullOrEmpty(info1.cInvStd))
{
where.Add(" mm.cInvStd like @cInvStd ");
}
if (!string.IsNullOrEmpty(info1.cMemo))
{
where.Add(" mm.cMemo like @cMemo ");
}
if (!string.IsNullOrEmpty(info1.dPreDate))
{
where.Add(" mm.dPreDate = @dPreDate ");
}
if (!string.IsNullOrEmpty(info1.wfiQuantity))
{
where.Add(" mm.wfiQuantity = @wfiQuantity ");
}
if (!string.IsNullOrEmpty(info1.kcyl))
{
where.Add(" mm.kcyl = @kcyl ");
}
if (!string.IsNullOrEmpty(info1.jandate))
{
where.Add(" mm.jandate = @jandate ");
}
if (!string.IsNullOrEmpty(info1.kcyl2))
{
if (info1.kcyl2 == "1")
{ {
str.Add(" (mm.jandate > -15 AND mm.jandate < 0) "); where.Add(" mm.kcyl <= 0 ");
} }
else if (item == "2") else if (info1.kcyl2 == "2")
{ {
str.Add(" (mm.jandate <= -15) "); where.Add(" mm.kcyl > 0 ");
}
else
{
str.Add(" (mm.jandate >= 0) ");
} }
} }
if (!string.IsNullOrEmpty(info1.datewaring))
{
if (info1.datewaring == "1")
{
where.Add(" (mm.jandate > -15 AND mm.jandate < 0) ");
}
else if (info1.datewaring == "2")
{
where.Add("(mm.jandate <= -15) ");
}
else if (info1.datewaring == "3")
{
where.Add("(mm.jandate >= 0) ");
}
var strs = string.Join(" or ", str.ToArray()); }
strs = " ( " + strs + " ) "; /*
where.Add(strs); if (info1.InvCodes != null)
{
where.Add(" mm.cinvcode in @cinvcode");
}
if (!string.IsNullOrEmpty(info1.InvStd))
{
where.Add(" mm.cInvStd like @cInvStd ");
}
if (info1.SoCodes != null)
{
where.Add(" mm.cSOCode in @SoCodes ");
}
*/
if (info1.flag != null && info1.flag.ToList().Count>0)
{
List<string> str = new List<string>();
foreach (var item in info1.flag)
{
if (item == "1")
{
str.Add(" (mm.jandate > -15 AND mm.jandate < 0) ");
}
else if (item == "2")
{
str.Add(" (mm.jandate <= -15) ");
}
else
{
str.Add(" (mm.jandate >= 0) ");
}
}
var strs = string.Join(" or ", str.ToArray());
strs = " ( " + strs + " ) ";
where.Add(strs);
}
} }
var aa = string.Join(" and ", where.ToArray()); var aa = string.Join(" and ", where.ToArray());
if (!string.IsNullOrEmpty(aa)) if (!string.IsNullOrEmpty(aa))
@@ -1049,7 +1051,9 @@ select *from tempdb..tablepzck20210526
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection) using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
{ {
return conn.Query<object>(sql, new { cCusAbbName = $"%{info1.cCusAbbName}%", dDate = info1.dDate, dPreDate = info1.dPreDate, cSOCode = info1.cSOCode, cInvCode = $"%{info1.cInvCode}%" , cInvName = $"%{info1.cInvName}%" , cInvStd = $"%{info1.cInvStd}%" , cMemo = $"%{info1.cMemo}%", SoCodes = info1.SoCodes, info1.jandate, info1.wfiQuantity, info1.kcyl, }); try { return conn.Query<object>(sql, new { cCusAbbName = $"%{info1.cCusAbbName}%", dDate = info1.dDate, dPreDate = info1.dPreDate, cSOCode = info1.cSOCode, cInvCode = $"%{info1.cInvCode}%", cInvName = $"%{info1.cInvName}%", cInvStd = $"%{info1.cInvStd}%", cMemo = $"%{info1.cMemo}%", SoCodes = info1.SoCodes, info1.jandate, info1.wfiQuantity, info1.kcyl, }); }
catch { return null; }
} }
} }