|
|
@@ -217,6 +217,13 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
|
|
|
+ <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
|
|
|
+ and a.partner_companies_id in
|
|
|
+ <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="isOther !=null and isOther !=''">
|
|
|
and a.is_not_documentary =#{isOther}
|
|
|
</if>
|
|
|
@@ -270,7 +277,10 @@
|
|
|
AND a.insured_name =#{insuredName}
|
|
|
</if>
|
|
|
<if test="jqStartDate !=null and jqStartDate != '' and jqEndDate != null and jqEndDate !=''">
|
|
|
- AND (a.jq_start_date )
|
|
|
+ AND a.jq_end_date BETWEEN #{jqStartDate} AND #{jqEndDate} AND a.jq_start_date > = #{jqStartDate}
|
|
|
+ </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}
|
|
|
</if>
|
|
|
|
|
|
</where>
|
|
|
@@ -615,6 +625,12 @@
|
|
|
<if test="isNotCar !=null and isNotCar !=''">
|
|
|
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}
|
|
|
+ </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}
|
|
|
+ </if>
|
|
|
|
|
|
<if test="isOther !=null and isOther !=''">
|
|
|
and a.is_not_documentary =#{isOther}
|
|
|
@@ -623,6 +639,24 @@
|
|
|
and a.licenseno =#{licenseno}
|
|
|
</if>
|
|
|
|
|
|
+ <if test="deptId !=null and deptId !=''">
|
|
|
+ and pa.dept_id =#{deptId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+
|
|
|
+ <if test="ids != null and ids != '' and ids.length > 0">
|
|
|
+ and a.id in
|
|
|
+ <foreach collection="ids" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="selectIds != null and selectIds != '' and selectIds.size() > 0">
|
|
|
+ and a.id in
|
|
|
+ <foreach collection="selectIds" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="syPolicyno != null and syPolicyno != '' ">
|
|
|
and a.sy_policyno =#{syPolicyno}
|
|
|
</if>
|
|
|
@@ -669,6 +703,12 @@
|
|
|
<if test="insuredName !=null and insuredName !=''">
|
|
|
AND a.insured_name =#{insuredName}
|
|
|
</if>
|
|
|
+ <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
|
|
|
+ and a.partner_companies_id in
|
|
|
+ <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
@@ -809,6 +849,8 @@
|
|
|
IFNULL ( max(d.settleMentAmount),0.00) as "invoicCommissionFeevalue",
|
|
|
sum(COALESCE( a.commission_feevalue,0.00) )-IFNULL ( max(d.settleMentAmount),0.00) as "noInvoicCommissionFeevalue",
|
|
|
sum(COALESCE( a.commission_feevalue,0.00) )-COALESCE(max(c.settleMentAmount),0.00)+IFNULL ( max(d.settleMentAmount),0.00) AS "unSettledAmount",
|
|
|
+ IFNULL(MAX(f.expendAmount),0.00) as "expendAmount",
|
|
|
+ MAX(COALESCE( f.settleMentAmount,0.00) )-IFNULL ( max(f.expendAmount),0.00) as "taxesFees",
|
|
|
sum( a.commission_feevalue ) AS "commissionFeevalue"
|
|
|
FROM
|
|
|
ins_ply_income a
|
|
|
@@ -832,7 +874,7 @@
|
|
|
GROUP BY partner_companies_id
|
|
|
) d ON d.partnerCompaniesId = a.partner_companies_id
|
|
|
LEFT JOIN ( SELECT a.partner_companies_id AS "partnerCompaniesId",sum(
|
|
|
- settlement_amount ) AS "settleMentAmount" FROM settlement_documentary_fees a
|
|
|
+ settlement_amount ) AS "settleMentAmount" , sum(a.expend_amount) as "expendAmount", sum(a.tax_points ) as "taxPoints" FROM settlement_documentary_fees a
|
|
|
WHERE a.settlement_status = '2'
|
|
|
and a.handling_fees_status ='0'
|
|
|
<if test="isNotCar !=null and isNotCar !=''">
|