mybatis 常用写法

1.mybatis mapper 中调用方法:
method
public void save(@Param("myParam") name )
xml
${myParam.method()}

2.调用公共sql
<sql id = "sqlid">
insert into ${table_name} (field1,field2...) values(value1,value2)
</sql>

引用部分
<select id = ....>
<include refid="sqlid">
<property name="commit_table_name" value="code_commit">
</include>
</select>

推荐阅读更多精彩内容