coding++:mybatis 嵌套查询子查询column传多个参数描述
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> 相关推荐
wwwdownmacom 2020-09-14
一一空 2020-06-25
zhendeshifeng 2020-05-25
RuoShangM 2020-05-17
liangzuojiayi 2020-05-07
DCXabc 2020-05-05
横云断岭 2020-04-17
wangqing 2020-04-07
Lomoyou 2020-02-17
绝望的乐园 2020-02-15
ChainDestiny 2020-02-02
codeAB 2019-12-31
idning 2019-12-30
JingLisen 2019-12-30
xiangnan0 2019-12-23
yongzhang 2019-12-19