|
|
@ -25,16 +25,19 @@ |
|
|
|
svc.brandName, |
|
|
|
svc.rebateTypeKey, |
|
|
|
svc.rebateTypeValue, |
|
|
|
SUM(svc.estimateRebate) withRebate, |
|
|
|
COUNT(*) num, |
|
|
|
GROUP_CONCAT(svc.vehRebateSid) vehRebateSid, |
|
|
|
SUM(svc.uploadMoney) uploadMoney, |
|
|
|
SUM(svc.stayDetermineMoney) stayDetermineMoney, |
|
|
|
SUM(CAST(svc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCost, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) money, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) - |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) fyAdjustmentMoney |
|
|
|
SUM(svc.estimateRebate) withRebate, |
|
|
|
COUNT(*) num, |
|
|
|
GROUP_CONCAT(svc.vehRebateSid) vehRebateSid, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondaryUploadMoney, |
|
|
|
svc.uploadMoney + svc.secondaryUploadMoney)) uploadMoney, |
|
|
|
SUM(IF(svc.onceCheckState = 1, 0, svc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(svc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCost, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondTreatCost + svc.secondSuppCost, |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost)) money, |
|
|
|
SUM(IF(svc.isAdjustment = '是', |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost - |
|
|
|
svc.expectTreatCost - svc.expectSuppCost, 0)) fyAdjustmentMoney |
|
|
|
FROM scm_vehrebate_checkapplydetail svc |
|
|
|
WHERE svc.mainSid = #{sid} |
|
|
|
GROUP BY svc.rebateTypeKey, svc.brandSid, svc.purchaseSystemSid |
|
|
@ -46,16 +49,19 @@ |
|
|
|
svc.brandName, |
|
|
|
svc.palceGenDate, |
|
|
|
svc.withholdingDate, |
|
|
|
SUM(svc.estimateRebate) withRebate, |
|
|
|
COUNT(*) num, |
|
|
|
GROUP_CONCAT(svc.vehRebateSid) vehRebateSid, |
|
|
|
SUM(svc.uploadMoney) uploadMoney, |
|
|
|
SUM(svc.stayDetermineMoney) stayDetermineMoney, |
|
|
|
SUM(svc.adjustmentMoney) adjustmentMoney, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCost, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) money, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) - |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) fyAdjustmentMoney |
|
|
|
SUM(svc.estimateRebate) withRebate, |
|
|
|
COUNT(*) num, |
|
|
|
GROUP_CONCAT(svc.vehRebateSid) vehRebateSid, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondaryUploadMoney, |
|
|
|
svc.uploadMoney + svc.secondaryUploadMoney)) uploadMoney, |
|
|
|
SUM(IF(svc.onceCheckState = 1, 0, svc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(svc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCost, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondTreatCost + svc.secondSuppCost, |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost)) money, |
|
|
|
SUM(IF(svc.isAdjustment = '是', |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost - |
|
|
|
svc.expectTreatCost - svc.expectSuppCost, 0)) fyAdjustmentMoney |
|
|
|
FROM scm_vehrebate_checkapplydetail svc |
|
|
|
WHERE svc.mainSid = #{sid} |
|
|
|
GROUP BY svc.withholdingDate, svc.brandSid, svc.purchaseSystemSid |
|
|
@ -72,16 +78,21 @@ |
|
|
|
resultType="com.yxt.anrui.scm.api.scmvehrebatecheckapply.AppVehrebateCheckapplydetailDetailsVo"> |
|
|
|
SELECT svc.purchaseSystemName, |
|
|
|
svc.brandName, |
|
|
|
CONCAT(svc.purchaseSystemName, svc.brandName, '本月上传返利核对及调整金额合计') title, |
|
|
|
COUNT(*) numTotal, |
|
|
|
SUM(svc.estimateRebate) withRebateTotal, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCostTotal, |
|
|
|
SUM(svc.uploadMoney) uploadMoneyTotal, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) moneyTotal, |
|
|
|
SUM(svc.stayDetermineMoney) stayDetermineMoneyTotal, |
|
|
|
SUM(svc.adjustmentMoney) adjustmentMoneyTotal, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) - |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) fyAdjustmentMoneyTotal |
|
|
|
CONCAT(svc.purchaseSystemName, svc.brandName, '本月上传返利核对及调整金额合计') title, |
|
|
|
COUNT(*) numTotal, |
|
|
|
SUM(svc.estimateRebate) withRebateTotal, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCostTotal, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondaryUploadMoney, |
|
|
|
svc.uploadMoney + |
|
|
|
svc.secondaryUploadMoney)) uploadMoneyTotal, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondTreatCost + svc.secondSuppCost, |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost)) moneyTotal, |
|
|
|
SUM(IF(svc.onceCheckState = 1, 0, svc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
stayDetermineMoneyTotal, |
|
|
|
SUM(svc.adjustmentMoney) adjustmentMoneyTotal, |
|
|
|
SUM(IF(svc.isAdjustment = '是', |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost - |
|
|
|
svc.expectTreatCost - svc.expectSuppCost, 0)) fyAdjustmentMoneyTotal |
|
|
|
FROM scm_vehrebate_checkapplydetail svc |
|
|
|
WHERE svc.mainSid = #{sid} |
|
|
|
GROUP BY svc.brandSid, svc.purchaseSystemSid |
|
|
@ -89,18 +100,21 @@ |
|
|
|
|
|
|
|
<select id="fetchByMainSidType" |
|
|
|
resultType="com.yxt.anrui.scm.api.scmvehrebatecheckapply.AppVehrebateCheckapplydetailDetailssVo"> |
|
|
|
SELECT GROUP_CONCAT(svc.vehRebateSid) sid, |
|
|
|
CONCAT(svc.purchaseSystemName, svc.brandName, svc.rebateTypeValue, '明细') title, |
|
|
|
SELECT GROUP_CONCAT(svc.vehRebateSid) sid, |
|
|
|
CONCAT(svc.purchaseSystemName, svc.brandName, svc.rebateTypeValue, '明细') title, |
|
|
|
svc.rebateTypeValue, |
|
|
|
COUNT(*) num, |
|
|
|
SUM(svc.estimateRebate) withRebate, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCost, |
|
|
|
SUM(svc.uploadMoney) uploadMoney, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) money, |
|
|
|
SUM(svc.stayDetermineMoney) stayDetermineMoney, |
|
|
|
SUM(svc.adjustmentMoney) adjustmentMoney, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) - |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) fyAdjustmentMoney |
|
|
|
COUNT(*) num, |
|
|
|
SUM(svc.estimateRebate) withRebate, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCost, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondaryUploadMoney, |
|
|
|
svc.uploadMoney + svc.secondaryUploadMoney)) uploadMoney, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondTreatCost + svc.secondSuppCost, |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost)) money, |
|
|
|
SUM(IF(svc.onceCheckState = 1, 0, svc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(svc.adjustmentMoney) adjustmentMoney, |
|
|
|
SUM(IF(svc.isAdjustment = '是', |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost - |
|
|
|
svc.expectTreatCost - svc.expectSuppCost, 0)) fyAdjustmentMoney |
|
|
|
FROM scm_vehrebate_checkapplydetail svc |
|
|
|
WHERE svc.mainSid = #{sid} |
|
|
|
AND svc.purchaseSystemName = #{purchaseSystemName} |
|
|
@ -110,18 +124,21 @@ |
|
|
|
|
|
|
|
<select id="fetchByMainSidDate" |
|
|
|
resultType="com.yxt.anrui.scm.api.scmvehrebatecheckapply.AppVehrebateCheckapplydetailDetailssVo"> |
|
|
|
SELECT GROUP_CONCAT(svc.vehRebateSid) sid, |
|
|
|
CONCAT(svc.purchaseSystemName, svc.brandName, svc.withholdingDate, '预提明细') title, |
|
|
|
SELECT GROUP_CONCAT(svc.vehRebateSid) sid, |
|
|
|
CONCAT(svc.purchaseSystemName, svc.brandName, svc.withholdingDate, '预提明细') title, |
|
|
|
svc.withholdingDate, |
|
|
|
COUNT(*) num, |
|
|
|
SUM(svc.estimateRebate) withRebate, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCost, |
|
|
|
SUM(svc.uploadMoney) uploadMoney, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) money, |
|
|
|
SUM(svc.stayDetermineMoney) stayDetermineMoney, |
|
|
|
SUM(svc.adjustmentMoney) adjustmentMoney, |
|
|
|
SUM(svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost) - |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) fyAdjustmentMoney |
|
|
|
COUNT(*) num, |
|
|
|
SUM(svc.estimateRebate) withRebate, |
|
|
|
SUM(svc.expectTreatCost + svc.expectSuppCost) withholdCost, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondaryUploadMoney, |
|
|
|
svc.uploadMoney + svc.secondaryUploadMoney)) uploadMoney, |
|
|
|
SUM(IF(svc.onceCheckState = 1, svc.secondTreatCost + svc.secondSuppCost, |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost)) money, |
|
|
|
SUM(IF(svc.onceCheckState = 1, 0, svc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(svc.adjustmentMoney) adjustmentMoney, |
|
|
|
SUM(IF(svc.isAdjustment = '是', |
|
|
|
svc.onceTreatCost + svc.onceSuppCost + svc.secondTreatCost + svc.secondSuppCost - |
|
|
|
svc.expectTreatCost - svc.expectSuppCost, 0)) fyAdjustmentMoney |
|
|
|
FROM scm_vehrebate_checkapplydetail svc |
|
|
|
WHERE svc.mainSid = #{sid} |
|
|
|
AND svc.purchaseSystemName = #{purchaseSystemName} |
|
|
|