|
|
@ -1,10 +1,14 @@ |
|
|
|
<?xml version="1.0" encoding="UTF-8" ?> |
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
|
<mapper namespace="com.yxt.anrui.scm.biz.scmspecialrebatecheckapplydetail.ScmSpecialrebateCheckapplydetailMapper"> |
|
|
|
<!-- <where> ${ew.sqlSegment} </where>--> |
|
|
|
<!-- ${ew.customSqlSegment} --> |
|
|
|
<select id="selectPageVo" resultType="com.yxt.anrui.scm.api.scmspecialrebatecheckapplydetail.ScmSpecialrebateCheckapplydetailVo"> |
|
|
|
SELECT * FROM scm_specialrebate_checkapplydetail <where> ${ew.sqlSegment} </where> |
|
|
|
<!-- <where> ${ew.sqlSegment} </where>--> |
|
|
|
<!-- ${ew.customSqlSegment} --> |
|
|
|
<select id="selectPageVo" |
|
|
|
resultType="com.yxt.anrui.scm.api.scmspecialrebatecheckapplydetail.ScmSpecialrebateCheckapplydetailVo"> |
|
|
|
SELECT * FROM scm_specialrebate_checkapplydetail |
|
|
|
<where> |
|
|
|
${ew.sqlSegment} |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="fetchWhenDetailsVoBySid" |
|
|
@ -17,7 +21,9 @@ |
|
|
|
SUM(ssc.`uploadMoney`) uploadMoney, |
|
|
|
SUM(ssc.`stayDetermineMoney`) stayDetermineMoney, |
|
|
|
SUM(ssc.`adjustmentMoney`) adjustmentMoney, |
|
|
|
SUM(ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + ssc.secondTreatCost + ssc.secondSuppCost) AS money |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost) AS money |
|
|
|
FROM scm_specialrebate_checkapplydetail ssc |
|
|
|
WHERE ssc.`mainSid` = #{sid} |
|
|
|
GROUP BY ssc.`rebateTypeKey` |
|
|
@ -27,15 +33,24 @@ |
|
|
|
resultType="com.yxt.anrui.scm.api.scmspecialrebatecheckapplydetail.ScmSpecialrebateCheckapplydetailDetailsVo"> |
|
|
|
SELECT ssc.withholdingDate, |
|
|
|
SUM(ssc.`estimateRebate`) withRebate, |
|
|
|
COUNT(*) withholdingAmount, |
|
|
|
COUNT(*) uploadAmount, |
|
|
|
COUNT(*) num, |
|
|
|
GROUP_CONCAT(ssc.`specialRebateSid`) specialRebateSid, |
|
|
|
SUM(ssc.`uploadMoney`) uploadMoney, |
|
|
|
SUM(ssc.`stayDetermineMoney`) stayDetermineMoney, |
|
|
|
SUM(ssc.`adjustmentMoney`) adjustmentMoney, |
|
|
|
SUM(ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + ssc.secondTreatCost + ssc.secondSuppCost) AS money |
|
|
|
SUM(ssc.expectItureCost + ssc.expectTreatCost + ssc.expectSuppCost) AS withholdCost, |
|
|
|
SUM(ssc.onceItureCost + ssc.onceTreatCost + ssc.onceSuppCost + ssc.secondItureCost + |
|
|
|
ssc.secondTreatCost + ssc.secondSuppCost) AS money |
|
|
|
FROM scm_specialrebate_checkapplydetail ssc |
|
|
|
WHERE ssc.`mainSid` = #{sid} |
|
|
|
GROUP BY ssc.withholdingDate |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="fetchBySpecialRebateSid" resultType="com.yxt.anrui.scm.api.scmspecialrebate.ScmSpecialRebateDetailsVo"> |
|
|
|
SELECT sc.createOrgName, sd.* |
|
|
|
FROM scm_specialrebate_checkapplydetail sd |
|
|
|
LEFT JOIN scm_specialrebate_checkapply sc |
|
|
|
ON sd.mainSid = sc.sid |
|
|
|
WHERE specialRebateSid = #{specialRebateSid} |
|
|
|
</select> |
|
|
|
</mapper> |