InsBusinessInsuranceMapper.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ydtech.modules.order.dao.InsBusinessInsuranceMapper">
  6. <resultMap id="BaseResultMap" type="com.ydtech.modules.order.entity.InsBusinessInsurance">
  7. <id property="id" column="id" jdbcType="VARCHAR"/>
  8. <result property="kindName" column="kind_name" jdbcType="VARCHAR"/>
  9. <result property="kindCode" column="kind_code" jdbcType="VARCHAR"/>
  10. <result property="max" column="max" jdbcType="VARCHAR"/>
  11. <result property="grouping" column="grouping" jdbcType="VARCHAR"/>
  12. <collection property="amtList" ofType="com.ydtech.modules.order.entity.InsBusinessInsuranceOption">
  13. <id property="optionId" column="option_id" jdbcType="VARCHAR"/>
  14. <result property="label" column="label" jdbcType="VARCHAR"/>
  15. <result property="value" column="value" jdbcType="VARCHAR"/>
  16. </collection>
  17. </resultMap>
  18. <select id="getBusinessInsurance" resultMap="BaseResultMap">
  19. SELECT
  20. ibi.id,
  21. ibi.kind_name,
  22. ibi.kind_code,
  23. ibi.grouping,
  24. ibio.id as option_id,
  25. ibio.label,
  26. ibio.value
  27. FROM
  28. ins_business_insurance ibi
  29. LEFT JOIN
  30. ins_business_insurance_option ibio ON ibi.id = ibio.business_id
  31. order by id,sort
  32. </select>
  33. </mapper>