|
@@ -339,9 +339,9 @@
|
|
|
sum(a.sy_supervise_costs_proportion) as "sySuperviseCostsProportion",
|
|
sum(a.sy_supervise_costs_proportion) as "sySuperviseCostsProportion",
|
|
|
sum(a.no_supervise_costs_premiums) as "noSuperviseCostsPremiums",
|
|
sum(a.no_supervise_costs_premiums) as "noSuperviseCostsPremiums",
|
|
|
sum(a.no_supervise_costs_proportion) as "noSuperviseCostsProportion",
|
|
sum(a.no_supervise_costs_proportion) as "noSuperviseCostsProportion",
|
|
|
- sum(a.jq_premium) as "jqPremium",
|
|
|
|
|
- sum(a.sy_premium) as "syPremium",
|
|
|
|
|
- sum(a.no_premium) as "noPremium",
|
|
|
|
|
|
|
+ max(a.jq_premium) as "jqPremium",
|
|
|
|
|
+ max(a.sy_premium) as "syPremium",
|
|
|
|
|
+ max(a.no_premium) as "noPremium",
|
|
|
sum(a.jq_other_costs_premium) as "jqOtherCostsPremium",
|
|
sum(a.jq_other_costs_premium) as "jqOtherCostsPremium",
|
|
|
sum(a.sy_other_costs_premium) as "syOtherCostsPremium",
|
|
sum(a.sy_other_costs_premium) as "syOtherCostsPremium",
|
|
|
sum(a.no_other_costs_premium) as "noOtherCostsPremium",
|
|
sum(a.no_other_costs_premium) as "noOtherCostsPremium",
|
|
@@ -389,4 +389,127 @@
|
|
|
</where>
|
|
</where>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
+ <select id="getAuditExportList" resultType="com.ydtech.modules.admin.model.dto.PayableAmountExcel">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ iac.company_id,
|
|
|
|
|
+ iac.api_type,
|
|
|
|
|
+ iac.cross_insurance,
|
|
|
|
|
+ io.username,
|
|
|
|
|
+ iac.signing_time,
|
|
|
|
|
+ io.licenseno,
|
|
|
|
|
+ JSON_UNQUOTE(json_extract(io.applyinfo, '$.name')) as applyname,
|
|
|
|
|
+ io.ins_company,
|
|
|
|
|
+ io.product,
|
|
|
|
|
+ eic.namesimple,
|
|
|
|
|
+ iac.jqapplyno,
|
|
|
|
|
+ iac.syapplyno,
|
|
|
|
|
+ iac.cross_insurance,
|
|
|
|
|
+ iac.jqpremium,
|
|
|
|
|
+ iac.sypremium,
|
|
|
|
|
+ iac.jypremium,
|
|
|
|
|
+ iac.taxamount,
|
|
|
|
|
+ ifo.jq_costs_export_proportion + ifo.jq_export_other_costs_proportion AS jq_export_proportion,
|
|
|
|
|
+ ifo.sy_costs_export_proportion+ifo.sy_export_other_costs_proportion as sy_export_proportion,
|
|
|
|
|
+ ifo.no_costs_export_proportion+ifo.no_export_other_costs_proportion as no_export_proportion,
|
|
|
|
|
+ ifo.jq_export_supervise_costs_premiums + ifo.sy_export_supervise_costs_premiums + ifo.no_export_supervise_costs_premiums + ifo.jq_export_other_costs_premiums + ifo.sy_export_other_costs_premiums + ifo.no_export_other_costs_premiums as settlement,
|
|
|
|
|
+ ifo.jq_supervise_costs_proportion + ifo.jq_other_costs_proportion as jq_entrance_proportion,
|
|
|
|
|
+ ifo.sy_supervise_costs_proportion + ifo.sy_other_costs_proportion as sy_entrance_proportion,
|
|
|
|
|
+ ifo.no_supervise_costs_proportion + ifo.no_other_costs_proportion as no_entrance_proportion,
|
|
|
|
|
+ ifo.jq_supervise_costs_premiums + ifo.jq_other_costs_premiums + ifo.sy_supervise_costs_premiums + ifo.sy_other_costs_premiums + ifo.no_supervise_costs_premiums + ifo.no_other_costs_premiums as receivable,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_1 + ifo.sy_dept_premiums_level_1 + ifo.no_dept_premiums_level_1 as dept_premiums_level_1,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_2 + ifo.sy_dept_premiums_level_2 + ifo.no_dept_premiums_level_2 as dept_premiums_level_2,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_3 + ifo.sy_dept_premiums_level_3 + ifo.no_dept_premiums_level_3 as dept_premiums_level_3,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_4 + ifo.sy_dept_premiums_level_4 + ifo.no_dept_premiums_level_4 as dept_premiums_level_4,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_5 + ifo.sy_dept_premiums_level_5 + ifo.no_dept_premiums_level_5 as dept_premiums_level_5,
|
|
|
|
|
+ ifo.first_detail_premiums,
|
|
|
|
|
+ ifo.second_detail_premiums,
|
|
|
|
|
+ ifo.third_detail_premiums,
|
|
|
|
|
+ ifo.jq_profit_margin_premiums,
|
|
|
|
|
+ ifo.sy_profit_margin_premiums,
|
|
|
|
|
+ ifo.no_profit_margin_premiums,
|
|
|
|
|
+ io.is_external,
|
|
|
|
|
+ pa.agreement_code,
|
|
|
|
|
+ pa.job_description,
|
|
|
|
|
+ pa.docking_person,
|
|
|
|
|
+ pa.docking_phone
|
|
|
|
|
+ FROM
|
|
|
|
|
+ ins_fee_order_new ifo
|
|
|
|
|
+ LEFT JOIN ins_fee_audit ifa ON ifo.ins_order_no = ifa.ins_order_no
|
|
|
|
|
+ left join ins_area_company iac on ifa.ins_order_no = iac.id
|
|
|
|
|
+ left join ins_orders io on iac.orderno = io.orderno
|
|
|
|
|
+ left join ptl_agreement pa on iac.agreement_id = pa.id
|
|
|
|
|
+ left join esm_ins_company eic on pa.partner_companies_id = eic.id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ ifa.auditstatus = '1'
|
|
|
|
|
+ AND
|
|
|
|
|
+ iac.orderstatus = 3
|
|
|
|
|
+ AND io.orderstatus = '3'
|
|
|
|
|
+ <if test="vo.year !=null and vo.year !=''">
|
|
|
|
|
+ and DATE_FORMAT( iac.signing_time, '%Y') =#{vo.year}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ GROUP BY
|
|
|
|
|
+ io.orderno,
|
|
|
|
|
+ iac.api_type,
|
|
|
|
|
+ iac.cross_insurance,
|
|
|
|
|
+ iac.signing_time,
|
|
|
|
|
+ eic.namesimple,
|
|
|
|
|
+ iac.jqapplyno,
|
|
|
|
|
+ iac.syapplyno,
|
|
|
|
|
+ iac.jqpremium,
|
|
|
|
|
+ iac.company_id,
|
|
|
|
|
+ iac.sypremium,
|
|
|
|
|
+ iac.jypremium,
|
|
|
|
|
+ iac.taxamount,
|
|
|
|
|
+ ifo.jq_costs_export_proportion,
|
|
|
|
|
+ ifo.jq_export_other_costs_proportion,
|
|
|
|
|
+ ifo.sy_costs_export_proportion,
|
|
|
|
|
+ ifo.sy_export_other_costs_proportion,
|
|
|
|
|
+ ifo.no_costs_export_proportion,
|
|
|
|
|
+ ifo.no_export_other_costs_proportion,
|
|
|
|
|
+ ifo.jq_export_supervise_costs_premiums,
|
|
|
|
|
+ ifo.sy_export_supervise_costs_premiums,
|
|
|
|
|
+ ifo.no_export_supervise_costs_premiums,
|
|
|
|
|
+ ifo.jq_export_other_costs_premiums,
|
|
|
|
|
+ ifo.sy_export_other_costs_premiums,
|
|
|
|
|
+ ifo.no_export_other_costs_premiums,
|
|
|
|
|
+ ifo.jq_supervise_costs_proportion,
|
|
|
|
|
+ ifo.jq_other_costs_proportion,
|
|
|
|
|
+ ifo.sy_supervise_costs_proportion,
|
|
|
|
|
+ ifo.sy_other_costs_proportion,
|
|
|
|
|
+ ifo.no_supervise_costs_proportion,
|
|
|
|
|
+ ifo.no_other_costs_proportion,
|
|
|
|
|
+ ifo.jq_supervise_costs_premiums,
|
|
|
|
|
+ ifo.jq_other_costs_premiums,
|
|
|
|
|
+ ifo.sy_supervise_costs_premiums,
|
|
|
|
|
+ ifo.sy_other_costs_premiums,
|
|
|
|
|
+ ifo.no_supervise_costs_premiums,
|
|
|
|
|
+ ifo.no_other_costs_premiums,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_1,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_2,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_3,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_4,
|
|
|
|
|
+ ifo.jq_dept_premiums_level_5,
|
|
|
|
|
+ ifo.sy_dept_premiums_level_1,
|
|
|
|
|
+ ifo.sy_dept_premiums_level_2,
|
|
|
|
|
+ ifo.sy_dept_premiums_level_3,
|
|
|
|
|
+ ifo.sy_dept_premiums_level_4,
|
|
|
|
|
+ ifo.sy_dept_premiums_level_5,
|
|
|
|
|
+ ifo.no_dept_premiums_level_1,
|
|
|
|
|
+ ifo.no_dept_premiums_level_2,
|
|
|
|
|
+ ifo.no_dept_premiums_level_3,
|
|
|
|
|
+ ifo.no_dept_premiums_level_4,
|
|
|
|
|
+ ifo.no_dept_premiums_level_5,
|
|
|
|
|
+ ifo.first_detail_premiums,
|
|
|
|
|
+ ifo.second_detail_premiums,
|
|
|
|
|
+ ifo.third_detail_premiums,
|
|
|
|
|
+ ifo.jq_profit_margin_premiums,
|
|
|
|
|
+ ifo.sy_profit_margin_premiums,
|
|
|
|
|
+ ifo.no_profit_margin_premiums,
|
|
|
|
|
+ pa.agreement_code,
|
|
|
|
|
+ pa.job_description,
|
|
|
|
|
+ pa.docking_person,
|
|
|
|
|
+ pa.docking_phone
|
|
|
|
|
+
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|