mybatis collection一对多 ofType

话不多所: 多对一类似 见 链接

一对多子查询
mybatis collection一对多 ofType
mybaits 中的参数传递 :

  1. property:指定关联属性,即Country类中的集合属性
  2. ofType:集合属性的泛型类型 可为基本类型
  3. column 传入参数 column=“cid” 可传多个 column="{cid,mname}" 传入的字段为resultMap type类型 即 cid ,cname 不可用mapper层接口参数传入 如果想用mapper的参数 只能用第二种方法。如代码(自家公司代码):

mybatis collection一对多 ofType
ofType 为基本类型写法有所不同:
mybatis collection一对多 ofType
ofType :为实体类 上图格式

暂时写到这吧!啊哈哈哈