|
@@ -729,4 +729,64 @@
|
|
|
group by o.userid,o.username,o.orderstatus
|
|
group by o.userid,o.username,o.orderstatus
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+ <select id="queryCompanyPremiumDataPage"
|
|
|
|
|
+ resultType="com.ydtech.modules.admin.model.report.company.CompanyPremiumDataDto">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ agree.insurance_company_id AS companyId,
|
|
|
|
|
+ agree.insurance_company AS companyName,
|
|
|
|
|
+ agree.partner_companies_id AS parterCompanyId,
|
|
|
|
|
+ ins.NAME AS parterCompanyName,
|
|
|
|
|
+ sum( iac.sumpremium ) AS signeSumPremiumAmount
|
|
|
|
|
+ FROM
|
|
|
|
|
+ ins_area_company iac
|
|
|
|
|
+ LEFT JOIN ptl_agreement agree ON iac.agreement_id = agree.id
|
|
|
|
|
+ LEFT JOIN esm_ins_company ins ON agree.partner_companies_id = ins.id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ iac.orderstatus = 3
|
|
|
|
|
+ and
|
|
|
|
|
+ agree.id is not null
|
|
|
|
|
+ <if test="vo.companyId != null and vo.companyId!='' ">
|
|
|
|
|
+ agree.insurance_company_id = #{vo.companyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.parterCompanyId != null and vo.parterCompanyId!='' ">
|
|
|
|
|
+ agree.insurance_company_id = #{vo.parterCompanyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ GROUP BY
|
|
|
|
|
+ agree.insurance_company_id,
|
|
|
|
|
+ agree.insurance_company,
|
|
|
|
|
+ agree.partner_companies_id,
|
|
|
|
|
+ ins.NAME
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="queryCompanyQutationCountDataPage"
|
|
|
|
|
+ resultType="com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ agree.insurance_company_id AS companyId,
|
|
|
|
|
+ agree.insurance_company AS companyName,
|
|
|
|
|
+ agree.partner_companies_id AS parterCompanyId,
|
|
|
|
|
+ ins.NAME AS parterCompanyName,
|
|
|
|
|
+ COUNT( CASE WHEN iac.orderstatus = 0 THEN 1 END ) AS qutationCount,
|
|
|
|
|
+ COUNT( CASE WHEN iac.orderstatus = 2 THEN 1 END ) AS underwritingCount,
|
|
|
|
|
+ COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END ) AS qutationInsureCount,
|
|
|
|
|
+ COUNT( CASE WHEN iac.orderstatus = 0 THEN 1 END )/ count(iac.orderstatus) AS passRate,
|
|
|
|
|
+ COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END )/ count(iac.orderstatus) AS closeRate,
|
|
|
|
|
+ COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END )/ COUNT( CASE WHEN iac.orderstatus = 2 THEN 1 END ) AS contributionRate
|
|
|
|
|
+ FROM
|
|
|
|
|
+ ins_area_company iac
|
|
|
|
|
+ LEFT JOIN ptl_agreement agree ON iac.agreement_id = agree.id
|
|
|
|
|
+ LEFT JOIN esm_ins_company ins ON agree.partner_companies_id = ins.id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ agree.id IS NOT NULL
|
|
|
|
|
+ <if test="vo.companyId != null and vo.companyId!='' ">
|
|
|
|
|
+ agree.insurance_company_id = #{vo.companyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="vo.parterCompanyId != null and vo.parterCompanyId!='' ">
|
|
|
|
|
+ agree.insurance_company_id = #{vo.parterCompanyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ GROUP BY
|
|
|
|
|
+ agree.insurance_company_id,
|
|
|
|
|
+ agree.insurance_company,
|
|
|
|
|
+ agree.partner_companies_id,
|
|
|
|
|
+ ins.NAME
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|