|
@@ -230,7 +230,7 @@
|
|
|
a.max_non_car_receivable_ratio,
|
|
a.max_non_car_receivable_ratio,
|
|
|
a.max_receivable,
|
|
a.max_receivable,
|
|
|
a.revenue_time,
|
|
a.revenue_time,
|
|
|
- (a.receivable + if(a.subsidy_amount is null, 0, a.subsidy_amount) ) AS total_receivable_amount,
|
|
|
|
|
|
|
+ (a.receivable + if(a.subsidy_amount is null, 0, a.subsidy_amount) ) AS total_receivable_amount,
|
|
|
if(a.settlement_amount is null, 0, a.settlement_amount) as settlement_amount,
|
|
if(a.settlement_amount is null, 0, a.settlement_amount) as settlement_amount,
|
|
|
( CASE a.clearing_state WHEN 1 THEN '已结算' WHEN 0 THEN '未结算' WHEN 2 THEN '孤儿单' END ) AS clearing_state,
|
|
( CASE a.clearing_state WHEN 1 THEN '已结算' WHEN 0 THEN '未结算' WHEN 2 THEN '孤儿单' END ) AS clearing_state,
|
|
|
( CASE a.insurance_clearing_state WHEN 1 THEN '已结算' WHEN 0 THEN '未结算' END ) AS insurance_clearing_state
|
|
( CASE a.insurance_clearing_state WHEN 1 THEN '已结算' WHEN 0 THEN '未结算' END ) AS insurance_clearing_state
|
|
@@ -301,33 +301,41 @@
|
|
|
) a
|
|
) a
|
|
|
WHERE
|
|
WHERE
|
|
|
1 =1
|
|
1 =1
|
|
|
- <if test="param.signDateStartTime != null and param.signDateStartTime != ''">
|
|
|
|
|
- and a.sign_date between #{param.signDateStartTime} and #{param.signDateEndTime}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="param.agencySettlementTimeStartTime != null and param.agencySettlementTimeStartTime != ''">
|
|
|
|
|
- and a.agency_settlement_time between #{param.agencySettlementTimeStartTime} and #{param.agencySettlementTimeEndTime}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="param.operationsTeam != null and param.operationsTeam != ''">
|
|
|
|
|
- and a.operations_team = #{param.operationsTeam}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="param.channelClassification != null and param.channelClassification != ''">
|
|
|
|
|
- and a.channel_classification = #{param.channelClassification}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="param.channel != null and param.channel != ''">
|
|
|
|
|
- and a.channel = #{param.channel}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="param.licenseNo != null and param.licenseNo != ''">
|
|
|
|
|
- and a.licenseno = #{param.licenseNo}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="param.insuredName != null and param.insuredName != ''">
|
|
|
|
|
- and a.insured_name = #{param.insuredName}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="param.insuranceId != null and param.insuranceId != ''">
|
|
|
|
|
- and a.insurance_id = #{param.insuranceId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="param.insuranceDeptId != null and param.insuranceDeptId != ''">
|
|
|
|
|
- and a.insurance_dept_id = #{param.insuranceDeptId}
|
|
|
|
|
- </if>
|
|
|
|
|
|
|
+ <if test="param.signDateStartTime != null and param.signDateStartTime != ''">
|
|
|
|
|
+ and a.sign_date between #{param.signDateStartTime} and #{param.signDateEndTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.agencySettlementTimeStartTime != null and param.agencySettlementTimeStartTime != ''">
|
|
|
|
|
+ and a.agency_settlement_time between #{param.agencySettlementTimeStartTime} and
|
|
|
|
|
+ #{param.agencySettlementTimeEndTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.operationsTeam != null and param.operationsTeam != ''">
|
|
|
|
|
+ and a.operations_team = #{param.operationsTeam}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.channelClassification != null and param.channelClassification != ''">
|
|
|
|
|
+ and a.channel_classification = #{param.channelClassification}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.channel != null and param.channel != ''">
|
|
|
|
|
+ and a.channel = #{param.channel}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.licenseNo != null and param.licenseNo != ''">
|
|
|
|
|
+ and a.licenseno in
|
|
|
|
|
+ <foreach item="licenseNo" collection="param.licenseNo.split(',')" open="(" separator="," close=")">
|
|
|
|
|
+ #{licenseNo}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.insuredName != null and param.insuredName != ''">
|
|
|
|
|
+ and a.insured_name in
|
|
|
|
|
+ <foreach item="insuredName" collection="param.insuredName.split(',')" open="(" separator="," close=")">
|
|
|
|
|
+ #{insuredName}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.insuranceId != null and param.insuranceId != ''">
|
|
|
|
|
+ and a.insurance_id = #{param.insuranceId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.insuranceDeptId != null and param.insuranceDeptId != ''">
|
|
|
|
|
+ and a.insurance_dept_id = #{param.insuranceDeptId}
|
|
|
|
|
+ </if>
|
|
|
<if test="param.clearingState != null and param.clearingState != ''">
|
|
<if test="param.clearingState != null and param.clearingState != ''">
|
|
|
and a.clearing_state = #{param.clearingState}
|
|
and a.clearing_state = #{param.clearingState}
|
|
|
</if>
|
|
</if>
|
|
@@ -340,19 +348,29 @@
|
|
|
<if test="param.insuranceType != null and param.insuranceType != ''">
|
|
<if test="param.insuranceType != null and param.insuranceType != ''">
|
|
|
and a.insurance_type = #{param.insuranceType}
|
|
and a.insurance_type = #{param.insuranceType}
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+
|
|
|
<if test="param.jqPolicyId != null and param.jqPolicyId != ''">
|
|
<if test="param.jqPolicyId != null and param.jqPolicyId != ''">
|
|
|
- and a.jq_policy_id = #{param.jqPolicyId}
|
|
|
|
|
|
|
+ and a.jq_policy_id in
|
|
|
|
|
+ <foreach item="jqPolicyId" collection="param.jqPolicyId.split(',')" open="(" separator="," close=")">
|
|
|
|
|
+ #{jqPolicyId}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="param.syPolicyId != null and param.syPolicyId != ''">
|
|
<if test="param.syPolicyId != null and param.syPolicyId != ''">
|
|
|
- and a.sy_policy_id = #{param.syPolicyId}
|
|
|
|
|
|
|
+ and a.sy_policy_id in
|
|
|
|
|
+ <foreach item="syPolicyId" collection="param.syPolicyId.split(',')" open="(" separator="," close=")">
|
|
|
|
|
+ #{syPolicyId}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="param.nonCarPolicyId != null and param.nonCarPolicyId != ''">
|
|
<if test="param.nonCarPolicyId != null and param.nonCarPolicyId != ''">
|
|
|
- and a.non_car_policy_id = #{param.nonCarPolicyId}
|
|
|
|
|
|
|
+ and a.non_car_policy_id in
|
|
|
|
|
+ <foreach item="nonCarPolicyId" collection="param.nonCarPolicyId.split(',')" open="(" separator="," close=")">
|
|
|
|
|
+ #{nonCarPolicyId}
|
|
|
|
|
+ </foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="param.revenueTimeStartTime != null and param.revenueTimeStartTime != ''">
|
|
<if test="param.revenueTimeStartTime != null and param.revenueTimeStartTime != ''">
|
|
|
and a.revenue_time <![CDATA[ >= ]]> CAST(CONCAT(#{param.revenueTimeStartTime},' 00:00:00') AS datetime)
|
|
and a.revenue_time <![CDATA[ >= ]]> CAST(CONCAT(#{param.revenueTimeStartTime},' 00:00:00') AS datetime)
|
|
|
</if>
|
|
</if>
|
|
|
- <if test="param.revenueTimeEndTime != null and param.revenueTimeEndTime != '' " >
|
|
|
|
|
|
|
+ <if test="param.revenueTimeEndTime != null and param.revenueTimeEndTime != '' ">
|
|
|
and a.revenue_time <![CDATA[ <= ]]> CAST(CONCAT(#{param.revenueTimeEndTime},' 23:59:59') AS datetime)
|
|
and a.revenue_time <![CDATA[ <= ]]> CAST(CONCAT(#{param.revenueTimeEndTime},' 23:59:59') AS datetime)
|
|
|
</if>
|
|
</if>
|
|
|
|
|
|