Mybatis常用标签

定义sql语句:insert、delete、update、select

例子:

<select id="userList" parameterType="user" resultType="User">
  select * from user where name =#{name}
</select>

配置java对象属性与查询结果集中列名的对应关系:resultMap

例子:

<resultMap id="getStudentRM" type="EStudnet">
<id property="id" column="ID"/>
<result property="studentName" column="Name"/>
<result property="studentAge" column="Age"/>
</resultMap>

动态sql拼接:foreach、if、choose

格式化输出:where、set、trim

配置关联关系:collection、association

定义常量:sql

 

posted @ 2019-03-27 23:36  轻寒  阅读(267)  评论(0编辑  收藏  举报