1.当入参为 string类型时 (包括java.lang.String.) 

我们使用#{xxx}引入参数.会抛异常There is no getter for property named 'XXX' in 'class java.lang.String'

<select >

select count(*) from TB_EMPC_BOOKING_ORDER T

where (t.state = '1' or t.state = '2')

and t.appointmenttime = #{state}

</select>

2.解决方法一:把#{xxx}修改为 #{_parameter} 即可

<select >

select count(*) from TB_EMPC_BOOKING_ORDER T

where (t.state = '1' or t.state = '2')

and t.appointmenttime = #{_parameter}

</select>

3.解决方法二:可以在方法中提前定义:

public int  methodName(@Param(value="state") String state ){

  ...

}

相关文章:

  • 2021-08-15
  • 2022-12-23
  • 2021-04-17
  • 2022-12-23
  • 2021-10-10
  • 2021-11-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
相关资源
相似解决方案