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

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

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

<resultMap >

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

</resultMap>


<select >

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

</select>


<select >
  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>

 

 

 

相关文章:

  • 2022-03-04
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
猜你喜欢
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2021-07-09
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案