1.insert标签
2.update标签
3.delete标签
4.select标签
5.sql标签
6.include标签
7.bind标签 参数绑定,比如like查询
8.if标签
9.where标签 where 标记会自动将其后第一个条件的and或者是or给忽略掉
<where>
<if test="id != null ">id=#{id}</if>
<if test="name != null and name.length()>0" >and name=#{name}</if>
<if test="gender != null and gender.length()>0">and gender = #{gender}</if>
</where>
10.foreach标签
11.trim标签
<select id="queryBy" resultType="com.scme.pojo.User" parameterType="com.scme.pojo.User">
select * from user
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="username!=null and password!=null">
and username=#{username} and password=#{password}
</if>
</trim>
<!-- 效果同上
<where>
<if test="username!=null and password!=null">
and username=#{username} and password=#{password}
</if>
</where> -->
</select>
12.choose when otherwise标签
13.set标签