|
@@ -20,7 +20,9 @@
|
|
|
IFNULL(a.riskCodeJshang,0) as "riskCodeJshang",
|
|
IFNULL(a.riskCodeJshang,0) as "riskCodeJshang",
|
|
|
IFNULL(a.riskCodeDs,0) as "riskCodeDs",
|
|
IFNULL(a.riskCodeDs,0) as "riskCodeDs",
|
|
|
IFNULL(a.riskCodeDsan,0) as "riskCodeDsan",
|
|
IFNULL(a.riskCodeDsan,0) as "riskCodeDsan",
|
|
|
- sd.management_source as "managementSource"
|
|
|
|
|
|
|
+ sd.management_source as "managementSource",
|
|
|
|
|
+ IFNULL(IFNULL(a.entranceAllFee,0) -IFNULL(a.exportAllFee,0),0) as "distributionAmount",
|
|
|
|
|
+ (IFNULL(IFNULL(a.entranceAllFee,0) -IFNULL(a.exportAllFee,0),0)) / a.sumpremium as "distributionAmountRate"
|
|
|
from sys_user su
|
|
from sys_user su
|
|
|
left join sys_dept sd on sd.id =su.dept_id
|
|
left join sys_dept sd on sd.id =su.dept_id
|
|
|
LEFT JOIN sys_user_role sur ON sur.user_id = su.id
|
|
LEFT JOIN sys_user_role sur ON sur.user_id = su.id
|
|
@@ -36,10 +38,16 @@
|
|
|
COUNT( CASE WHEN iac.product = '单交' THEN 1 END ) AS "riskCodeDj",
|
|
COUNT( CASE WHEN iac.product = '单交' THEN 1 END ) AS "riskCodeDj",
|
|
|
COUNT( CASE WHEN iac.product = '交商' THEN 1 END ) AS "riskCodeJshang",
|
|
COUNT( CASE WHEN iac.product = '交商' THEN 1 END ) AS "riskCodeJshang",
|
|
|
COUNT( CASE WHEN iac.product = '单商' THEN 1 END ) AS "riskCodeDs",
|
|
COUNT( CASE WHEN iac.product = '单商' THEN 1 END ) AS "riskCodeDs",
|
|
|
- COUNT( CASE WHEN iac.product = '单三' THEN 1 END ) AS "riskCodeDsan"
|
|
|
|
|
|
|
+ COUNT( CASE WHEN iac.product = '单三' THEN 1 END ) AS "riskCodeDsan",
|
|
|
|
|
+ ROUND(sum(IFNULL(ifon.jq_costs_premiums,0) + IFNULL(ifon.sy_costs_premiums,0) + IFNULL
|
|
|
|
|
+ (ifon.no_costs_premiums,0)),2) as "entranceAllFee",
|
|
|
|
|
+ ROUND(sum(IFNULL(jq_export_other_costs_premiums,0) + IFNULL(jq_export_supervise_costs_premiums,0)
|
|
|
|
|
+ +IFNULL(sy_export_other_costs_premiums,0) +IFNULL(sy_export_supervise_costs_premiums,0)
|
|
|
|
|
+ +IFNULL(no_export_other_costs_premiums,0)+IFNULL(no_export_supervise_costs_premiums,0) ),2) as "exportAllFee"
|
|
|
from ins_area_company iac
|
|
from ins_area_company iac
|
|
|
left join ins_orders io on io.orderno =iac.orderno
|
|
left join ins_orders io on io.orderno =iac.orderno
|
|
|
left join sys_user su on su.id =io.userid
|
|
left join sys_user su on su.id =io.userid
|
|
|
|
|
+ LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
|
<where>
|
|
<where>
|
|
|
iac.orderstatus = '3'
|
|
iac.orderstatus = '3'
|
|
|
<if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
<if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
@@ -158,11 +166,17 @@
|
|
|
IFNULL(sum(jqpremium),0) as "jqpremium",
|
|
IFNULL(sum(jqpremium),0) as "jqpremium",
|
|
|
IFNULL(sum(sypremium),0) as "sypremium",
|
|
IFNULL(sum(sypremium),0) as "sypremium",
|
|
|
IFNULL(sum(taxamount),0) as "taxamount",
|
|
IFNULL(sum(taxamount),0) as "taxamount",
|
|
|
- IFNULL(sum(jypremium),0) as "jypremium"
|
|
|
|
|
|
|
+ IFNULL(sum(jypremium),0) as "jypremium",
|
|
|
|
|
+ ROUND(sum(IFNULL(ifon.jq_costs_premiums,0) + IFNULL(ifon.sy_costs_premiums,0) + IFNULL
|
|
|
|
|
+ (ifon.no_costs_premiums,0)),2) as "entranceAllFee",
|
|
|
|
|
+ ROUND(sum(IFNULL(jq_export_other_costs_premiums,0) + IFNULL(jq_export_supervise_costs_premiums,0)
|
|
|
|
|
+ +IFNULL(sy_export_other_costs_premiums,0) +IFNULL(sy_export_supervise_costs_premiums,0)
|
|
|
|
|
+ +IFNULL(no_export_other_costs_premiums,0)+IFNULL(no_export_supervise_costs_premiums,0) ),2) as "exportAllFee"
|
|
|
from ins_area_company iac
|
|
from ins_area_company iac
|
|
|
left join ins_orders io on io.orderno =iac.orderno
|
|
left join ins_orders io on io.orderno =iac.orderno
|
|
|
left join sys_user su on io.userid =su.id
|
|
left join sys_user su on io.userid =su.id
|
|
|
left join sys_dept sd on sd.id =su.dept_id
|
|
left join sys_dept sd on sd.id =su.dept_id
|
|
|
|
|
+ LEFT JOIN ins_fee_order_new ifon ON iac.id = ifon.ins_order_no
|
|
|
<where>
|
|
<where>
|
|
|
iac.orderstatus = '3'
|
|
iac.orderstatus = '3'
|
|
|
<if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|
|
<if test="vo.createtimeStart != null and vo.createtimeStart!='' and vo.createtimeEnd != null and vo.createtimeEnd!=''">
|