MyBatis要求如果参数为String的话,不管接口方法的形参是什么,在Mapper.xml中引用时需要改变为_parameter才能识别 :

<select id="selectByIp" parameterType="string" resultType="voteIP">
  select *
  form vote
  <where>
    <if test ="_parameter!= null">
      ip=#{_parameter}
    </if>
  </where>
</select>

相关文章:

  • 2021-12-03
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-08-25
猜你喜欢
  • 2021-07-24
  • 2022-12-23
  • 2021-05-31
  • 2021-05-17
  • 2021-12-25
  • 2021-11-30
相关资源
相似解决方案