济菏高速数据中心代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.DcTrafficSectionDataMapper">
<!-- 插入或更新交通路段数据 -->
<insert id="insertOrUpdate" parameterType="com.zc.business.domain.DcTrafficSectionData">
INSERT INTO
dc_traffic_section_data
(
id,
traffic_volume,
large_traffic_volume,
average_speed,
device_id,
statistical_date,
direction,
period_type,
stake_mark,
create_time
)
VALUES
(
#{id},
#{trafficVolume},
#{largeTrafficVolume},
#{averageSpeed},
#{deviceId},
#{statisticalDate},
#{direction},
#{periodType},
#{stakeMark},
NOW())
ON DUPLICATE KEY UPDATE
traffic_volume = VALUES(traffic_volume),
large_traffic_volume = VALUES(large_traffic_volume),
average_speed = VALUES(average_speed),
device_id = VALUES(device_id),
statistical_date = VALUES(statistical_date),
direction = VALUES(direction),
period_type = VALUES(period_type),
stake_mark = VALUES(stake_mark),
update_time = NOW()
</insert>
<select id="getMaxStatisticalDate" resultType="java.util.Date">
SELECT
MAX(statistical_date)
FROM
dc_traffic_section_data
</select>
</mapper>