|
|
@@ -184,9 +184,10 @@
|
|
|
and a.handling_fees_status =#{handlingFeesStatus}
|
|
|
</if>
|
|
|
|
|
|
- <if test="allPartnerCompaniesId !=null and allPartnerCompaniesId !=''">
|
|
|
- and eic.parent_id =#{allPartnerCompaniesId}
|
|
|
+ <if test="allPartnerCompaniesId !=null and allPartnerCompaniesId !=''">
|
|
|
+ AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
|
|
|
</if>
|
|
|
+
|
|
|
<if test="provincePartnerCompaniesId !=null and provincePartnerCompaniesId !=''">
|
|
|
and eic.parent_id =#{provincePartnerCompaniesId}
|
|
|
</if>
|
|
|
@@ -196,15 +197,15 @@
|
|
|
</if>
|
|
|
|
|
|
<if test="provinceId != null and provinceId != ''">
|
|
|
- and a.deptid like "${provinceId}%"
|
|
|
+ and a.dept_id LIKE CONCAT(#{provinceId}, '%')
|
|
|
</if>
|
|
|
|
|
|
<if test="cityId != null and cityId != ''">
|
|
|
- and a.deptid like "${cityId}%"
|
|
|
+ and a.dept_id LIKE CONCAT(#{cityId}, '%')
|
|
|
</if>
|
|
|
|
|
|
<if test="countyId != null and countyId != ''">
|
|
|
- and a.deptid like "${countyId}%"
|
|
|
+ and a.dept_id LIKE CONCAT(#{countyId}, '%')
|
|
|
</if>
|
|
|
<if test="taskId != null and taskId != ''">
|
|
|
and a.task_id = #{taskId}
|
|
|
@@ -306,10 +307,12 @@
|
|
|
AND a.insured_name =#{insuredName}
|
|
|
</if>
|
|
|
<if test="jqStartDate !=null and jqStartDate != '' and jqEndDate != null and jqEndDate !=''">
|
|
|
- AND a.jq_end_date BETWEEN #{jqStartDate} AND #{jqEndDate} AND a.jq_start_date > = #{jqStartDate}
|
|
|
+ AND DATE(a.jq_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
|
|
|
+
|
|
|
</if>
|
|
|
<if test="syStartDate !=null and syStartDate != '' and syEndDate != null and syEndDate !=''">
|
|
|
- AND a.sy_start_date BETWEEN #{syStartDate} AND #{syEndDate} AND a.sy_start_date > = #{syStartDate}
|
|
|
+ AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
|
|
|
+
|
|
|
</if>
|
|
|
|
|
|
</where>
|
|
|
@@ -659,10 +662,12 @@
|
|
|
and a.is_not_car =#{isNotCar}
|
|
|
</if>
|
|
|
<if test="jqStartDate !=null and jqStartDate != '' and jqEndDate != null and jqEndDate !=''">
|
|
|
- AND a.jq_end_date BETWEEN #{jqStartDate} AND #{jqEndDate} AND a.jq_start_date > = #{jqStartDate}
|
|
|
+ AND DATE(a.jq_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
|
|
|
+
|
|
|
</if>
|
|
|
<if test="syStartDate !=null and syStartDate != '' and syEndDate != null and syEndDate !=''">
|
|
|
- AND a.sy_start_date BETWEEN #{syStartDate} AND #{syEndDate} AND a.sy_start_date > = #{syStartDate}
|
|
|
+ AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
|
|
|
+
|
|
|
</if>
|
|
|
|
|
|
<if test="isOther !=null and isOther !=''">
|
|
|
@@ -1071,7 +1076,7 @@
|
|
|
AND a.partner_companies_name =#{partnerCompaniesName}
|
|
|
</if>
|
|
|
<if test="allPartnerCompaniesId !=null and allPartnerCompaniesId !=''">
|
|
|
- and eic.parent_id =#{allPartnerCompaniesId}
|
|
|
+ AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
|
|
|
</if>
|
|
|
<if test="provincePartnerCompaniesId !=null and provincePartnerCompaniesId !=''">
|
|
|
and eic.parent_id =#{provincePartnerCompaniesId}
|
|
|
@@ -1124,8 +1129,8 @@
|
|
|
IFNULL ( max(d.settleMentAmount),0.00)-IFNULL(max(f.settleMentAmount) , 0.00) as "invoicCommissionFeevalue",
|
|
|
sum(COALESCE( a.other_feevalue,0.00) )-IFNULL ( max(d.settleMentAmount),0.00) as "noInvoicCommissionFeevalue",
|
|
|
sum(COALESCE( a.other_feevalue,0.00) )-COALESCE(max(c.settleMentAmount),0.00)+IFNULL ( max(d.settleMentAmount),0.00) AS "unSettledAmount",
|
|
|
- IFNULL(IFNULL(max(f.settleMentAmount) , 0.00) * MAX(f.taxPoints) /100,0) as "taxesFees",
|
|
|
- IFNULL ( IFNULL(max(f.settleMentAmount) , 0.00) - ( IFNULL(max(f.settleMentAmount) , 0.00) * MAX(f.taxPoints) /100) ,0) as "expendAmount",
|
|
|
+ IFNULL(max(f.taxesFees) , 0.00) as "taxesFees",
|
|
|
+ IFNULL(max(f.expendAmount),0) as "expendAmount",
|
|
|
sum( a.other_feevalue ) AS "otherFeevalue"
|
|
|
FROM
|
|
|
ins_ply_income a
|
|
|
@@ -1152,6 +1157,7 @@
|
|
|
LEFT JOIN ( SELECT a.partner_companies_id AS "partnerCompaniesId",sum(
|
|
|
settlement_amount ) AS "settleMentAmount",
|
|
|
SUM(a.expend_amount) as "expendAmount",
|
|
|
+ IFNULL(sum(settlement_amount ) ,0) -IFNULL(SUM(a.expend_amount),0) as "taxesFees",
|
|
|
SUM(a.tax_points) as "taxPoints"
|
|
|
FROM settlement_documentary_fees a
|
|
|
WHERE a.settlement_status = '2'
|
|
|
@@ -1204,7 +1210,7 @@
|
|
|
and a.is_not_documentary =#{isOther}
|
|
|
</if>
|
|
|
<if test="allPartnerCompaniesId !=null and allPartnerCompaniesId !=''">
|
|
|
- and eic.parent_id =#{allPartnerCompaniesId}
|
|
|
+ AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
|
|
|
</if>
|
|
|
<if test="provincePartnerCompaniesId !=null and provincePartnerCompaniesId !=''">
|
|
|
and eic.parent_id =#{provincePartnerCompaniesId}
|
|
|
@@ -1411,16 +1417,12 @@
|
|
|
and pa.docking_person =#{dockingPerson}
|
|
|
</if>
|
|
|
|
|
|
- <if test="provinceId != null and provinceId != ''">
|
|
|
- and a.deptid like "${provinceId}%"
|
|
|
- </if>
|
|
|
-
|
|
|
<if test="cityId != null and cityId != ''">
|
|
|
- and a.deptid like "${cityId}%"
|
|
|
+ and a.dept_id LIKE CONCAT(#{cityId}, '%')
|
|
|
</if>
|
|
|
|
|
|
<if test="countyId != null and countyId != ''">
|
|
|
- and a.deptid like "${countyId}%"
|
|
|
+ and a.dept_id LIKE CONCAT(#{countyId}, '%')
|
|
|
</if>
|
|
|
|
|
|
<if test="orderno !=null and orderno !=''">
|