mybatis裏面參入參數類型錯誤問題

雖然是一個小問題但還是記錄一下,

  <select id="getUserList" parameterType="Map"  resultMap="BaseResultMap" resultType="String">
    select * from userinfo  where 1=1
      <if test="_parameter != null" >
       and  realName = #{_parameter,jdbcType=VARCHAR}
      </if>
    </select>
如果不使用_parameter參數會報錯,原因是傳入參數類型不匹配
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章