首頁>技術>

錯誤資訊:

nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'type' in 'class java.lang.String'
<select id="gets" resultType="com.pojo.Dw" >    SELECT *    FROM dw_dw    WHERE 1 = 1    <if test="dwtype != null and dwtype != ''">        AND dwtype=#{dwtype,jdbcType=VARCHAR}    </if></select>
解決辦法

在方法引數前加上註解 @Param("")

public interface DwMapper{        Dw get(String dwtype,String id);				//List<Dw> gets(String dwtype);        List<Dw> gets(@Param("dwtype")String dwtype);  //方法引數前加上註解 @Param("dwtype")  //成功}

mybatis3.5.1

springboot2.4

5
最新評論
  • BSA-TRITC(10mg/ml) TRITC-BSA 牛血清白蛋白改性標記羅丹明
  • JavaScript高山流水圖表元件—HighCharts