|
|
@@ -563,7 +563,7 @@
|
|
|
|
|
|
<select id="totalPinAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
|
|
|
select
|
|
|
- MAX( a.company_name ) AS "companyName",
|
|
|
+ MAX( ec.name ) AS "companyName",
|
|
|
sum( a.commission_feevalue ) AS "commissionFeevalue",
|
|
|
sum( a.other_feevalue ) AS "otherFeevalue",
|
|
|
SUM( a.commission_feevalue + a.other_feevalue ) AS "totalFeevalue",
|
|
|
@@ -571,7 +571,8 @@
|
|
|
MAX( a.partner_companies_name) as "partnerCompaniesName",
|
|
|
a.agreement_id AS "agreementId"
|
|
|
from ins_ply_income a
|
|
|
- LEFT JOIN ptl_agreement pa on pa.id= a.agreement_id
|
|
|
+ LEFT JOIN esm_ins_company ec on ec.id= a.company_id
|
|
|
+ LEFT JOIN ptl_agreement pa on pa.id= a.agreement_id
|
|
|
<where>
|
|
|
1=1
|
|
|
<if test="agreementType !=null and agreementType!='' ">
|
|
|
@@ -700,13 +701,14 @@
|
|
|
select
|
|
|
a.agreement_id AS "agreementId",
|
|
|
MAX(a.partner_companies_name) AS "partnerCompaniesName",
|
|
|
- MAX(a.company_name) AS "companyName",
|
|
|
+ MAX(ec.name) AS "companyName",
|
|
|
SUM(a.commission_feevalue) AS "commissionFeevalue",
|
|
|
SUM(CASE WHEN a.handling_fees_status = '2' THEN a.commission_feevalue ELSE 0 END) AS "invoicCommissionFeevalue",
|
|
|
SUM( CASE WHEN a.handling_fees_status = '0' THEN a.commission_feevalue ELSE 0 END ) AS "noInvoicCommissionFeevalue",
|
|
|
SUM(CASE WHEN a.handling_fees_status = '1' THEN a.commission_feevalue ELSE 0 END) AS "readyCommissionFeevalue",
|
|
|
GROUP_CONCAT(a.id) AS "ids"
|
|
|
from ins_ply_income a
|
|
|
+ LEFT JOIN esm_ins_company ec on ec.id= a.company_id
|
|
|
LEFT JOIN ptl_agreement pa on pa.id= a.agreement_id
|
|
|
<where>
|
|
|
1=1
|
|
|
@@ -738,7 +740,7 @@
|
|
|
<select id="allOtherAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
|
|
|
SELECT
|
|
|
a.company_id AS "companyId",
|
|
|
- MAX( a.company_name ) AS "companyName",
|
|
|
+ MAX( b.name ) AS "companyName",
|
|
|
MAX( a.partner_companies_name) as "partnerCompaniesName",
|
|
|
IF(MAX( c.unsettledAmount ) IS NULL , sum( a.other_feevalue ), MAX( c.unsettledAmount ) ) AS "noInvoicCommissionFeevalue",
|
|
|
IF(MAX(c.invoicIds) IS NULL , GROUP_CONCAT(a.id),MAX(c.invoicIds) ) as "incomeIds",
|
|
|
@@ -749,6 +751,7 @@
|
|
|
sum( a.other_feevalue ) AS "otherFeevalue"
|
|
|
FROM
|
|
|
ins_ply_income a
|
|
|
+ left join esm_ins_company b ON a.company_id = b.id
|
|
|
LEFT JOIN ptl_agreement pa ON a.agreement_id = pa.id
|
|
|
LEFT JOIN ( SELECT a.company_id AS "companyId", MIN( a.unsettled_amount ) AS "unsettledAmount" ,sum( settlement_amount ) AS "settleMentAmount", GROUP_CONCAT(a.id) as "invoicIds" FROM settlement_documentary_fees a WHERE a.settlement_status = '1' GROUP BY company_id ) c ON c.companyId = a.company_id
|
|
|
LEFT JOIN ( SELECT a.company_id AS "companyId", MIN( unsettled_amount ) AS "unSettledAmount",sum( settlement_amount ) AS "settleMentAmount" FROM settlement_documentary_fees a WHERE a.settlement_status = '2' GROUP BY company_id ) f ON f.companyId = a.company_id
|