<resultMap id="BaseResultMap" type="com.sgai.cps.om.entity.OmSaleOrder" >
<!-- SEQUENCE -->
<id column="SID" property="sid" jdbcType="DECIMAL" />
<!-- 意向订单号 -->
<result column="INTENT_ORDER_NO" property="intentOrderNo" jdbcType="VARCHAR" />
<!-- 合同号 -->
<result column="ORDER_NO" property="orderNo" jdbcType="VARCHAR" />
<!-- 合同类型 -->
<result column="ORDER_TYPE" property="orderType" jdbcType="VARCHAR" />
<!-- 其他字段略 -->
<collection property="omSaleOrderItems" ofType="java.util.List" select="findDetails" column="ORDER_NO">
</collection>
</resultMap>
<select id="find" resultMap="BaseResultMap" parameterType="java.util.Map">
select
COSO.*
from CPS_OM_SALE_ORDER COSO where 1=1
</select>
<select id="findDetails" resultMap="BaseResultMap" parameterType="java.util.Map">
select * from CPS_OM_SALE_ORDER_ITEMS WHERE SALE_ORDER_NO = #{orderNo,jdbcType=VARCHAR}
</select>
collection表签: findDetails为子查询 ORDER_NO为管联字段
</mapper>