|
@ -200,7 +200,7 @@ namespace ICSSoft.FromERP |
|
|
insert into #test6 (SBJ_CD,SBJ_NM,imonth,iday,SPTDOC,DBTO_AMT) |
|
|
insert into #test6 (SBJ_CD,SBJ_NM,imonth,iday,SPTDOC,DBTO_AMT) |
|
|
select a.ccode,a.ccode_name,(select imonth from #test8 where rownumber=@k),(select iday from #test8 where rownumber=@k),(select SPTDOC from #test8 where rownumber=@k),0 |
|
|
select a.ccode,a.ccode_name,(select imonth from #test8 where rownumber=@k),(select iday from #test8 where rownumber=@k),(select SPTDOC from #test8 where rownumber=@k),0 |
|
|
from code a left join #test6 b on b.SPTDOC=(select SPTDOC from #test8 where rownumber=@k) and imonth=(select imonth from #test8 where rownumber=@k) and iday=(select iday from #test8 where rownumber=@k) and SBJ_NM=ccode_name |
|
|
from code a left join #test6 b on b.SPTDOC=(select SPTDOC from #test8 where rownumber=@k) and imonth=(select imonth from #test8 where rownumber=@k) and iday=(select iday from #test8 where rownumber=@k) and SBJ_NM=ccode_name |
|
|
where a.iYear=2024 and ( bclose=0 and ( ccode like N'6601%' or ccode_name like N'6601%' or ccode_engl like N'6601%' or chelp like N'6601%' )) and ccode <>'6601' and b.SPTDOC is null |
|
|
|
|
|
|
|
|
where a.iYear={2} and ( bclose=0 and ( ccode like N'6601%' or ccode_name like N'6601%' or ccode_engl like N'6601%' or chelp like N'6601%' )) and ccode <>'6601' and b.SPTDOC is null |
|
|
set @i=@i +1 |
|
|
set @i=@i +1 |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
@ -231,7 +231,7 @@ namespace ICSSoft.FromERP |
|
|
|
|
|
|
|
|
rollback transaction |
|
|
rollback transaction |
|
|
";
|
|
|
";
|
|
|
sql04s = string.Format(sql04s, beginPeriod, endPeriod); |
|
|
|
|
|
|
|
|
sql04s = string.Format(sql04s, beginPeriod, endPeriod, Date); |
|
|
log.Info("YERP_006_004查询 sql:" + sql04s); |
|
|
log.Info("YERP_006_004查询 sql:" + sql04s); |
|
|
DataTable vbs04dt = ICSHelper.ExecuteTable(conStr, sql04s); |
|
|
DataTable vbs04dt = ICSHelper.ExecuteTable(conStr, sql04s); |
|
|
log.Info("YERP_006_004查询 sql结果数量" + vbs04dt.Rows.Count); |
|
|
log.Info("YERP_006_004查询 sql结果数量" + vbs04dt.Rows.Count); |
|
@ -456,7 +456,7 @@ rollback transaction |
|
|
insert into #test6 (SBJ_CD,SBJ_NM,imonth,iday,SPTDOC,DBTO_AMT) |
|
|
insert into #test6 (SBJ_CD,SBJ_NM,imonth,iday,SPTDOC,DBTO_AMT) |
|
|
select a.ccode,a.ccode_name,(select imonth from #test8 where rownumber=@k),(select iday from #test8 where rownumber=@k),(select SPTDOC from #test8 where rownumber=@k),0 |
|
|
select a.ccode,a.ccode_name,(select imonth from #test8 where rownumber=@k),(select iday from #test8 where rownumber=@k),(select SPTDOC from #test8 where rownumber=@k),0 |
|
|
from code a left join #test6 b on b.SPTDOC=(select SPTDOC from #test8 where rownumber=@k) and imonth=(select imonth from #test8 where rownumber=@k) and iday=(select iday from #test8 where rownumber=@k) and SBJ_NM=ccode_name |
|
|
from code a left join #test6 b on b.SPTDOC=(select SPTDOC from #test8 where rownumber=@k) and imonth=(select imonth from #test8 where rownumber=@k) and iday=(select iday from #test8 where rownumber=@k) and SBJ_NM=ccode_name |
|
|
where a.iYear=2024 and ( bclose=0 and ( ccode like N'6601%' or ccode_name like N'6601%' or ccode_engl like N'6601%' or chelp like N'6601%' )) and ccode <>'6601' and b.SPTDOC is null |
|
|
|
|
|
|
|
|
where a.iYear={2} and ( bclose=0 and ( ccode like N'5601%' or ccode_name like N'5601%' or ccode_engl like N'5601%' or chelp like N'5601%' )) and ccode <>'5601' and b.SPTDOC is null |
|
|
set @i=@i +1 |
|
|
set @i=@i +1 |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
@ -467,15 +467,15 @@ rollback transaction |
|
|
|
|
|
|
|
|
SELECT |
|
|
SELECT |
|
|
SPTDOC,imonth,iday, |
|
|
SPTDOC,imonth,iday, |
|
|
SUM(CASE WHEN SBJ_CD = '660101' THEN DBTO_AMT ELSE 0 END) WH_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '660102' THEN DBTO_AMT ELSE 0 END) TRNSF_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '660103' THEN DBTO_AMT ELSE 0 END) XBT_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '660104' THEN DBTO_AMT ELSE 0 END) NLD_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '660105' THEN DBTO_AMT ELSE 0 END) SMPL_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '660106' THEN DBTO_AMT ELSE 0 END) TRNSF_AGNC_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '660107' THEN DBTO_AMT ELSE 0 END) ADTV, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '660108' THEN DBTO_AMT ELSE 0 END) NCLSN_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '660109' THEN DBTO_AMT ELSE 0 END) SVC_CST |
|
|
|
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '560101' THEN DBTO_AMT ELSE 0 END) WH_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '560102' THEN DBTO_AMT ELSE 0 END) TRNSF_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '560103' THEN DBTO_AMT ELSE 0 END) XBT_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '560104' THEN DBTO_AMT ELSE 0 END) NLD_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '560105' THEN DBTO_AMT ELSE 0 END) SMPL_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '560106' THEN DBTO_AMT ELSE 0 END) TRNSF_AGNC_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '560107' THEN DBTO_AMT ELSE 0 END) ADTV, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '560108' THEN DBTO_AMT ELSE 0 END) NCLSN_CST, |
|
|
|
|
|
SUM(CASE WHEN SBJ_CD = '560109' THEN DBTO_AMT ELSE 0 END) SVC_CST |
|
|
into #test9 |
|
|
into #test9 |
|
|
FROM |
|
|
FROM |
|
|
#test6 |
|
|
#test6 |
|
@ -487,7 +487,7 @@ rollback transaction |
|
|
|
|
|
|
|
|
rollback transaction |
|
|
rollback transaction |
|
|
";
|
|
|
";
|
|
|
sqlsgz04 = string.Format(sqlsgz04, beginPeriod, endPeriod); |
|
|
|
|
|
|
|
|
sqlsgz04 = string.Format(sqlsgz04, beginPeriod, endPeriod, Date); |
|
|
log.Info("YERP_006_004查询 sql:" + sqlsgz04); |
|
|
log.Info("YERP_006_004查询 sql:" + sqlsgz04); |
|
|
DataTable vbsgz04dt = ICSHelper.ExecuteTable(conStr, sqlsgz04); |
|
|
DataTable vbsgz04dt = ICSHelper.ExecuteTable(conStr, sqlsgz04); |
|
|
log.Info("YERP_006_004查询 sql结果数量" + vbsgz04dt.Rows.Count); |
|
|
log.Info("YERP_006_004查询 sql结果数量" + vbsgz04dt.Rows.Count); |
|
|