insert into history (mac, value, time, version) values (#{mac,jdbcType=VARCHAR}, #{value,jdbcType=OTHER}, #{time,jdbcType=TIMESTAMP}, #{version,jdbcType=INTEGER}) insert into history mac, value, time, version, #{mac,jdbcType=VARCHAR}, #{value,jdbcType=OTHER}, #{time,jdbcType=TIMESTAMP}, #{version,jdbcType=INTEGER}, insert into history_special(mac, value, time,version) SELECT * from history WHERE time>=DATE_SUB(#{time}, INTERVAL 1 HOUR) and time#{time} and mac in #{mac}