|
|
@@ -3146,5 +3146,141 @@
|
|
|
</if>
|
|
|
order by io.createtime
|
|
|
</select>
|
|
|
+ <select id="queryPageOrderCB" resultType="com.ydtech.modules.order.entity.InsOrders">
|
|
|
+ SELECT
|
|
|
+ iac.id as orderno,
|
|
|
+ io.quoteno,
|
|
|
+ io.orderstatus,
|
|
|
+ io.company_id,
|
|
|
+ io.ins_company,
|
|
|
+ io.carinfo,
|
|
|
+ io.userid,
|
|
|
+ io.username,
|
|
|
+ io.deptid,
|
|
|
+ io.deptname,
|
|
|
+ io.agreeid,
|
|
|
+ iac.productid,
|
|
|
+ iac.product,
|
|
|
+ iac.createtime,
|
|
|
+ io.frameno,
|
|
|
+ io.licenseno,
|
|
|
+ JSON_UNQUOTE(json_extract(io.insureinfo, '$.name')) as insuredname,
|
|
|
+ io.is_external,
|
|
|
+ iac.jq_start_date as jqstartdate,
|
|
|
+ iac.jq_end_date as jqenddate,
|
|
|
+ iac.sy_start_date as systartdate,
|
|
|
+ iac.sy_end_date as syenddate,
|
|
|
+ io.vehicle_and_vessel_tax,
|
|
|
+ io.operatorid,
|
|
|
+ iac.operator_name,
|
|
|
+ sd.management_source,
|
|
|
+ iac.problem_order,
|
|
|
+ eic.namesimple as partnerCompaniesName,
|
|
|
+ iac.id as subOrderId,
|
|
|
+ iac.signing_time as signingTime,
|
|
|
+ iac.pay_date as payDate,
|
|
|
+ pa.agreement_code as agreementCode,
|
|
|
+ pa.agreement_name as agreementName,
|
|
|
+ pa.business_description as businessDescription,
|
|
|
+ pa.job_description as jobDescription,
|
|
|
+ pa.agreement_title as agreementTitle,
|
|
|
+ pa.docking_person as dockingPerson,
|
|
|
+ io.entry_status
|
|
|
+ FROM
|
|
|
+ ins_area_company iac
|
|
|
+ LEFT JOIN ins_orders io ON iac.orderno = io.orderno
|
|
|
+ LEFT JOIN sys_user su ON su.id = io.userid
|
|
|
+ LEFT JOIN sys_dept sd ON sd.id = su.dept_id
|
|
|
+ LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
|
|
|
+ LEFT JOIN esm_ins_company eic ON eic.id = pa.partner_companies_id
|
|
|
+ WHERE
|
|
|
+ iac.orderstatus = 3
|
|
|
+ <if test="params.quoteStartDateStr != null and params.quoteStartDateStr != '' and params.quoteEndDateStr != null and params.quoteEndDateStr != ''">
|
|
|
+ and DATE_FORMAT(iac.createtime, '%Y-%m-%d') between #{params.quoteStartDateStr} AND
|
|
|
+ #{params.quoteEndDateStr}
|
|
|
+ </if>
|
|
|
+ <if test="params.orderNo != null and params.orderNo != ''">
|
|
|
+ AND iac.id= #{params.orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="params.licenseNo != null and params.licenseNo != ''">
|
|
|
+ AND io.licenseno = #{params.licenseNo}
|
|
|
+ </if>
|
|
|
+ <if test="params.frameNo != null and params.frameNo != ''">
|
|
|
+ AND io.frameno = #{params.frameNo}
|
|
|
+ </if>
|
|
|
+ <if test="params.insuredName != null and params.insuredName != ''">
|
|
|
+ AND json_extract(io.insureinfo, '$.name') = #{params.insuredName}
|
|
|
+ </if>
|
|
|
+ <if test="params.companyId != null and params.companyId != ''">
|
|
|
+ AND io.company_id = #{params.companyId}
|
|
|
+ </if>
|
|
|
+ <if test="params.engineNo != null and params.engineNo != ''">
|
|
|
+ and JSON_EXTRACT( io.carinfo, '$.engineNo' ) = #{params.engineNo}
|
|
|
+ </if>
|
|
|
+ <if test="params.riskCode != null and params.riskCode != ''">
|
|
|
+ and iac.product = #{params.riskCode}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="params.attachStartDateStr != null and params.attachStartDateStr != '' and params.attachStartDateStr != null and params.attachStartDateStr != '' ">
|
|
|
+ and ((
|
|
|
+ DATE_FORMAT(iac.jq_start_date, '%Y-%m-%d') BETWEEN #{params.attachStartDateStr}
|
|
|
+ AND #{params.attachEndDateStr}
|
|
|
+ )
|
|
|
+ OR ( DATE_FORMAT(iac.sy_start_date, '%Y-%m-%d') BETWEEN #{params.attachStartDateStr} AND
|
|
|
+ #{params.attachEndDateStr} )
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="params.provinceId != null and params.provinceId != ''">
|
|
|
+ and io.deptid like "${params.provinceId}%"
|
|
|
+ </if>
|
|
|
+ <if test="params.problemOrder != null and params.problemOrder != ''">
|
|
|
+ and iac.problem_order like "${params.problemOrder}%"
|
|
|
+ </if>
|
|
|
+ <if test="params.cityId != null and params.cityId != ''">
|
|
|
+ and io.deptid like "${params.cityId}%"
|
|
|
+ </if>
|
|
|
+ <if test="params.countyId != null and params.countyId != ''">
|
|
|
+ and io.deptid like "${params.countyId}%"
|
|
|
+ </if>
|
|
|
+ <if test="params.houseId != null and params.houseId != ''">
|
|
|
+ and io.deptid like "${params.houseId}%"
|
|
|
+ </if>
|
|
|
+ <if test="params.operatorId != null and params.operatorId != ''">
|
|
|
+ and io.userid = #{params.operatorId}
|
|
|
+ </if>
|
|
|
+ <if test="params.operatorName != null and params.operatorName != ''">
|
|
|
+ and io.username = #{params.operatorName}
|
|
|
+ </if>
|
|
|
+ <if test="params.auditId != null and params.auditId != ''">
|
|
|
+ and iac.new_operator_id = #{params.auditId}
|
|
|
+ </if>
|
|
|
+ <if test="params.agreeId != null and params.agreeId != ''">
|
|
|
+ and iac.agreement_id = #{params.agreeId}
|
|
|
+ </if>
|
|
|
+ <if test="params.managementSource != null and params.managementSource != ''">
|
|
|
+ and sd.management_source = #{params.managementSource}
|
|
|
+ </if>
|
|
|
+ <if test="params.signStartDateStr != null and params.signStartDateStr != '' and params.signEndDateStr != null and params.signEndDateStr != ''">
|
|
|
+ and DATE_FORMAT(iac.signing_time, '%Y-%m-%d') between #{params.signStartDateStr} AND
|
|
|
+ #{params.signEndDateStr}
|
|
|
+ </if>
|
|
|
+ <if test="params.payStartDateStr != null and params.payStartDateStr != '' and params.payEndDateStr != null and params.payEndDateStr != ''">
|
|
|
+ and iac.pay_date between #{params.payStartDateStr} AND #{params.payEndDateStr}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="params.isExternal != null and params.isExternal != ''">
|
|
|
+ and io.is_external = #{params.isExternal}
|
|
|
+ </if>
|
|
|
+ <if test="params.jqPolicyNo != null and params.jqPolicyNo != ''">
|
|
|
+ and iac.jqpolicyno = #{params.jqPolicyNo}
|
|
|
+ </if>
|
|
|
+ <if test="params.syPolicyNo != null and params.syPolicyNo != ''">
|
|
|
+ and iac.sypolicyno = #{params.syPolicyNo}
|
|
|
+ </if>
|
|
|
+ <if test="params.noPolicyNo != null and params.noPolicyNo != ''">
|
|
|
+ and iac.cross_insurance like concat('%', #{params.noPolicyNo}, '%')
|
|
|
+ </if>
|
|
|
+ order by iac.createtime desc
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|