|
|
@@ -383,4 +383,127 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <resultMap id="PolicyInsuranceReportMap" type="com.ydtech.modules.order.entity.vo.PolicyInsuranceReportResVo">
|
|
|
+ <result property="insCompany" column="insCompany" jdbcType="VARCHAR"/>
|
|
|
+ <result property="agreementName" column="agreementName" jdbcType="VARCHAR"/>
|
|
|
+ <result property="policyNo" column="policyNo" jdbcType="VARCHAR"/>
|
|
|
+ <result property="quoteDate" column="quoteDate" jdbcType="VARCHAR"/>
|
|
|
+ <result property="policyStartDate" column="policyStartDate" jdbcType="VARCHAR"/>
|
|
|
+ <result property="riskName" column="riskName" jdbcType="VARCHAR"/>
|
|
|
+ <result property="sumPremium" column="sumPremium" jdbcType="DECIMAL"/>
|
|
|
+ <result property="taxPremium" column="taxPremium" jdbcType="DECIMAL"/>
|
|
|
+ <result property="taxLaterPremium" column="taxLaterPremium" jdbcType="DECIMAL"/>
|
|
|
+ <result property="insuranceSubAmount" column="insuranceSubAmount" jdbcType="VARCHAR"/>
|
|
|
+ <result property="licenseNo" column="licenseNo" jdbcType="VARCHAR"/>
|
|
|
+ <result property="vehicleUse" column="vehicleUse" jdbcType="VARCHAR"/>
|
|
|
+ <result property="powerType" column="powerType" jdbcType="VARCHAR"/>
|
|
|
+ <result property="ciModelClass" column="ciModelClass" jdbcType="VARCHAR"/>
|
|
|
+ <result property="limitLoad" column="limitLoad" jdbcType="VARCHAR"/>
|
|
|
+ <result property="appliName" column="appliName" jdbcType="VARCHAR"/>
|
|
|
+ <result property="insureName" column="insureName" jdbcType="VARCHAR"/>
|
|
|
+ <result property="deptName" column="deptName" jdbcType="VARCHAR"/>
|
|
|
+ <result property="userName" column="username" jdbcType="VARCHAR"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="getPolicyInsuranceReport" parameterType="java.lang.String" resultMap="PolicyInsuranceReportMap">
|
|
|
+
|
|
|
+ /*交强数据*/
|
|
|
+ SELECT a.`inscompany` AS insCompany,
|
|
|
+ (SELECT agreement_name FROM ptl_agreement t WHERE t.`id`= a.`agreement_id`) AS agreementName,
|
|
|
+ a.`jqpolicyno` AS policyNo,
|
|
|
+ getValidDate(a.`orderno`,a.`id`) AS quoteDate,
|
|
|
+ a.`jq_start_date` AS policyStartDate,
|
|
|
+ '交强险' AS riskName,
|
|
|
+ a.`jqpremium` AS sumPremium,
|
|
|
+ a.`taxamount` AS taxPremium,
|
|
|
+ getCarShipLateFee(a.`id`) AS taxLaterPremium,
|
|
|
+ '交强险 : 200000.00,' AS insuranceSubAmount,
|
|
|
+ b.`licenseno` AS licenseNo,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.vehicleUse'),'"',''),'3') AS vehicleUse,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.powertype'),'"',''),'2') AS powerType,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.cimodelclass'),'"',''),'4') AS ciModelClass,
|
|
|
+ REPLACE(JSON_EXTRACT(b.carinfo, '$.limitLoad'),'"','') AS limitLoad,
|
|
|
+ REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') AS appliName,
|
|
|
+ REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') AS insureName,
|
|
|
+ b.`deptname` AS deptName,
|
|
|
+ b.`username` AS userName
|
|
|
+ FROM ins_area_company a,ins_orders b WHERE a.`jqpolicyno` IS NOT NULL AND a.`jqpolicyno`!='' AND a.`agreement_id` IS NOT NULL
|
|
|
+ AND a.`orderno`=b.`orderno`
|
|
|
+ UNION ALL
|
|
|
+ /*##商业数据*/
|
|
|
+ SELECT a.`inscompany` AS insCompany,
|
|
|
+ (SELECT agreement_name FROM ptl_agreement t WHERE t.`id`= a.`agreement_id`) AS agreementName,
|
|
|
+ a.`sypolicyno` AS policyNo,
|
|
|
+ getValidDate(a.`orderno`,a.`id`) AS quoteDate,
|
|
|
+ a.`sy_start_date` AS policyStartDate,
|
|
|
+ '商业险' AS riskName,
|
|
|
+ a.`sypremium` AS sumPremium,
|
|
|
+ '' AS taxPremium,
|
|
|
+ '' AS taxLaterPremium,
|
|
|
+ getSyAmount(a.`orderno`) AS insuranceSubAmount,
|
|
|
+ b.`licenseno` AS licenseNo,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.vehicleUse'),'"',''),'3') AS vehicleUse,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.powertype'),'"',''),'2') AS powerType,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.cimodelclass'),'"',''),'4') AS ciModelClass,
|
|
|
+ REPLACE(JSON_EXTRACT(b.carinfo, '$.limitLoad'),'"','') AS limitLoad,
|
|
|
+ REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') AS appliName,
|
|
|
+ REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') AS insureName,
|
|
|
+ b.`deptname` AS deptName,
|
|
|
+ b.`username` AS userName
|
|
|
+ FROM ins_area_company a,ins_orders b WHERE a.`sypolicyno` IS NOT NULL AND a.`syapplyno`!='' AND a.`agreement_id` IS NOT NULL
|
|
|
+ AND a.`orderno`=b.`orderno`
|
|
|
+
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="getPolicyInsuranceReportCount" resultType="Long">
|
|
|
+ select
|
|
|
+ count(1)
|
|
|
+ from (
|
|
|
+ /*交强数据*/
|
|
|
+ SELECT a.`inscompany` AS insCompany,
|
|
|
+ (SELECT agreement_name FROM ptl_agreement t WHERE t.`id`= a.`agreement_id`) AS agreementName,
|
|
|
+ a.`jqpolicyno` AS policyNo,
|
|
|
+ getValidDate(a.`orderno`,a.`id`) AS quoteDate,
|
|
|
+ a.`jq_start_date` AS policyStartDate,
|
|
|
+ '交强险' AS riskName,
|
|
|
+ a.`jqpremium` AS sumPremium,
|
|
|
+ a.`taxamount` AS taxPremium,
|
|
|
+ getCarShipLateFee(a.`id`) AS taxLaterPremium,
|
|
|
+ '交强险 : 200000.00,' AS insuranceSubAmount,
|
|
|
+ b.`licenseno` AS licenseNo,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.vehicleUse'),'"',''),'3') AS vehicleUse,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.powertype'),'"',''),'2') AS powerType,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.cimodelclass'),'"',''),'4') AS ciModelClass,
|
|
|
+ REPLACE(JSON_EXTRACT(b.carinfo, '$.limitLoad'),'"','') AS limitLoad,
|
|
|
+ REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') AS appliName,
|
|
|
+ REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') AS insureName,
|
|
|
+ b.`deptname` AS deptName,
|
|
|
+ b.`username` AS userName
|
|
|
+ FROM ins_area_company a,ins_orders b WHERE a.`jqpolicyno` IS NOT NULL AND a.`jqpolicyno`!='' AND a.`agreement_id` IS NOT NULL
|
|
|
+ AND a.`orderno`=b.`orderno`
|
|
|
+ UNION ALL
|
|
|
+ /*##商业数据*/
|
|
|
+ SELECT a.`inscompany` AS insCompany,
|
|
|
+ (SELECT agreement_name FROM ptl_agreement t WHERE t.`id`= a.`agreement_id`) AS agreementName,
|
|
|
+ a.`sypolicyno` AS policyNo,
|
|
|
+ getValidDate(a.`orderno`,a.`id`) AS quoteDate,
|
|
|
+ a.`sy_start_date` AS policyStartDate,
|
|
|
+ '商业险' AS riskName,
|
|
|
+ a.`sypremium` AS sumPremium,
|
|
|
+ '' AS taxPremium,
|
|
|
+ '' AS taxLaterPremium,
|
|
|
+ getSyAmount(a.`orderno`) AS insuranceSubAmount,
|
|
|
+ b.`licenseno` AS licenseNo,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.vehicleUse'),'"',''),'3') AS vehicleUse,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.powertype'),'"',''),'2') AS powerType,
|
|
|
+ getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.cimodelclass'),'"',''),'4') AS ciModelClass,
|
|
|
+ REPLACE(JSON_EXTRACT(b.carinfo, '$.limitLoad'),'"','') AS limitLoad,
|
|
|
+ REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') AS appliName,
|
|
|
+ REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') AS insureName,
|
|
|
+ b.`deptname` AS deptName,
|
|
|
+ b.`username` AS userName
|
|
|
+ FROM ins_area_company a,ins_orders b WHERE a.`sypolicyno` IS NOT NULL AND a.`syapplyno`!='' AND a.`agreement_id` IS NOT NULL
|
|
|
+ AND a.`orderno`=b.`orderno`
|
|
|
+ ) as s
|
|
|
+ </select>
|
|
|
</mapper>
|