|
@@ -465,10 +465,10 @@
|
|
|
and a.no_policyno =#{noPolicyno}
|
|
and a.no_policyno =#{noPolicyno}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="signdate !=null and signdate !=''">
|
|
<if test="signdate !=null and signdate !=''">
|
|
|
- a.signdate =#{signdate}
|
|
|
|
|
|
|
+ and a.signdate =#{signdate}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="partnerCompaniesId !=null and partnerCompaniesId !=''">
|
|
<if test="partnerCompaniesId !=null and partnerCompaniesId !=''">
|
|
|
- a.partner_companies_id =#{partnerCompaniesId}
|
|
|
|
|
|
|
+ and a.partner_companies_id =#{partnerCompaniesId}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="createTime !=null and createTime !=''">
|
|
<if test="createTime !=null and createTime !=''">
|
|
@@ -503,9 +503,11 @@
|
|
|
<select id="bxTotalAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
|
|
<select id="bxTotalAmount" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
|
|
|
SELECT
|
|
SELECT
|
|
|
SUM(a.commission_feevalue) AS commissionFeevalue,
|
|
SUM(a.commission_feevalue) AS commissionFeevalue,
|
|
|
- SUM(CASE WHEN handling_fees_status = '0' THEN a.commission_feevalue ELSE 0 END) AS noInvoicCommissionFeevalue,
|
|
|
|
|
- SUM(CASE WHEN handling_fees_status = '1' THEN a.commission_feevalue ELSE 0 END) AS readyCommissionFeevalue,
|
|
|
|
|
- SUM(CASE WHEN handling_fees_status = '2' THEN a.commission_feevalue ELSE 0 END) AS invoicCommissionFeevalue
|
|
|
|
|
|
|
+ SUM(CASE WHEN a.handling_fees_status = '2' THEN a.commission_feevalue ELSE 0 END) AS "invoicCommissionFeevalue",
|
|
|
|
|
+ SUM( CASE WHEN a.handling_fees_status = '0' THEN a.commission_feevalue ELSE 0 END ) AS "noInvoicCommissionFeevalue",
|
|
|
|
|
+ SUM(CASE WHEN a.handling_fees_status = '1' THEN a.commission_feevalue ELSE 0 END) AS "readyCommissionFeevalue",
|
|
|
|
|
+ SUM( CASE WHEN ( a.handling_fees_status = '2' or a.handling_fees_status = '1' ) THEN a.commission_feevalue ELSE 0 END ) AS "allInvoicCommissionFeevalue",
|
|
|
|
|
+ SUM( CASE WHEN ( a.handling_fees_status = '2' or a.handling_fees_status = '0' ) THEN a.commission_feevalue ELSE 0 END ) AS "unSettledAmount"
|
|
|
FROM
|
|
FROM
|
|
|
ins_ply_income a
|
|
ins_ply_income a
|
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
@@ -687,17 +689,17 @@
|
|
|
|
|
|
|
|
</if>
|
|
</if>
|
|
|
<if test="signdate !=null and signdate !=''">
|
|
<if test="signdate !=null and signdate !=''">
|
|
|
- a.signdate =#{signdate}
|
|
|
|
|
|
|
+ and a.signdate =#{signdate}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="partnerCompaniesId !=null and partnerCompaniesId !=''">
|
|
<if test="partnerCompaniesId !=null and partnerCompaniesId !=''">
|
|
|
- a.partner_companies_id =#{partnerCompaniesId}
|
|
|
|
|
|
|
+ and a.partner_companies_id =#{partnerCompaniesId}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="createTime !=null and createTime !=''">
|
|
<if test="createTime !=null and createTime !=''">
|
|
|
- a.create_time =#{createTime}
|
|
|
|
|
|
|
+ and a.create_time =#{createTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="settlementTime !=null and settlementTime !=''">
|
|
<if test="settlementTime !=null and settlementTime !=''">
|
|
|
- a.settlement_time =#{settlementTime}
|
|
|
|
|
|
|
+ and a.settlement_time =#{settlementTime}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
<if test="userId !=null and userId !=''">
|
|
<if test="userId !=null and userId !=''">
|
|
@@ -919,10 +921,38 @@
|
|
|
LEFT JOIN ptl_agreement pa on a.agreement_id = pa.id
|
|
LEFT JOIN ptl_agreement pa on a.agreement_id = pa.id
|
|
|
LEFT JOIN sys_user su on su.id=a.user_id
|
|
LEFT JOIN sys_user su on su.id=a.user_id
|
|
|
<where>
|
|
<where>
|
|
|
- a.id IN
|
|
|
|
|
- <foreach item="item" index="index" collection="idArr" open="(" separator="," close=")">
|
|
|
|
|
- #{item}
|
|
|
|
|
- </foreach>
|
|
|
|
|
|
|
+ 1=1
|
|
|
|
|
+ AND a.invoic_id is not null
|
|
|
|
|
+ <if test="idArr !=null and idArr!=''">
|
|
|
|
|
+ a.id IN
|
|
|
|
|
+ <foreach item="item" index="index" collection="idArr" open="(" separator="," close=")">
|
|
|
|
|
+ #{item}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="agreementType !=null and agreementType!='' ">
|
|
|
|
|
+ AND pa.agreement_type =#{agreementType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="year !=null and year !=''">
|
|
|
|
|
+ AND YEAR(a.signdate) =#{year}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="isOther !=null and isOther !=''">
|
|
|
|
|
+ and a.is_not_documentary =#{isOther}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="isNotCar !=null and isNotCar !=''">
|
|
|
|
|
+ and a.is_not_car =#{isNotCar}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="handlingFeesStatus !=null and handlingFeesStatus !=''">
|
|
|
|
|
+ and a.handling_fees_status =#{handlingFeesStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="month !=null and month !=''">
|
|
|
|
|
+ AND month(a.signdate) =#{month}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="day !=null and day !=''">
|
|
|
|
|
+ AND day(a.signdate) =#{day}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="partnerCompaniesId !=null and partnerCompaniesId !=''">
|
|
|
|
|
+ AND a.partner_companies_id =#{partnerCompaniesId}
|
|
|
|
|
+ </if>
|
|
|
</where>
|
|
</where>
|
|
|
group by a.invoic_id
|
|
group by a.invoic_id
|
|
|
</select>
|
|
</select>
|