Stringsql0="select so.nPlanID, sum(so.nSaleQty) nSaleQty from tSalesOrder so, tZHCPlan p where so.sB2BOrderTypeID = '3' and so.nPlanID = p.nPlanID and p.nProjectID = "+projectId+" group by nPlanID";
+" FROM tZHCProject a join tOrg o on a.sOrgNO = o.sOrgNO "
+" join tZHCPlan b on a.nProjectID = b.nProjectID "
+" left join tSalesOrderSub ts WITH(NOLOCK) on ts.dOrderDate >= a.dStartDate "
+" and ts.dOrderDate <= a.dEndDate "
+" and ts.sSalesOrderTypeID = '4' "//--众筹订单
+" and ts.nOrderStatus&1 = 0 "
+" and ts.nOrderStatus&32 = 32 "//--已付款
+" left join tSalesOrderSubDtl td WITH(NOLOCK) on ts.sSubOrderID = td.sSubOrderID and td.sAgentContractNO = b.sAgentContractNO and td.nGoodsID = b.nGoodsID "