<if test="example!= null"> <include refid="Example_Where_Clause" /> </if>
原因:執行過程中,顯示在使用example的時候,里面的criteria為null;將上面的XML用下面替換
<if test="_parameter != null" > <include refid="Update_By_Example_Where_Clause" /> </if>
例子:
<select id="selectByExampleLimit" resultMap="BaseResultMap"> select <if test="distinct"> distinct </if> <include refid="Base_Column_List" /> from Test <if test="_parameter != null" > <include refid="Update_By_Example_Where_Clause" /> </if> <if test="orderByClause != null"> order by ${orderByClause} </if> </select>