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 ){

  ...

}

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM