码迷,mamicode.com
首页 > 其他好文 > 详细

coding++:mybatis 嵌套查询子查询column传多个参数描述

时间:2019-12-02 17:03:46      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:rop   ike   pre   type   java   http   map   hashmap   result   

mybatis 嵌套查询子查询column传多个参数如下:

技术图片 

2、代码示例 备注:注意,相同颜色的单词都是有关联的

<resultMap id="blogResult" type="Blog">

    <association property="author" column="{id=author_id,likename=author_name}" javaType="Author" select="selectAuthor"/>

</resultMap>


<select id="selectBlog" resultMap="blogResult" parameterType="java.lang.String">

    SELECT author_id,author_name FROM BLOG WHERE ID = #{id} 

</select>


<select id="selectAuthor" resultType="Author" parameterType="java.util.HashMap">
SELECT * FROM AUTHOR WHERE 1=1 <if test="id != null and id != ‘‘ "> and ID = #{id} </if> <if test="likename != null and likename != ‘‘ "> and name like CONCAT(‘%‘,#{likename},‘%‘) </if> </select>

 

 

 

coding++:mybatis 嵌套查询子查询column传多个参数描述

标签:rop   ike   pre   type   java   http   map   hashmap   result   

原文地址:https://www.cnblogs.com/codingmode/p/11971359.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!