@TableName:表名注解

@TableId:主鍵注解
@IdType:主鍵注解
@TableFieId:字段注解(非主鍵)
屬性
類型
必須指定
預設值
描述
value
String
否
""
資料庫字段名
el
映射為原生#{...}邏輯,相當于寫在xml
裡的#{...}部分
exist
boolean
true
是否為資料庫表字段
condition
字段 <code>where</code> 實體查詢比較條件,有值設定則按設定的值為準,沒有則為預設全局的 <code>%s=#{%s}</code>
update
字段 <code>update set</code> 部分注入, 例如:update="%s+1":表示更新時會set version=version+1(該屬性優先級高于 <code>el</code> 屬性)
insertStrategy
Enum
N
DEFAULT
舉例:NOT_NULL: <code>insert into table_a(<if test="columnProperty != null">column</if>) values (<if test="columnProperty != null">#{columnProperty}</if>)</code>
updateStrategy
舉例:IGNORED: <code>update table_a set column=#{columnProperty}</code>
whereStrategy
舉例:NOT_EMPTY: <code>where <if test="columnProperty != null and columnProperty!=''">column=#{columnProperty}</if></code>
fill
FieldFill.DEFAULT
字段自動填充政策
select
是否進行 select 查詢
keepGlobalFormat
false
是否保持使用全局的 format 進行處理
jdbcType
JdbcType
JdbcType.UNDEFINED
JDBC類型 (該預設值不代表會按照該值生效)
typeHandler
Class<? extends TypeHandler>
UnknownTypeHandler.class
類型處理器 (該預設值不代表會按照該值生效)
numericScale
指定小數點後保留的位數
@FieIdStrategy:字段注解(非主鍵)
@FieIdFill:字段注解(非主鍵)
@Version:樂觀鎖注解、标記@Version在字段上
@EnumValue:通枚舉類注解(注解在枚舉字段上)
@TableLogic:表字段邏輯處理注解(邏輯删除)
@KeySequence:序列主鍵政策oracle