mybatis报错:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflectio

原Dao代码:

 List<SubregionAndMainPlantTypeDto> selectByOrchardBaseInfoId(String orchardBaseInfoId);

原xml代码:

 <select id="selectByOrchardBaseInfoId" resultMap="BaseResultMapDto" parameterType="java.lang.String" >
    select
    s.*,m.*
    from t_subregion s
    Left Join t_zd_mainplanttype m On s.MainPlantTypelId=m.MainPlantTypelId
    where 1=1
    <if test="orchardBaseInfoId != null" >
     and s.OrchardBaseInfoId=#{orchardBaseInfoId,jdbcType=VARCHAR}
    </if>
  </select>

改后的Dao代码:

 List<SubregionAndMainPlantTypeDto> selectByOrchardBaseInfoId(@Param("orchardBaseInfoId")String orchardBaseInfoId);

改后的xml代码:

<select id="selectByOrchardBaseInfoId" resultMap="BaseResultMapDto" >
    select
    s.*,m.*
    from t_subregion s
    Left Join t_zd_mainplanttype m On s.MainPlantTypelId=m.MainPlantTypelId
    where 1=1
    <if test="orchardBaseInfoId != null" >
     and s.OrchardBaseInfoId=#{orchardBaseInfoId}
    </if>
  </select>

猜你喜欢

转载自blog.csdn.net/microopithecus/article/details/84071314
今日推荐