| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ydtech.modules.scheme.dao.PtlSchemeMapper">
- <resultMap id="SchemeResultVoMap" type="com.ydtech.modules.scheme.entity.vo.SchemeResultVo">
- <id property="id" column="id" />
- <result property="companyId" column="company_id" />
- <result property="productId" column="product_id" />
- <result property="productName" column="product_name" />
- <result property="schemeName" column="scheme_name" />
- <result property="description" column="description" />
- <result property="kinds" column="kinds" typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
- <collection property="drivingIntentions" ofType="com.ydtech.modules.scheme.entity.po.PtlSchemeInsuranceDrivingIntention">
- <id property="id" column="id" />
- <result property="schemeId" column="scheme_id" />
- <result property="seatNum" column="seat_num" />
- <result property="drivingIntentionId" column="driving_intention_id" />
- <collection property="drivingIntentionInsurance" ofType="com.ydtech.modules.order.entity.InsDrivingIntentionInsurance">
- <id property="id" column="id" />
- <result property="apiType" column="api_type" />
- <result property="companyId" column="company_id" />
- <result property="projectName" column="project_name" />
- <result property="projectCode" column="project_code" />
- <result property="riskCode" column="risk_code" />
- <result property="sumAmount" column="sum_amount" />
- <result property="sumPremium" column="sum_premium" />
- <collection property="insDrivingIntentionInsuranceSon" ofType="com.ydtech.modules.order.entity.InsDrivingIntentionInsuranceSon">
- <result property="drivingCodeId" column="driving_code_id"/>
- <result property="amount" column="amount" />
- <result property="code" column="code" />
- <result property="name" column="name" />
- <result property="premium" column="premium" />
- </collection>
- </collection>
- </collection>
- </resultMap>
- <select id="getAllCompany" resultType="com.ydtech.modules.esm.model.EsmInsCompany">
- SELECT
- eic.*
- FROM
- esm_ins_company eic,
- ptl_agreement pa
- WHERE
- eic.id = pa.insurance_company_id
- and
- pa.is_external = 0
- <if test="schemeQueryVo.companyName != null and schemeQueryVo.companyName != ''">
- and
- eic.name like concat('%',#{schemeQueryVo.companyName},'%')
- </if>
- GROUP BY
- eic.id
- </select>
- <select id="getSchemeList" resultType="com.ydtech.modules.scheme.entity.po.PtlScheme">
- SELECT
- ps.company_id,
- ps.product_id,
- ps.product_name
- FROM
- ptl_scheme ps
- WHERE
- 1=1
- and
- ps.company_id = #{schemeQueryVo.companyId}
- and
- ps.energy_type = #{schemeQueryVo.energyType}
- and
- ps.vehicle_type = #{schemeQueryVo.vehicleType}
- <if test="schemeQueryVo.carnature != null and schemeQueryVo.carnature != ''">
- and
- ps.carnature = #{schemeQueryVo.carnature}
- </if>
- GROUP BY
- ps.product_id,
- ps.product_name
- </select>
- <select id="getSchemeResultList" resultMap="SchemeResultVoMap">
- SELECT
- *
- FROM
- ptl_scheme ps
- LEFT JOIN
- ptl_scheme_insurance psi ON psi.scheme_id = ps.id
- LEFT JOIN
- ptl_scheme_insurance_driving_intention psidi ON psidi.scheme_id = ps.id
- LEFT JOIN
- ins_driving_intention_insurance idii ON psidi.driving_intention_id = idii.id
- LEFT JOIN
- ins_driving_intention_insurance_son idiis ON idii.project_code = idiis.driving_code_id
- WHERE
- ps.company_id = #{companyId}
- AND
- ps.product_id = #{productId}
- AND
- ps.energy_type = #{energyType}
- AND
- ps.vehicle_type = #{vehicleType}
- <if test="carnature != null and carnature != ''">
- AND
- ps.carnature = #{carnature}
- </if>
- </select>
- <select id="getSchemeRules" resultType="com.ydtech.modules.scheme.entity.po.PtlSchemeRules">
- SELECT
- ps.*
- FROM
- ptl_scheme_rules ps
- WHERE
- ps.company_id in
- <foreach item="item" collection="companyIds" open="(" separator="," close=")">
- #{item}
- </foreach>
- AND ps.product_id = #{productId}
- AND ps.energy_type = #{energyType}
- AND ps.vehicle_type = #{vehicleType}
- </select>
- <select id="allCompanyList" resultType="com.ydtech.modules.esm.model.EsmInsCompany">
- SELECT
- eic.*
- FROM
- esm_ins_company eic
- WHERE
- id IN (
- SELECT
- eic.id
- FROM
- ins_area_company iac
- LEFT JOIN esm_ins_company eic ON iac.company_id = eic.id
- WHERE
- iac.orderstatus = 3
- GROUP BY
- eic.id
- )
- </select>
- </mapper>
|