|
|
@@ -184,39 +184,29 @@
|
|
|
<if test="licenseno != null and licenseno != ''">
|
|
|
and a.licenseno =#{licenseno}
|
|
|
</if>
|
|
|
-
|
|
|
- <if test="policyno != null and policyno != '' and policyno.length > 0">
|
|
|
- and a.policyno in
|
|
|
- <foreach collection="policyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="syPolicyno != null and syPolicyno != ''">
|
|
|
+ and a.sy_policyno =#{syPolicyno}
|
|
|
</if>
|
|
|
|
|
|
- <if test="syPolicyno != null and syPolicyno != '' and syPolicyno.length > 0">
|
|
|
- and a.sy_policyno in
|
|
|
- <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="noPolicyno != null and noPolicyno != '' and noPolicyno.length > 0">
|
|
|
- and a.no_policyno in
|
|
|
- <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="noPolicyno != null and noPolicyno != ''">
|
|
|
+ and a.no_policyno =#{noPolicyno}
|
|
|
</if>
|
|
|
<if test="signdate !=null and signdate !=''">
|
|
|
- a.signdate =#{signdate}
|
|
|
+ AND a.signdate =#{signdate}
|
|
|
</if>
|
|
|
<if test="partnerCompaniesId !=null and partnerCompaniesId !=''">
|
|
|
- a.partner_companies_id =#{partnerCompaniesId}
|
|
|
+ AND a.partner_companies_id =#{partnerCompaniesId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="partnerCompaniesName !=null and partnerCompaniesName !=''">
|
|
|
+ AND a.partner_companies_name =#{partnerCompaniesName}
|
|
|
</if>
|
|
|
|
|
|
<if test="createTime !=null and createTime !=''">
|
|
|
- a.create_time =#{createTime}
|
|
|
+ AND a.create_time =#{createTime}
|
|
|
</if>
|
|
|
<if test="settlementTime !=null and settlementTime !=''">
|
|
|
- a.settlement_time =#{settlementTime}
|
|
|
+ AND a.settlement_time =#{settlementTime}
|
|
|
</if>
|
|
|
|
|
|
<if test="userId !=null and userId !=''">
|
|
|
@@ -238,7 +228,7 @@
|
|
|
AND day(a.signdate) =#{day}
|
|
|
</if>
|
|
|
<if test="insuredName !=null and insuredName !=''">
|
|
|
- a.insured_name =#{insuredName}
|
|
|
+ AND a.insured_name =#{insuredName}
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -446,25 +436,16 @@
|
|
|
</foreach>
|
|
|
</if>
|
|
|
|
|
|
- <if test="policyno != null and policyno != '' and policyno.length > 0">
|
|
|
- and a.policyno in
|
|
|
- <foreach collection="policyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="policyno != null and policyno != '' ">
|
|
|
+ and a.policyno =#{policyno}
|
|
|
</if>
|
|
|
|
|
|
- <if test="syPolicyno != null and syPolicyno != '' and syPolicyno.length > 0">
|
|
|
- and a.sy_policyno in
|
|
|
- <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="syPolicyno != null and syPolicyno != '' ">
|
|
|
+ and a.sy_policyno =#{syPolicyno}
|
|
|
</if>
|
|
|
|
|
|
- <if test="noPolicyno != null and noPolicyno != '' and noPolicyno.length > 0">
|
|
|
- and a.no_policyno in
|
|
|
- <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="noPolicyno != null and noPolicyno != ''">
|
|
|
+ and a.no_policyno =#{noPolicyno}
|
|
|
</if>
|
|
|
<if test="signdate !=null and signdate !=''">
|
|
|
a.signdate =#{signdate}
|
|
|
@@ -552,38 +533,29 @@
|
|
|
and a.licenseno =#{licenseno}
|
|
|
</if>
|
|
|
|
|
|
- <if test="policyno != null and policyno != '' and policyno.length > 0">
|
|
|
- and a.policyno in
|
|
|
- <foreach collection="policyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="syPolicyno != null and syPolicyno != '' ">
|
|
|
+ and a.sy_policyno =#{syPolicyno}
|
|
|
</if>
|
|
|
|
|
|
- <if test="syPolicyno != null and syPolicyno != '' and syPolicyno.length > 0">
|
|
|
- and a.sy_policyno in
|
|
|
- <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="noPolicyno != null and noPolicyno != '' and noPolicyno.length > 0">
|
|
|
- and a.no_policyno in
|
|
|
- <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="noPolicyno != null and noPolicyno != ''">
|
|
|
+ and a.no_policyno =#{noPolicyno}
|
|
|
</if>
|
|
|
<if test="signdate !=null and signdate !=''">
|
|
|
- a.signdate =#{signdate}
|
|
|
+ AND a.signdate =#{signdate}
|
|
|
</if>
|
|
|
<if test="partnerCompaniesId !=null and partnerCompaniesId !=''">
|
|
|
- a.partner_companies_id =#{partnerCompaniesId}
|
|
|
+ AND a.partner_companies_id =#{partnerCompaniesId}
|
|
|
</if>
|
|
|
|
|
|
<if test="createTime !=null and createTime !=''">
|
|
|
- a.create_time =#{createTime}
|
|
|
+ AND a.create_time =#{createTime}
|
|
|
</if>
|
|
|
<if test="settlementTime !=null and settlementTime !=''">
|
|
|
- a.settlement_time =#{settlementTime}
|
|
|
+ AND a.settlement_time =#{settlementTime}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="partnerCompaniesName !=null and partnerCompaniesName !=''">
|
|
|
+ AND a.partner_companies_name =#{partnerCompaniesName}
|
|
|
</if>
|
|
|
|
|
|
<if test="userId !=null and userId !=''">
|
|
|
@@ -604,6 +576,9 @@
|
|
|
<if test="day !=null and day !=''">
|
|
|
AND day(a.signdate) =#{day}
|
|
|
</if>
|
|
|
+ <if test="insuredName !=null and insuredName !=''">
|
|
|
+ AND a.insured_name =#{insuredName}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
@@ -681,32 +656,18 @@
|
|
|
<if test="isOther !=null and isOther !=''">
|
|
|
and a.is_not_documentary =#{isOther}
|
|
|
</if>
|
|
|
- <if test="licenseno != null and licenseno != '' and licenseno.length > 0">
|
|
|
- and a.licenseno in
|
|
|
- <foreach collection="licenseno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="licenseno != null and licenseno != ''">
|
|
|
+ and a.licenseno =#{licenseno}
|
|
|
</if>
|
|
|
|
|
|
- <if test="policyno != null and policyno != '' and policyno.length > 0">
|
|
|
- and a.policyno in
|
|
|
- <foreach collection="policyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
|
|
|
- <if test="syPolicyno != null and syPolicyno != '' and syPolicyno.length > 0">
|
|
|
- and a.sy_policyno in
|
|
|
- <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="syPolicyno != null and syPolicyno != ''">
|
|
|
+ and a.sy_policyno =#{syPolicyno}
|
|
|
</if>
|
|
|
|
|
|
- <if test="noPolicyno != null and noPolicyno != '' and noPolicyno.length > 0">
|
|
|
- and a.no_policyno in
|
|
|
- <foreach collection="syPolicyno" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
+ <if test="noPolicyno != null and noPolicyno != ''">
|
|
|
+ and a.no_policyno =#{noPolicyno}
|
|
|
+
|
|
|
</if>
|
|
|
<if test="signdate !=null and signdate !=''">
|
|
|
a.signdate =#{signdate}
|
|
|
@@ -786,22 +747,22 @@
|
|
|
|
|
|
<select id="allOtherAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
|
|
|
SELECT
|
|
|
- a.company_id AS "companyId",
|
|
|
- MAX( a.company_name ) AS "companyName",
|
|
|
- MAX( a.partner_companies_name) as "partnerCompaniesName",
|
|
|
- IF(MAX( c.unsettledAmount ) IS NULL , sum( a.other_feevalue ), MAX( c.unsettledAmount ) ) AS "noInvoicCommissionFeevalue",
|
|
|
- MAX(c.invoicIds) as "incomeIds",
|
|
|
- MAX(COALESCE(c.settleMentAmount, 0) - COALESCE(f.settleMentAmount, 0)) AS "invoicCommissionFeevalue",
|
|
|
- MAX(f.settleMentAmount) as "settleMentAmount",
|
|
|
- GROUP_CONCAT(a.id) as "ids",
|
|
|
- IF(MAX( f.unSettledAmount ) is null ,MAX( c.settleMentAmount ) ,MAX( f.unSettledAmount )) AS "unSettledAmount",
|
|
|
- sum( a.other_feevalue ) AS "otherFeevalue"
|
|
|
+ a.company_id AS "companyId",
|
|
|
+ MAX( a.company_name ) AS "companyName",
|
|
|
+ MAX( a.partner_companies_name ) AS "partnerCompaniesName",
|
|
|
+ MAX( c.invoicIds ) AS "incomeIds",
|
|
|
+ GROUP_CONCAT( a.id ) AS "ids",
|
|
|
+ max(c.settleMentAmount) as "invoicCommissionFeevalue",
|
|
|
+ sum( a.other_feevalue )-max(c.settleMentAmount) as "noInvoicCommissionFeevalue",
|
|
|
+ max(f.settleMentAmount) as "settleMentAmount",
|
|
|
+ MAX(COALESCE(c.settleMentAmount, 0) - COALESCE(f.settleMentAmount, 0)) AS "unSettledAmount",
|
|
|
+ sum( a.other_feevalue ) AS "otherFeevalue"
|
|
|
FROM
|
|
|
ins_ply_income a
|
|
|
LEFT JOIN ptl_agreement pa ON a.agreement_id = pa.id
|
|
|
LEFT JOIN ( SELECT a.company_id AS "companyId", MIN( a.unsettled_amount ) AS "unsettledAmount" ,sum(
|
|
|
settlement_amount ) AS "settleMentAmount", GROUP_CONCAT(a.id) as "invoicIds" FROM settlement_documentary_fees a
|
|
|
- WHERE a.settlement_status = '1'
|
|
|
+ WHERE ( a.settlement_status = '1' or a.settlement_status = '2')
|
|
|
<if test="isNotCar !=null and isNotCar !=''">
|
|
|
and a.is_not_car =#{isNotCar}
|
|
|
</if>
|