|
|
@ -10,21 +10,21 @@ |
|
|
|
ssc.brandName, |
|
|
|
ssc.rebateTypeKey, |
|
|
|
ssc.rebateTypeValue, |
|
|
|
SUM(ssc.estimateRebate) withRebate, |
|
|
|
COUNT(*) num, |
|
|
|
GROUP_CONCAT(ssc.specialRebateSid) specialRebateSid, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney)) uploadMoney, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(ssc.estimateRebate) withRebate, |
|
|
|
COUNT(*) num, |
|
|
|
GROUP_CONCAT(ssc.specialRebateSid) specialRebateSid, |
|
|
|
SUM(CAST(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney) AS DECIMAL(10, 2))) uploadMoney, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondItureCost + ssc.secondTreatCost + ssc.secondSuppCost, |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS money, |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS money, |
|
|
|
SUM(IF(ssc.isAdjustment = '是', |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost - ssc.expectItureCost - ssc.expectTreatCost - |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoney |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoney |
|
|
|
FROM scm_specialrebate_checkapplydetail ssc |
|
|
|
WHERE ssc.mainSid = #{sid} |
|
|
|
GROUP BY ssc.rebateTypeKey, ssc.brandSid, ssc.purchaseSystemSid |
|
|
@ -35,21 +35,21 @@ |
|
|
|
SELECT ssc.purchaseSystemName, |
|
|
|
ssc.brandName, |
|
|
|
ssc.withholdingDate, |
|
|
|
SUM(ssc.estimateRebate) withRebate, |
|
|
|
COUNT(*) num, |
|
|
|
GROUP_CONCAT(ssc.specialRebateSid) specialRebateSid, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney)) uploadMoney, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(ssc.estimateRebate) withRebate, |
|
|
|
COUNT(*) num, |
|
|
|
GROUP_CONCAT(ssc.specialRebateSid) specialRebateSid, |
|
|
|
SUM(CAST(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney) AS DECIMAL(10, 2))) uploadMoney, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondItureCost + ssc.secondTreatCost + ssc.secondSuppCost, |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS money, |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS money, |
|
|
|
SUM(IF(ssc.isAdjustment = '是', |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost - ssc.expectItureCost - ssc.expectTreatCost - |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoney |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoney |
|
|
|
FROM scm_specialrebate_checkapplydetail ssc |
|
|
|
WHERE ssc.mainSid = #{sid} |
|
|
|
GROUP BY ssc.withholdingDate, ssc.brandSid, ssc.purchaseSystemSid |
|
|
@ -74,21 +74,21 @@ |
|
|
|
resultType="com.yxt.anrui.scm.api.scmspecialrebatecheckapply.AppSpecialrebateCheckapplydetailDetailsVo"> |
|
|
|
SELECT ssc.purchaseSystemName, |
|
|
|
ssc.brandName, |
|
|
|
CONCAT(ssc.purchaseSystemName, ssc.brandName, '本月上传返利核对及调整金额合计') title, |
|
|
|
COUNT(*) numTotal, |
|
|
|
SUM(ssc.estimateRebate) withRebateTotal, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCostTotal, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney)) uploadMoneyTotal, |
|
|
|
CONCAT(ssc.purchaseSystemName, ssc.brandName, '本月上传返利核对及调整金额合计') title, |
|
|
|
COUNT(*) numTotal, |
|
|
|
SUM(ssc.estimateRebate) withRebateTotal, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCostTotal, |
|
|
|
SUM(CAST(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney) AS DECIMAL(10, 2))) uploadMoneyTotal, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondItureCost + ssc.secondTreatCost + ssc.secondSuppCost, |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS moneyTotal, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoneyTotal, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoneyTotal, |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS moneyTotal, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoneyTotal, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoneyTotal, |
|
|
|
SUM(IF(ssc.isAdjustment = '是', |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost - ssc.expectItureCost - ssc.expectTreatCost - |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoneyTotal |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoneyTotal |
|
|
|
FROM scm_specialrebate_checkapplydetail ssc |
|
|
|
WHERE ssc.mainSid = #{sid} |
|
|
|
GROUP BY ssc.brandSid, ssc.purchaseSystemSid |
|
|
@ -96,23 +96,23 @@ |
|
|
|
|
|
|
|
<select id="fetchByMainSidType" |
|
|
|
resultType="com.yxt.anrui.scm.api.scmspecialrebatecheckapply.AppSpecialrebateCheckapplydetailDetailssVo"> |
|
|
|
SELECT GROUP_CONCAT(ssc.specialRebateSid) sid, |
|
|
|
CONCAT(ssc.purchaseSystemName, ssc.brandName, ssc.rebateTypeValue, '明细') title, |
|
|
|
SELECT GROUP_CONCAT(ssc.specialRebateSid) sid, |
|
|
|
CONCAT(ssc.purchaseSystemName, ssc.brandName, ssc.rebateTypeValue, '明细') title, |
|
|
|
ssc.rebateTypeValue, |
|
|
|
COUNT(*) num, |
|
|
|
SUM(ssc.estimateRebate) withRebate, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney)) uploadMoney, |
|
|
|
COUNT(*) num, |
|
|
|
SUM(ssc.estimateRebate) withRebate, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(CAST(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney) AS DECIMAL(10, 2))) uploadMoney, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondItureCost + ssc.secondTreatCost + ssc.secondSuppCost, |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS money, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS money, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
SUM(IF(ssc.isAdjustment = '是', |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost - ssc.expectItureCost - ssc.expectTreatCost - |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoney |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoney |
|
|
|
FROM scm_specialrebate_checkapplydetail ssc |
|
|
|
WHERE ssc.mainSid = #{sid} |
|
|
|
AND ssc.purchaseSystemName = #{purchaseSystemName} |
|
|
@ -122,23 +122,23 @@ |
|
|
|
|
|
|
|
<select id="fetchByMainSidDate" |
|
|
|
resultType="com.yxt.anrui.scm.api.scmspecialrebatecheckapply.AppSpecialrebateCheckapplydetailDetailssVo"> |
|
|
|
SELECT GROUP_CONCAT(ssc.specialRebateSid) sid, |
|
|
|
CONCAT(ssc.purchaseSystemName, ssc.brandName, ssc.withholdingDate, '预提明细') title, |
|
|
|
SELECT GROUP_CONCAT(ssc.specialRebateSid) sid, |
|
|
|
CONCAT(ssc.purchaseSystemName, ssc.brandName, ssc.withholdingDate, '预提明细') title, |
|
|
|
ssc.withholdingDate, |
|
|
|
COUNT(*) num, |
|
|
|
SUM(ssc.estimateRebate) withRebate, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney)) uploadMoney, |
|
|
|
COUNT(*) num, |
|
|
|
SUM(ssc.estimateRebate) withRebate, |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(CAST(IF(ssc.onceCheckState = 1, ssc.secondaryUploadMoney, |
|
|
|
ssc.uploadMoney + ssc.secondaryUploadMoney) AS DECIMAL(10, 2))) uploadMoney, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, ssc.secondItureCost + ssc.secondTreatCost + ssc.secondSuppCost, |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS money, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost)) AS money, |
|
|
|
SUM(IF(ssc.onceCheckState = 1, 0, ssc.stayDetermineMoney)) stayDetermineMoney, |
|
|
|
SUM(CAST(ssc.adjustmentMoney AS DECIMAL(10, 2))) adjustmentMoney, |
|
|
|
SUM(IF(ssc.isAdjustment = '是', |
|
|
|
ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost - ssc.expectItureCost - ssc.expectTreatCost - |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoney |
|
|
|
ssc.expectSuppCost, 0)) AS fyAdjustmentMoney |
|
|
|
FROM scm_specialrebate_checkapplydetail ssc |
|
|
|
WHERE ssc.mainSid = #{sid} |
|
|
|
AND ssc.purchaseSystemName = #{purchaseSystemName} |
|
|
|