sql1:selectSBatchAdjustBill.fnumber单据编码,person.FNUMBER员工编码,person.Fname_l2员工姓名,casewhenSBatchAdjustBill.FBILLSTATE=0then'未提交'whenSBatchAdjustBill.FBILLSTATE=1then'未审批'whenSBatchAdjustBill.FBILLSTATE=2then'审批中'end审批状态,SBatchAdjustBillentry.Fid当前任职ID,SBatchAdjustBillentry.FEFFECTDATE当前任职生效日期,SAdjustEmpORelation.FEFFECTDATE当前任职开始日期,SAdjustEmpORelation.FLEFFECTDATE当前任职结束日期,SAdjustEmpORelation2.fid正确任职IDfromT_HR_SBatchAdjustBillentrySBatchAdjustBillentryinnerjoinT_HR_SAdjustEmpORelationSAdjustEmpORelationonSAdjustEmpORelation.fid=SBatchAdjustBillentry.FADJEMPORELATIONIDand(SAdjustEmpORelation.FEFFECTDATE>SBatchAdjustBillentry.FEFFECTDATEorSAdjustEmpORelation.FLEFFECTDATE=SBatchAdjustBillentry.FEFFECTDATEsql2:selectSBatchAdjustBillentry.fid,SAdjustEmpORelation.fidfromT_HR_SBatchAdjustBillentrySBatchAdjustBillentryleftjoinT_HR_SAdjustEmpORelationSAdjustEmpORelationonSAdjustEmpORelation.fid=SBatchAdjustBillentry.FADJEMPORELATIONIDwhereSAdjustEmpORelation.fidisnullsql3:SELECTSBatchAdjustBill.FNUMBER单据编码,person.fnumber员工编码,person.fname_l2员工姓名,SCmpItem.fname_l2薪酬项目,SBatchAdjustBillentry.FEFFECTDATe生效日期FROMT_HR_SBatchAdjustBillentrySBatchAdjustBillentryinnerjoint_bd_personpersononperson.fid=SBatchAdjustBillentry.FPERSONIDinnerjoinT_HR_SBatchAdjustBillSBatchAdjustBillonSBatchAdjustBill.fid=SBatchAdjustBillentry.FBILLIDinnerjoinT_HR_SFixAdjustSalarySFixAdjustSalaryonSFixAdjustSalary.FPERSONID=person.fidandSFixAdjustSalary.FCMPITEMID=SBatchAdjustBillentry.FCMPITEMIDandSFixAdjustSalary.FEFFECTDAY=SBatchAdjustBillentry.FEFFECTDATEinnerjoinT_HR_SCmpItemSCmpItemonSCmpItem.fid=SBatchAdjustBillentry.FCMPITEMID--未提交、未审批、审批中whereSBatchAdjustBill.FBILLSTATEin(0,1,2)