创建表
//创建表createTable
void createTable(String table);
<update id="createTable" > CREATE TABLE `${table}` ( id int(11) NOT NULL AUTO_INCREMENT COMMENT '车辆的id', time varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL, gps_wd varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL, gps_jd varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL, bd_wd varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL, bd_jd varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL, type varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'up down', line varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '线路名', PRIMARY KEY (id) ) </update>
插入表
int insertTable(String table,RealTime record);
<insert id="insertTable"> insert into `${table}` (time, gps_wd,gps_jd, bd_wd, bd_jd,type,line) values(#{record.time,jdbcType=VARCHAR}, #{record.gpsWd,jdbcType=VARCHAR}, #{record.gpsJd,jdbcType=VARCHAR}, #{record.bdWd,jdbcType=VARCHAR}, #{record.bdJd,jdbcType=VARCHAR}, #{record.type,jdbcType=VARCHAR}, #{record.line,jdbcType=VARCHAR}) </insert>