公司做彩票网站违法吗官网排名优化
mybatis
There is no getter for property named 'car_port_ids' in 'class java.lang.String
出现这种错误我这边是mapper.xml子查询字段不对导致的
我把查询结果的列的字段放进去结果不识别car_port_ids
可能我这种字段本身就有问题
技术博客 http://idea.coderyj.com/
1.解决
<resultMap id="BaseResultMap" type="com.cspid.entity.SysDevice"><id column="id" jdbcType="VARCHAR" property="id"/><result column="line_id" jdbcType="VARCHAR" property="lineId"/><result column="car_port_ids" jdbcType="VARCHAR" property="carPortIds"/><result column="power_state" jdbcType="VARCHAR" property="powerState"/><result column="charge_model_id" jdbcType="VARCHAR" property="chargeModelId"/><result column="park_name" jdbcType="VARCHAR" property="parkName"/><collection property="carportList" select="selectCarportList"column="{carPortIds=car_port_ids}" ofType="com.cspid.entity.SysCarport" javaType="arraylist"></collection>
如果不以别名的方式传递 直接报错
{carPortIds=car_port_ids}
2.子查询 carPortIds
不能是car_port_ids
这样直接报错了
<select id="selectCarportList" resultMap="BaseResultMapCarport">select cp.* from sys_carport cp<where><if test="1">and cp.id in<foreach item="ed" index="index" collection="carPortIds.split(',')" open="(" separator="," close=")">'${ed}'</foreach></if></where></select>