本文主要是介绍金蝶K3生产任务单不同状态对应的查询sql,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
这个单据状态:计划、确认、下达、结案 分别对应的sql如下
--计划
Select top 20000 v1.FBillNo as FBillNo,v1.FStatus as FStatus,v1.FTranType as FTranType,v1.FInterID as FInterID,
case when v1.FCancellation=1 then 'Y' else '' end as FCancellation,CASE V1.FSuspend WHEN 0 THEN '' ELSE 'Y' END as FSuspend,t9.FQtyDecimal as FQtyDecimal,
v1.FType as FICMOType2,v1.FWorktypeID as FWorkTypeID2, 0 As FBOSCloseFlag from ICMO v1 INNER JOIN t_ICItem t9 ON v1.FItemID = t9.FItemID AND t9.FItemID<>0 where 1=1 AND (v1.FTranType = 85 AND ( v1.FType <> 11060 ) AND (v1.FStatus=0 AND v1.FCancellation = 0)) order by v1.FInterID---确认
Select top 20000 v1.FBillNo as FBillNo,v1.FStatus as FStatus,v1.FTranType as FTranType,v1.FInterID as FInterID,
case when v1.FCancellation=1 then 'Y' else '' end as FCancellation,CASE V1.FSuspend WHEN 0 THEN '' ELSE 'Y' END as FSuspend,t9.FQtyDecimal as FQtyDecimal,
v1.FType as FICMOType2,v1.FWorktypeID as FWorkTypeID2, 0 As FBOSCloseFlag from ICMO v1 INNER JOIN t_ICItem t9 ON v1.FItemID = t9.FItemID AND t9.FItemID<>0 where 1=1 AND (v1.FTranType = 85 AND ( v1.FType <> 11060 ) AND (v1.FStatus=5 AND v1.FCancellation = 0)) order by v1.FInterID--下达Select top 20000 v1.FBillNo as FBillNo,v1.FStatus as FStatus,v1.FTranType as FTranType,v1.FInterID as FInterID,case when v1.FCancellation=1 then 'Y' else '' end as FCancellation,CASE V1.FSuspend WHEN 0 THEN '' ELSE 'Y' END as FSuspend,t9.FQtyDecimal as FQtyDecimal,v1.FType as FICMOType2,v1.FWorktypeID as FWorkTypeID2, 0 As FBOSCloseFlag from ICMO v1 INNER JOIN t_ICItem t9 ON v1.FItemID = t9.FItemID AND t9.FItemID<>0 where 1=1 AND (v1.FTranType = 85 AND ( v1.FType <> 11060 ) AND ((v1.FStatus=1 or v1.FStatus=2) AND v1.FCancellation = 0)) order by v1.FInterID--结案Select top 20000 v1.FBillNo as FBillNo,v1.FStatus as FStatus,v1.FTranType as FTranType,v1.FInterID as FInterID,case when v1.FCancellation=1 then 'Y' else '' end as FCancellation,CASE V1.FSuspend WHEN 0 THEN '' ELSE 'Y' END as FSuspend,t9.FQtyDecimal as FQtyDecimal,v1.FType as FICMOType2,v1.FWorktypeID as FWorkTypeID2, 0 As FBOSCloseFlag from ICMO v1 INNER JOIN t_ICItem t9 ON v1.FItemID = t9.FItemID AND t9.FItemID<>0 where 1=1 AND (v1.FTranType = 85 AND ( v1.FType <> 11060 ) AND (v1.FStatus=3 AND v1.FCancellation = 0)) order by v1.FInterID
这篇关于金蝶K3生产任务单不同状态对应的查询sql的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!