Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 713 Bytes

jdbc.md

File metadata and controls

22 lines (17 loc) · 713 Bytes

github地址 gitee地址

spring data jdbc 扩展 mybatis 动态sql能力

What Is This?

  • 使用jdbcTemplate,相当于直接调用jdbc。不提供缓存、延迟加载等JPA或mybatis的许多特性。一个简单、有限、固执己见的ORM

  • 使用mybatis动态sql能力,可以应对复杂sql

  • SQL 写在 Markdown 里

-- findUserByIds
SELECT  [@id column] FROM user_base 
<where> 
[@@and id in #{idList:in} and user_name like #{userName:like}]
[@and user_name like userName%]
[@and id in idList]
<if test="null!=createTime">  and create_time < #{createTime}  </if>
</where>