|
@@ -32,6 +32,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="queryPage" resultType="com.jzg.commons.entity.orders.vo.FeeAuditVo">
|
|
<select id="queryPage" resultType="com.jzg.commons.entity.orders.vo.FeeAuditVo">
|
|
|
|
|
+ select a.* from (
|
|
|
SELECT
|
|
SELECT
|
|
|
qsu.username , -- 业务员登录账号
|
|
qsu.username , -- 业务员登录账号
|
|
|
ifa.order_no as orderNo,
|
|
ifa.order_no as orderNo,
|
|
@@ -74,7 +75,14 @@
|
|
|
END AS isProblem,
|
|
END AS isProblem,
|
|
|
io.order_source,
|
|
io.order_source,
|
|
|
ioci.vin_no,
|
|
ioci.vin_no,
|
|
|
- ifo.*
|
|
|
|
|
|
|
+ ifo.*,
|
|
|
|
|
+ pa.partner_company_id,iop.jq_policy_no , iop.sy_policy_no , iop.jy_policy_no,
|
|
|
|
|
+ (select ior.start_date from ins_orders_risk ior where ior.order_no = io.id and ior.risk_name = '交强险' ) as jq_risk_start_date,
|
|
|
|
|
+ (select ior.end_date from ins_orders_risk ior where ior.order_no = io.id and ior.risk_name = '交强险' ) as jq_risk_end_date,
|
|
|
|
|
+ (select ior.start_date from ins_orders_risk ior where ior.order_no = io.id and ior.risk_name = '商业险' ) as sy_risk_start_date,
|
|
|
|
|
+ (select ior.end_date from ins_orders_risk ior where ior.order_no = io.id and ior.risk_name = '商业险' ) as sy_risk_end_date,
|
|
|
|
|
+ (select ior.start_date from ins_orders_risk ior where ior.order_no = io.id and ior.risk_name = '驾意险' ) as jy_risk_start_date,
|
|
|
|
|
+ (select ior.end_date from ins_orders_risk ior where ior.order_no = io.id and ior.risk_name = '驾意险' ) as jy_risk_end_date
|
|
|
FROM ins_fee_audit ifa
|
|
FROM ins_fee_audit ifa
|
|
|
LEFT JOIN ins_orders io on ifa.order_no = io.id AND io.is_delete=0
|
|
LEFT JOIN ins_orders io on ifa.order_no = io.id AND io.is_delete=0
|
|
|
LEFT JOIN ins_orders_car_info ioci on io.id = ioci.order_no AND ioci.is_delete=0
|
|
LEFT JOIN ins_orders_car_info ioci on io.id = ioci.order_no AND ioci.is_delete=0
|
|
@@ -87,6 +95,7 @@
|
|
|
LEFT JOIN ins_orders_costs ioc on ioc.order_no = io.id AND ioc.is_delete=0
|
|
LEFT JOIN ins_orders_costs ioc on ioc.order_no = io.id AND ioc.is_delete=0
|
|
|
LEFT JOIN ins_orders_external_policy ioep on ioep.order_no = io.id AND ioep.is_delete=0
|
|
LEFT JOIN ins_orders_external_policy ioep on ioep.order_no = io.id AND ioep.is_delete=0
|
|
|
LEFT JOIN ins_fee_orders ifo on ifo.order_no = ifa.order_no and ifo.is_delete = 0
|
|
LEFT JOIN ins_fee_orders ifo on ifo.order_no = ifa.order_no and ifo.is_delete = 0
|
|
|
|
|
+ LEFT JOIN ins_orders_policy iop on iop.order_no = io.id and iop.is_delete = 0
|
|
|
<where>
|
|
<where>
|
|
|
and ifa.is_delete=0 and ifa.system_code = #{param.systemCode}
|
|
and ifa.is_delete=0 and ifa.system_code = #{param.systemCode}
|
|
|
<if test="param.vinNo != null and param.vinNo !=''">
|
|
<if test="param.vinNo != null and param.vinNo !=''">
|
|
@@ -122,6 +131,30 @@
|
|
|
<if test="param.salesman != null and param.salesman != ''">
|
|
<if test="param.salesman != null and param.salesman != ''">
|
|
|
and (qsu.username = #{param.salesman} or qsu.mobile = #{param.salesman})
|
|
and (qsu.username = #{param.salesman} or qsu.mobile = #{param.salesman})
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="param.phone != null and param.phone != ''">
|
|
|
|
|
+ and (qsu.username = #{param.phone} or qsu.mobile = #{param.phone})
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.contact != null and param.contact != ''">
|
|
|
|
|
+ and (io.docking_person like #{param.contact} or io.docking_person_phone like #{param.contact} )
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.partnerCompanyId != null">
|
|
|
|
|
+ and pa.partner_company_id = #{param.partnerCompanyId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.payingTimeBegin != null and param.payingTimeEnd != null">
|
|
|
|
|
+ and DATE_FORMAT(io.pay_time, '%Y-%m-%d') between #{param.payingTimeBegin} AND #{param.payingTimeEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.quotationTimeStart != null and param.quotationTimeEnd != null">
|
|
|
|
|
+ and DATE_FORMAT(io.create_time, '%Y-%m-%d') between #{param.quotationTimeStart} AND #{param.quotationTimeEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.jqPolicyNo != null and param.jqPolicyNo != ''">
|
|
|
|
|
+ and iop.jq_policy_no = #{param.jqPolicyNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.syPolicyNo != null and param.syPolicyNo != ''">
|
|
|
|
|
+ and iop.sy_policy_no = #{param.syPolicyNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.jyPolicyNo != null and param.jyPolicyNo != ''">
|
|
|
|
|
+ and iop.jy_policy_no = #{param.jyPolicyNo}
|
|
|
|
|
+ </if>
|
|
|
<if test="param.orderStatus != null ">
|
|
<if test="param.orderStatus != null ">
|
|
|
and io.order_status = #{param.orderStatus}
|
|
and io.order_status = #{param.orderStatus}
|
|
|
</if>
|
|
</if>
|
|
@@ -177,7 +210,19 @@
|
|
|
and ifa.audit_status = #{param.auditStatus}
|
|
and ifa.audit_status = #{param.auditStatus}
|
|
|
</if>
|
|
</if>
|
|
|
</where>
|
|
</where>
|
|
|
- ORDER BY io.create_time desc
|
|
|
|
|
|
|
+ ) a
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="param.jqRiskStartDateBegin != null and param.jqRiskStartDateEnd != null">
|
|
|
|
|
+ and a.jq_risk_start_date >= #{param.jqRiskStartDateBegin} and a.jq_risk_start_date < #{param.jqRiskStartDateEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.syRiskStartDateBegin != null and param.syRiskStartDateEnd != null">
|
|
|
|
|
+ and a.sy_risk_start_date >= #{param.syRiskStartDateBegin} and a.sy_risk_start_date < #{param.syRiskStartDateEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="param.jyRiskStartDateBegin != null and param.jyRiskStartDateEnd != null">
|
|
|
|
|
+ and a.jy_risk_start_date >= #{param.jyRiskStartDateBegin} and a.jy_risk_start_date < #{param.jyRiskStartDateEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ ORDER BY a.createTime desc
|
|
|
</select>
|
|
</select>
|
|
|
<select id="queryList" resultType="com.jzg.commons.entity.orders.vo.FeeAuditVo">
|
|
<select id="queryList" resultType="com.jzg.commons.entity.orders.vo.FeeAuditVo">
|
|
|
SELECT
|
|
SELECT
|