1. 程式人生 > >Mybatis 引數為String時報錯

Mybatis 引數為String時報錯

這個報錯應該是和原始碼有關係的,先填個坑。

先寫寫解決方法

<select id="findByUuid"  resultMap="TicketResult" parameterType="String">
		select * from t_ticket 
		<where>
			<if test="_parameter!=null">
			 uuid=#{_parameter}
			</if>
		</where>
	</select>

這樣就好了 ,是一個動態SQL

<if test="start!=null and size!=null">
		limit #{start},#{size}
		</if>
之前在其中還加了這一句,但是會報錯,應該是應為start和size引數引起的。