1、定義sql語句
- 增:<insert>
- 刪:<delete>
- 改:<update>
- 查:<select>
其中select最複雜。共有id、parameterType屬性,此外select還有resultType、ResultMap
2、sql標籤
- 定義通用的sql語句,以便sql引入:<sql>
- 引入<sql>:<include>
3、resultMap中的標籤
- 實現列與實體屬性的映射:<resultMap>
- 多對多:<collection>
- 一對一:<association>
4、動態sql標籤
- 單條件:<if>
- 多條件:<choose>
- <when>
- <otherwise>
- 用來處理sql連接:<trim>
- 處理where條件:<where>
- 更新語句:<set>
- 循環語句,在in裏面使用:<foreach>
- 定義上下文變量:<bind>