首页 » 网站推广 » php嵌套查询效力技巧_多次查询办法也叫嵌套查询四川优就业

php嵌套查询效力技巧_多次查询办法也叫嵌套查询四川优就业

访客 2024-12-17 0

扫一扫用手机浏览

文章目录 [+]

四川IT培训优就业

四川IT培训优就业的老师为您讲解:

php嵌套查询效力技巧_多次查询办法也叫嵌套查询四川优就业

Mapper配置:

php嵌套查询效力技巧_多次查询办法也叫嵌套查询四川优就业
(图片来自网络侵删)

<select id=\"大众queryClasses\"大众 resultMap=\"大众ClassesResultMap\公众>

select from class

</select>

<select id=\公众queryStudent\公众 parameterType=\公众int\"大众 resultMap=\公众StudentResultMap\"大众>

select from student where s_id=#{id}

</select>

四川优就业

<!-- 映射实体类属性名与表字段名 -->

<resultMap type=\公众Classes\"大众 id=\公众ClassesResultMap\"大众>

<id property=\"大众id\"大众 column=\公众c_id\公众/>

<result property=\公众name\"大众 column=\公众c_name\公众/>

<collection property=\"大众students\"大众 column=\公众c_id\公众 select=\公众queryStudent\公众>

<id property=\公众id\"大众 column=\"大众s_id\"大众/>

<result property=\"大众name\公众 column=\"大众s_name\公众/>

</collection>

</resultMap>

<resultMap type=\公众Student\公众 id=\公众StudentResultMap\公众>

<id property=\"大众id\公众 column=\公众s_id\公众/>

<result property=\"大众name\"大众 column=\"大众s_name\"大众/>

</resultMap>

这种也是发多次查询,个中column=\"大众c_id\公众是传给子查询的参数。

来四川中公优就业,给您一个成为精良的JAVA开拓工程师、UI设计师、互联网营销师、web前端开拓工程师、PHP开拓工程师或者软件测试工程师的机会!

四川地区最新开课:1月24日,营销建站+SEO(成都) (详情请咨询\/信:aisinila1备注中公)

文/四川优就业小UU

标签:

相关文章