参考来源:   http://www.cnblogs.com/LvLoveYuForever/p/6689577.html

 

 <resultMap  >
    <id column="customer_id" property="customerId" jdbcType="INTEGER" />
    <result column="customer_name" property="customerName" jdbcType="VARCHAR" />
    <result column="customer_card" property="customerCard" jdbcType="VARCHAR" /> 
    	
  	<!-- 关联一对多关系      column="customer_id" 此处customer_id作为参数传给select嵌套查询    -->
  	<collection property="tickets" ofType="com.icss.ys.pojo.Ticket" 
  	select="selectTicket" column="customer_id" ></collection>
  </resultMap>
  
  <select >
    	select *
    	from ticket
    	where customer_id = #{customer_id}
  </select>
  <select  >
    	select *
    	from customer  where customer_name=#{customer_name} 	
  </select>

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
猜你喜欢
  • 2021-04-08
  • 2021-11-20
  • 2021-06-27
  • 2022-12-23
  • 2021-04-01
相关资源
相似解决方案