|
|
@@ -2270,21 +2270,33 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getBusinessData" resultType="com.ydtech.modules.admin.model.dto.TaskStatisticsDto">
|
|
|
-
|
|
|
select
|
|
|
+ a.dockingPerson as "dockingPerson",
|
|
|
+ a.dockingPhone as "dockingPhone",
|
|
|
+ a.agreementType as "agreementType",
|
|
|
+ a.logo as "logo",
|
|
|
a.companyId as "companyId",
|
|
|
a.insuranceCompanyName as "insuranceCompanyName",
|
|
|
a.parterCompanyId as "parterCompanyId",
|
|
|
a.partnerCompaniesName as "partnerCompaniesName",
|
|
|
- a.totalPremium as "totalPremium",
|
|
|
- a.qutationInsureCount as "qutationInsureCount",
|
|
|
- ROUND(a.averagePremium, 2) as "averagePremium",
|
|
|
- a.userNumber as "userNumber",
|
|
|
- ROUND(a.perCapitaAmount, 2) as "perCapitaAmount",
|
|
|
- c.docking_person as "dockingPerson",
|
|
|
- c.docking_phone as "dockingPhone",
|
|
|
- c.agreement_type as "agreementType",
|
|
|
- b.logo as "logo"
|
|
|
+ sum(a.totalPremium) as "totalPremium",
|
|
|
+ sum(a.qutationInsureCount) as "qutationInsureCount",
|
|
|
+ sum(a.totalPremium) / sum(a.qutationInsureCount) AS "averagePremium",
|
|
|
+ sum(a.totalPremium) / sum(a.userNumber) as "perCapitaAmount",
|
|
|
+ sum(a.userNumber) as "userNumber"
|
|
|
+ from (
|
|
|
+ select
|
|
|
+ a.companyId as "companyId",
|
|
|
+ a.insuranceCompanyName as "insuranceCompanyName",
|
|
|
+ a.parterCompanyId as "parterCompanyId",
|
|
|
+ a.partnerCompaniesName as "partnerCompaniesName",
|
|
|
+ a.totalPremium as "totalPremium",
|
|
|
+ a.qutationInsureCount as "qutationInsureCount",
|
|
|
+ a.userNumber as "userNumber",
|
|
|
+ c.docking_person as "dockingPerson",
|
|
|
+ c.docking_phone as "dockingPhone",
|
|
|
+ c.agreement_type as "agreementType",
|
|
|
+ b.logo as "logo"
|
|
|
from (
|
|
|
SELECT
|
|
|
agree.insurance_company_id AS "companyId",
|
|
|
@@ -2363,6 +2375,8 @@
|
|
|
) a
|
|
|
left join esm_ins_company b on b.id =a.companyId
|
|
|
left join ptl_agreement c on c.id =a.agreeId
|
|
|
+ ) a
|
|
|
+ group by a.companyId,a.insuranceCompanyName,a.parterCompanyId,a.partnerCompaniesName,a.logo,a.dockingPerson,a.dockingPhone,a.agreementType
|
|
|
</select>
|
|
|
|
|
|
|