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

149 lines
6.7 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">
<resultMap type="com.zc.business.domain.DcTollStationStatisticsDataMap" id="DcTollStationStatisticsDataMap">
<result property="id" column="id"/>
<result property="facilityName" column="facility_name"/>
<result property="tollStationCode" column="toll_station_code"/>
<result property="trafficVolume" column="traffic_volume"/>
<result property="periodType" column="period_type"/>
<result property="accessType" column="access_type"/>
<result property="statisticalDate" column="statistical_date"/>
<result property="stakMark" column="stake_mark"/>
</resultMap>
<!-- 插入或更新交通路段数据 -->
<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>
<select id="TollBoothStatistics" parameterType="string" resultType="com.zc.business.domain.DcTollStationStatisticsDataMap" >
SELECT
IFNULL( fa.facility_name, '') AS facility_name,
IFNULL(fa.stake_mark, '') AS stake_mark,
IFNULL(dt.id,'') AS id,
IFNULL( dt.access_type, '') AS access_type,
IFNULL( dt.period_type, '') AS period_type,
IFNULL( dt.traffic_volume, 0) AS traffic_volume,
IFNULL( dt.toll_station_code, '') AS toll_station_code,
IFNULL( dt.statistical_date, '') AS statistical_date
FROM
dc_facility AS fa
LEFT JOIN
dc_toll_station_statistics_data AS dt
ON
fa.facility_code = dt.toll_station_code
AND DATE(dt.statistical_date) = DATE(#{startDate})
AND dt.period_type = #{periodType}
AND dt.access_type = #{accessType}
WHERE fa.facility_type = 1
</select>
8 months ago
<select id="TollBoothStatisticsList" parameterType="string" resultType="com.zc.business.domain.DcTollStationStatisticsDataMap" >
SELECT
IFNULL( fa.facility_name, '') AS facility_name,
IFNULL(fa.stake_mark, '') AS stake_mark,
IFNULL(dt.id,'') AS id,
IFNULL( dt.access_type, '') AS access_type,
IFNULL( dt.period_type, '') AS period_type,
IFNULL( dt.traffic_volume, 0) AS traffic_volume,
IFNULL( dt.toll_station_code, '') AS toll_station_code,
IFNULL( dt.statistical_date, '') AS statistical_date
FROM
dc_facility AS fa
LEFT JOIN
dc_toll_station_statistics_data AS dt
ON
fa.facility_code = dt.toll_station_code
AND dt.statistical_date = #{startDate}
AND dt.period_type = #{periodType}
AND dt.access_type = #{accessType}
WHERE fa.facility_type = 1
</select>
</mapper>