mybaits错误解决:There is no getter for property named 'id' in class 'java.lang.String

在使用mybaitis传参数的时候,如果仅传入一个类型为String的参数,那么在 xml文件中应该使用_parameter来代替参数名。

<select id="getBookingCount" resultType="int" parameterType="string">

select count(*) from TB_EMPC_BOOKING_ORDER T

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

and t.appointmenttime = #{state}

</select>

<select id="getBookingCount" resultType="int" parameterType="string">

select count(*) from TB_EMPC_BOOKING_ORDER T

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

and t.appointmenttime = #{_parameter}

</select>

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

  ...

}

  

猜你喜欢

转载自www.cnblogs.com/iapetosee/p/10970844.html