MyBatis动态创建表报错解决
转载
dao
int insert(@Param("tableName")String tableName,@Param("trackpoint")Trackpoint trackpoint);
mapper
<insert id="insert" parameterType="xx.xxx.xx.po.Trackpoint">
insert into ${tableName}
(entityId,dx,dy,dz,ntype,gnssTime,speed,direction,attributes)
values
(#{trackpoint.entityid},
#{trackpoint.dx},
#{trackpoint.dy},
#{trackpoint.dz},
#{trackpoint.ntype},
#{trackpoint.gnsstime},
#{trackpoint.speed},
#{trackpoint.direction},
#{trackpoint.attributes})
</insert>
如果后面是对象,一定要trackpoint.xxx