一、报错异常
二、问题分析
- 接口为
- xml文件
原因:device_type被mybatis解析时会被转换成bean字段,通过bean里面的set和get方法来映射数据库,所以需要和bean里面的字段对应。
三、解决方法
- 在接口处加上@Param(“deviceType”)
xxx(@Param("deviceType")Integer deviceType);
- 将接口参数和xml字段改为bean里面对应的字段
xxx(Integer deviceTypeId);
<select id="selectApkList" parameterType="Integer" resultType="com.yj.cloudprint.device.entity.ApkEntity">
select
字段
from
表
<trim prefix="WHERE" prefixOverrides="AND">
<if test="deviceTypeId!=null">
device_type=#{deviceTypeId}
</if>
and status=1
</trim>
</select>