jinpengyong
2020-07-17 c56bd485c56d94d731fa525143057a06a735386f
src/main/resources/mapper/HistoryMapper.xml
@@ -170,10 +170,17 @@
    <insert id="insertHistorySpecialTable">
        insert into
        history_special(mac, value, time,version)
        SELECT * from history WHERE time = #{time} and mac in
        SELECT * from history WHERE time>=DATE_SUB(#{time}, INTERVAL 1 HOUR) and time<![CDATA[<]]>#{time} and mac in
        <foreach collection="macList" index="index" item="mac" open="(" separator="," close=")">
            #{mac}
        </foreach>
    </insert>
    <delete id="deleteHistoryData" parameterType="java.lang.String">
        delete from history where  time &lt; #{oldTime};
    </delete>
    <update id="deletePartition">
        ALTER table history drop PARTITION ${p};
    </update>
</mapper>