|
|
@@ -846,44 +846,77 @@
|
|
|
<select id="queryCompanyQutationCountDataPage"
|
|
|
resultType="com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto">
|
|
|
SELECT
|
|
|
- a.* , (select ins.namesimple from esm_ins_company ins where a.parterCompanyId = ins.id) as "parterCompanyName"
|
|
|
+ a.* ,
|
|
|
+ (select ins.namesimple from esm_ins_company
|
|
|
+ ins where a.parterCompanyId = ins.id) as "parterCompanyName"
|
|
|
FROM
|
|
|
(
|
|
|
SELECT
|
|
|
+ count(agree.partner_companies_id) as "orderSuccessNumber",
|
|
|
agree.insurance_company AS companyName,
|
|
|
agree.partner_companies_id AS parterCompanyId,
|
|
|
+ iac.company_id as "companId",
|
|
|
count( iac.orderstatus ) AS qutationCount,
|
|
|
+ count( iac.id ) AS orderSuccessNumberRate,
|
|
|
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 = 2 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( iac.orderstatus ) AS contributionRate
|
|
|
+ COUNT( CASE WHEN iac.orderstatus = 3 THEN 1 END )/ count( iac.orderstatus ) AS contributionRate,
|
|
|
+ COUNT(CASE WHEN agree.audit_type =1 and ifa.auditstatus =1 and iac.orderstatus =3 THEN 1 END) as "numberManual"
|
|
|
FROM
|
|
|
ins_area_company iac
|
|
|
LEFT JOIN ptl_agreement agree ON iac.agreement_id = agree.id
|
|
|
-
|
|
|
LEFT JOIN ins_orders io ON iac.orderno = io.orderno
|
|
|
LEFT JOIN sys_dept sd ON sd.id = io.deptid
|
|
|
+ LEFT JOIN ins_fee_audit ifa on ifa.ins_order_no =iac.id
|
|
|
WHERE
|
|
|
agree.id IS NOT NULL
|
|
|
<if test="vo.companyId != null and vo.companyId!='' ">
|
|
|
- agree.insurance_company_id = #{vo.companyId}
|
|
|
+ AND agree.insurance_company_id = #{vo.companyId}
|
|
|
</if>
|
|
|
<if test="vo.parterCompanyId != null and vo.parterCompanyId!='' ">
|
|
|
- agree.partner_companies_id = #{vo.parterCompanyId}
|
|
|
+ AND agree.partner_companies_id = #{vo.parterCompanyId}
|
|
|
</if>
|
|
|
<if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
- AND iac.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
+ AND iac.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
</if>
|
|
|
<if test="vo.managementSource != null and vo.managementSource!=''">
|
|
|
- AND sd.management_source =#{vo.managementSource}
|
|
|
+ AND sd.management_source =#{vo.managementSource}
|
|
|
</if>
|
|
|
GROUP BY
|
|
|
agree.insurance_company,
|
|
|
+ iac.company_id,
|
|
|
agree.partner_companies_id
|
|
|
) a
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getInsAreaCompanyError"
|
|
|
+ resultType="com.ydtech.modules.admin.model.report.company.CompanyQutationCountDataDto">
|
|
|
+ SELECT
|
|
|
+ count(iace.id) as "areaCompanyErrNumber"
|
|
|
+ FROM
|
|
|
+ ins_area_company_error iace
|
|
|
+ LEFT JOIN ins_orders io ON iace.orderno = io.orderno
|
|
|
+ LEFT JOIN sys_dept sd ON sd.id = io.deptid
|
|
|
+ LEFT JOIN ptl_agreement agree ON iace.agreement_id = agree.id
|
|
|
+
|
|
|
+ WHERE
|
|
|
+ agree.id IS NOT NULL
|
|
|
+ <if test="vo.companyId != null and vo.companyId!='' ">
|
|
|
+ AND agree.insurance_company_id = #{vo.companyId}
|
|
|
+ </if>
|
|
|
+ <if test="vo.parterCompanyId != null and vo.parterCompanyId!='' ">
|
|
|
+ AND agree.partner_companies_id = #{vo.parterCompanyId}
|
|
|
+ </if>
|
|
|
+ <if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
+ AND iace.create_time BETWEEN #{vo.beginDate} AND #{vo.endDate}
|
|
|
+ </if>
|
|
|
+ <if test="vo.managementSource != null and vo.managementSource!=''">
|
|
|
+ AND sd.management_source =#{vo.managementSource}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="queryCompanyQutationCountDataPageTotal"
|
|
|
resultType="java.lang.Long">
|
|
|
SELECT
|
|
|
@@ -900,10 +933,10 @@
|
|
|
WHERE
|
|
|
agree.id IS NOT NULL
|
|
|
<if test="vo.companyId != null and vo.companyId!='' ">
|
|
|
- agree.insurance_company_id = #{vo.companyId}
|
|
|
+ AND agree.insurance_company_id = #{vo.companyId}
|
|
|
</if>
|
|
|
<if test="vo.parterCompanyId != null and vo.parterCompanyId!='' ">
|
|
|
- agree.partner_companies_id = #{vo.parterCompanyId}
|
|
|
+ AND agree.partner_companies_id = #{vo.parterCompanyId}
|
|
|
</if>
|
|
|
<if test="vo.beginDate != null and vo.beginDate!='' and vo.endDate != null and vo.endDate!=''">
|
|
|
AND iac.createtime BETWEEN #{vo.beginDate} AND #{vo.endDate}
|