济菏高速数据中心代码
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.

95 lines
3.9 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.DcTollStationStatisticsDataMapper">
<!-- 插入或更新交通路段数据 -->
<insert id="insertOrUpdate" parameterType="com.zc.business.domain.DcTollStationStatisticsData">
INSERT INTO
dc_toll_station_statistics_data
(
id,
toll_station_code,
statistical_date,
traffic_volume,
period_type,
access_type,
create_time,
type1_passenger_flow,
type2_passenger_flow,
type3_passenger_flow,
type4_passenger_flow,
type1_truck_flow,
type2_truck_flow,
type3_truck_flow,
type4_truck_flow,
type5_truck_flow,
type6_truck_flow,
type1_special_vehicle_flow,
type2_special_vehicle_flow,
type3_special_vehicle_flow,
type4_special_vehicle_flow,
type5_special_vehicle_flow,
type6_special_vehicle_flow
)
VALUES
(
#{id},
#{tollStationCode},
#{statisticalDate},
#{trafficVolume},
#{periodType},
#{accessType},
NOW(),
#{type1PassengerFlow},
#{type2PassengerFlow},
#{type3PassengerFlow},
#{type4PassengerFlow},
#{type1TruckFlow},
#{type2TruckFlow},
#{type3TruckFlow},
#{type4TruckFlow},
#{type5TruckFlow},
#{type6TruckFlow},
#{type1SpecialVehicleFlow},
#{type2SpecialVehicleFlow},
#{type3SpecialVehicleFlow},
#{type4SpecialVehicleFlow},
#{type5SpecialVehicleFlow},
#{type6SpecialVehicleFlow}
)
ON DUPLICATE KEY UPDATE
toll_station_code = VALUES(toll_station_code),
statistical_date = VALUES(statistical_date),
traffic_volume = VALUES(traffic_volume),
period_type = VALUES(period_type),
access_type = VALUES(access_type),
update_time = NOW(),
type1_passenger_flow = VALUES(type1_passenger_flow),
type2_passenger_flow = VALUES(type2_passenger_flow),
type3_passenger_flow = VALUES(type3_passenger_flow),
type4_passenger_flow = VALUES(type4_passenger_flow),
type1_truck_flow = VALUES(type1_truck_flow),
type2_truck_flow = VALUES(type2_truck_flow),
type3_truck_flow = VALUES(type3_truck_flow),
type4_truck_flow = VALUES(type4_truck_flow),
type5_truck_flow = VALUES(type5_truck_flow),
type6_truck_flow = VALUES(type6_truck_flow),
type1_special_vehicle_flow = VALUES(type1_special_vehicle_flow),
type2_special_vehicle_flow = VALUES(type2_special_vehicle_flow),
type3_special_vehicle_flow = VALUES(type3_special_vehicle_flow),
type4_special_vehicle_flow = VALUES(type4_special_vehicle_flow),
type5_special_vehicle_flow = VALUES(type5_special_vehicle_flow),
type6_special_vehicle_flow = VALUES(type6_special_vehicle_flow)
</insert>
<select id="getMaxStatisticalDate" resultType="java.util.Date">
SELECT
MAX(statistical_date)
FROM
dc_toll_station_statistics_data
</select>
</mapper>