|
|
|
<?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.DcTrafficSurveyDataMapper">
|
|
|
|
|
|
|
|
<resultMap type="DcTrafficSurveyData" id="DcTrafficSurveyDataResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="iotDeviceId" column="iot_device_id" />
|
|
|
|
<result property="stakeMark" column="stake_mark" />
|
|
|
|
<result property="direction" column="direction" />
|
|
|
|
<result property="timestamp" column="timestamp" />
|
|
|
|
<result property="trafficVolume" column="traffic_volume" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectDcTrafficSurveyDataVo">
|
|
|
|
select id, iot_device_id, stake_mark, direction, timestamp, traffic_volume from dc_traffic_survey_data
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectDcTrafficSurveyDataList" parameterType="DcTrafficSurveyData" resultMap="DcTrafficSurveyDataResult">
|
|
|
|
<include refid="selectDcTrafficSurveyDataVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="iotDeviceId != null and iotDeviceId != ''"> and iot_device_id = #{iotDeviceId}</if>
|
|
|
|
<if test="stakeMark != null and stakeMark != ''"> and stake_mark = #{stakeMark}</if>
|
|
|
|
<if test="direction != null and direction != ''"> and direction = #{direction}</if>
|
|
|
|
<if test="trafficVolume != null "> and traffic_volume = #{trafficVolume}</if>
|
|
|
|
<if test="type != null and type == 'year'.toString">
|
|
|
|
and DATE_FORMAT(timestamp,'%Y') = DATE_FORMAT(#{thisTime},'%Y')
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == 'month'.toString">
|
|
|
|
and DATE_FORMAT(timestamp,'%Y-%m') = DATE_FORMAT(#{thisTime},'%Y-%m')
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == 'year'.toString">
|
|
|
|
and DATE_FORMAT(timestamp,'%Y-%m-%d') = DATE_FORMAT(#{thisTime},'%Y-%m-%d')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectDcTrafficSurveyDataById" parameterType="Long" resultMap="DcTrafficSurveyDataResult">
|
|
|
|
<include refid="selectDcTrafficSurveyDataVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
<select id="selectDeviceList" resultType="com.zc.business.domain.DcDevice">
|
|
|
|
SELECT * FROM `dc_device` where device_type = '11' and iot_device_id is not null
|
|
|
|
</select>
|
|
|
|
<select id="selectDay" resultType="com.zc.business.domain.DcTrafficSurveyData">
|
|
|
|
SELECT iot_device_id,stake_mark,direction,HOUR(`timestamp`) times,SUM(traffic_volume) trafficVolume,
|
|
|
|
SUM(traffic_number_of_in_and_small) + SUM(bus_traffic_volume) bus,
|
|
|
|
SUM(traffic_volume_of_small_trucks) + SUM(medium_truck_traffic_volume)
|
|
|
|
+ SUM(large_truck_traffic_volume) + SUM(extra_large_trucks_traffic_volume) goodsCar
|
|
|
|
FROM `dc_traffic_survey_data`
|
|
|
|
where DATE_FORMAT(`timestamp`,'%Y-%m-%d') = DATE_FORMAT(#{timestamp},'%Y-%m-%d')
|
|
|
|
GROUP BY iot_device_id,direction,times
|
|
|
|
</select>
|
|
|
|
<select id="selectMonth" resultType="com.zc.business.domain.DcTrafficSurveyData">
|
|
|
|
SELECT iot_device_id,stake_mark,direction,DAY(`timestamp`) times,SUM(traffic_volume) trafficVolume,
|
|
|
|
SUM(traffic_number_of_in_and_small) + SUM(bus_traffic_volume) bus,
|
|
|
|
SUM(traffic_volume_of_small_trucks) + SUM(medium_truck_traffic_volume)
|
|
|
|
+ SUM(large_truck_traffic_volume) + SUM(extra_large_trucks_traffic_volume) goodsCar
|
|
|
|
FROM `dc_traffic_survey_data`
|
|
|
|
where DATE_FORMAT(`timestamp`,'%Y-%m') = DATE_FORMAT(#{timestamp},'%Y-%m')
|
|
|
|
GROUP BY iot_device_id,direction,times
|
|
|
|
</select>
|
|
|
|
<select id="selectYear" resultType="com.zc.business.domain.DcTrafficSurveyData">
|
|
|
|
SELECT iot_device_id,stake_mark,direction,MONTH(`timestamp`) times,SUM(traffic_volume) trafficVolume,
|
|
|
|
SUM(traffic_number_of_in_and_small) + SUM(bus_traffic_volume) bus,
|
|
|
|
SUM(traffic_volume_of_small_trucks) + SUM(medium_truck_traffic_volume)
|
|
|
|
+ SUM(large_truck_traffic_volume) + SUM(extra_large_trucks_traffic_volume) goodsCar
|
|
|
|
FROM `dc_traffic_survey_data`
|
|
|
|
where DATE_FORMAT(`timestamp`,'%Y') = DATE_FORMAT(#{timestamp},'%Y')
|
|
|
|
GROUP BY iot_device_id,direction,times
|
|
|
|
</select>
|
|
|
|
<select id="selectRange" resultType="com.zc.business.domain.DcTrafficSurveyData">
|
|
|
|
SELECT iot_device_id,stake_mark,direction,DATE_FORMAT(`timestamp`, '%m-%d') times,
|
|
|
|
SUM(traffic_volume) trafficVolume,
|
|
|
|
SUM(traffic_number_of_in_and_small) + SUM(bus_traffic_volume) bus,
|
|
|
|
SUM(traffic_volume_of_small_trucks) + SUM(medium_truck_traffic_volume)
|
|
|
|
+ SUM(large_truck_traffic_volume) + SUM(extra_large_trucks_traffic_volume) goodsCar
|
|
|
|
FROM `dc_traffic_survey_data`
|
|
|
|
where DATE_FORMAT(`timestamp`,'%Y-%m-%d') >= DATE_FORMAT(#{timestamp},'%Y-%m-%d')
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y-%m-%d') <= DATE_FORMAT(#{endTime},'%Y-%m-%d')
|
|
|
|
GROUP BY iot_device_id,direction,times
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectTrafficVolume" resultType="com.zc.business.domain.DcTrafficVolumeData">
|
|
|
|
select
|
|
|
|
<choose>
|
|
|
|
<when test="type != null and type == '1'.toString">
|
|
|
|
date_format(`timestamp`, '%Y-%m-%d %H')
|
|
|
|
</when>
|
|
|
|
<when test="type != null and type == '2'.toString">
|
|
|
|
date_format(`timestamp`, '%Y-%m-%d')
|
|
|
|
</when>
|
|
|
|
<when test="type != null and type == '3'.toString">
|
|
|
|
date_format(`timestamp`, '%Y-%m')
|
|
|
|
</when>
|
|
|
|
<when test="type != null and type == '4'.toString">
|
|
|
|
date_format(`timestamp`, '%Y-%m-%d')
|
|
|
|
</when>
|
|
|
|
</choose> time,direction,
|
|
|
|
sum(traffic_volume) trafficVolume ,
|
|
|
|
sum(traffic_number_of_in_and_small) trafficNumberOfInAndSmall,
|
|
|
|
sum(bus_traffic_volume) busTrafficVolume,
|
|
|
|
sum(traffic_volume_of_small_trucks) trafficVolumeOfSmallTrucks,
|
|
|
|
sum(medium_truck_traffic_volume) mediumTruckTrafficVolume,
|
|
|
|
sum(large_truck_traffic_volume) largeTruckTrafficVolume,
|
|
|
|
sum(extra_large_trucks_traffic_volume) extraLargeTrucksTrafficVolume,
|
|
|
|
sum(container_truck_traffic_volume) containerTruckTrafficVolume,
|
|
|
|
sum(motorcycle_traffic_volume) motorcycleTrafficVolume,
|
|
|
|
sum(tractor_traffic_volume) tractorTrafficVolume
|
|
|
|
FROM `dc_traffic_survey_data`
|
|
|
|
<where>
|
|
|
|
<if test="iotDeviceId != null and iotDeviceId != ''">
|
|
|
|
and iot_device_id = #{iotDeviceId}
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == '1'.toString">
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y-%m-%d') = DATE_FORMAT(#{date},'%Y-%m-%d')
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == '2'.toString">
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y-%m') = DATE_FORMAT(#{date},'%Y-%m')
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == '3'.toString">
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y') = DATE_FORMAT(#{date},'%Y')
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == '4'.toString">
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y-%m-%d') >= DATE_FORMAT(#{startTime},'%Y-%m-%d')
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y-%m-%d') <= DATE_FORMAT(#{endTime},'%Y-%m-%d')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
GROUP BY time
|
|
|
|
<if test="direction != null and direction == '1'.toString">,direction</if>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectSpeed" resultType="com.zc.business.domain.DcTrafficSpeedData">
|
|
|
|
select *,
|
|
|
|
ROUND(
|
|
|
|
(
|
|
|
|
t1.inAndSmallAverageVehicleSpeed +
|
|
|
|
t1.averageSpeedOfBus +
|
|
|
|
t1.smallTrucksAverageVehicleSpeed +
|
|
|
|
t1.averageSpeedOfMediumSizeTrucks +
|
|
|
|
t1.averageSpeedOfLargeTrucks +
|
|
|
|
t1.averageSpeedOfExtraLargeTrucks +
|
|
|
|
t1.averageSpeedOfContainerTruck +
|
|
|
|
t1.averageSpeedOfMotorcycle +
|
|
|
|
t1.averageSpeedOfTractor
|
|
|
|
) /
|
|
|
|
NULLIF(
|
|
|
|
CASE WHEN t1.inAndSmallAverageVehicleSpeed = 0 THEN 0 ELSE 1 END +
|
|
|
|
CASE WHEN t1.averageSpeedOfBus = 0 THEN 0 ELSE 1 END +
|
|
|
|
CASE WHEN t1.smallTrucksAverageVehicleSpeed = 0 THEN 0 ELSE 1 END +
|
|
|
|
CASE WHEN t1.averageSpeedOfMediumSizeTrucks = 0 THEN 0 ELSE 1 END +
|
|
|
|
CASE WHEN t1.averageSpeedOfLargeTrucks = 0 THEN 0 ELSE 1 END +
|
|
|
|
CASE WHEN t1.averageSpeedOfExtraLargeTrucks = 0 THEN 0 ELSE 1 END +
|
|
|
|
CASE WHEN t1.averageSpeedOfContainerTruck = 0 THEN 0 ELSE 1 END +
|
|
|
|
CASE WHEN t1.averageSpeedOfMotorcycle = 0 THEN 0 ELSE 1 END +
|
|
|
|
CASE WHEN t1.averageSpeedOfTractor = 0 THEN 0 ELSE 1 END,
|
|
|
|
0
|
|
|
|
)
|
|
|
|
,0) AS avgSpeed
|
|
|
|
from
|
|
|
|
(select direction,
|
|
|
|
<choose>
|
|
|
|
<when test="type != null and type == '1'.toString">
|
|
|
|
date_format(`timestamp`, '%Y-%m-%d %H')
|
|
|
|
</when>
|
|
|
|
<when test="type != null and type == '2'.toString">
|
|
|
|
date_format(`timestamp`, '%Y-%m-%d')
|
|
|
|
</when>
|
|
|
|
<when test="type != null and type == '3'.toString">
|
|
|
|
date_format(`timestamp`, '%Y-%m')
|
|
|
|
</when>
|
|
|
|
<when test="type != null and type == '4'.toString">
|
|
|
|
date_format(`timestamp`, '%Y-%m-%d')
|
|
|
|
</when>
|
|
|
|
</choose> time,
|
|
|
|
ROUND(IFNULL(AVG(NULLIF(in_and_small_average_vehicle_speed, 0)),0), 0) AS inAndSmallAverageVehicleSpeed,
|
|
|
|
ROUND(IFNULL(AVG(NULLIF(average_speed_of_bus, 0)),0), 0) AS averageSpeedOfBus,
|
|
|
|
ROUND(IFNULL(AVG(NULLIF(small_trucks_average_vehicle_speed, 0)),0), 0) AS smallTrucksAverageVehicleSpeed,
|
|
|
|
ROUND(IFNULL(AVG(NULLIF(average_speed_of_medium_size_trucks, 0)),0), 0) AS averageSpeedOfMediumSizeTrucks,
|
|
|
|
ROUND(IFNULL(AVG(NULLIF(average_speed_of_large_trucks, 0)),0), 0) AS averageSpeedOfLargeTrucks,
|
|
|
|
ROUND(IFNULL(AVG(NULLIF(average_speed_of_extra_large_trucks, 0)),0), 0) AS averageSpeedOfExtraLargeTrucks,
|
|
|
|
ROUND(IFNULL(AVG(NULLIF(average_speed_of_container_truck, 0)),0), 0) AS averageSpeedOfContainerTruck,
|
|
|
|
ROUND(IFNULL(AVG(NULLIF(average_speed_of_motorcycle, 0)),0), 0) AS averageSpeedOfMotorcycle,
|
|
|
|
ROUND(IFNULL(AVG(NULLIF(average_speed_of_tractor, 0)),0), 0) AS averageSpeedOfTractor
|
|
|
|
FROM `dc_traffic_survey_data`
|
|
|
|
<where>
|
|
|
|
<if test="iotDeviceId != null and iotDeviceId != ''">
|
|
|
|
and iot_device_id = #{iotDeviceId}
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == '1'.toString">
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y-%m-%d') = DATE_FORMAT(#{date},'%Y-%m-%d')
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == '2'.toString">
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y-%m') = DATE_FORMAT(#{date},'%Y-%m')
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == '3'.toString">
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y') = DATE_FORMAT(#{date},'%Y')
|
|
|
|
</if>
|
|
|
|
<if test="type != null and type == '4'.toString">
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y-%m-%d') >= DATE_FORMAT(#{startTime},'%Y-%m-%d')
|
|
|
|
and DATE_FORMAT(`timestamp`,'%Y-%m-%d') <= DATE_FORMAT(#{endTime},'%Y-%m-%d') </if>
|
|
|
|
</where>
|
|
|
|
GROUP BY time
|
|
|
|
<if test="direction != null and direction == '1'.toString">,direction</if>
|
|
|
|
) t1
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertDcTrafficSurveyData" parameterType="DcTrafficSurveyData" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into dc_traffic_survey_data
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="iotDeviceId != null">iot_device_id,</if>
|
|
|
|
<if test="stakeMark != null and stakeMark != ''">stake_mark,</if>
|
|
|
|
<if test="direction != null">direction,</if>
|
|
|
|
<if test="timestamp != null">timestamp,</if>
|
|
|
|
<if test="trafficVolume != null">traffic_volume,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="iotDeviceId != null">#{iotDeviceId},</if>
|
|
|
|
<if test="stakeMark != null and stakeMark != ''">#{stakeMark},</if>
|
|
|
|
<if test="direction != null">#{direction},</if>
|
|
|
|
<if test="timestamp != null">#{timestamp},</if>
|
|
|
|
<if test="trafficVolume != null">#{trafficVolume},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
<insert id="batchInsert">
|
|
|
|
<foreach collection="list" item="dcTrafficSurveyData" index="index" separator=";">
|
|
|
|
insert into dc_traffic_survey_data
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="dcTrafficSurveyData.iotDeviceId != null">iot_device_id,</if>
|
|
|
|
<if test="dcTrafficSurveyData.stakeMark != null">stake_mark,</if>
|
|
|
|
<if test="dcTrafficSurveyData.direction != null">direction,</if>
|
|
|
|
<if test="dcTrafficSurveyData.timestamp != null">timestamp,</if>
|
|
|
|
<if test="dcTrafficSurveyData.trafficVolume != null">traffic_volume,</if>
|
|
|
|
<if test="dcTrafficSurveyData.followingPercentage != null">following_percentage,</if>
|
|
|
|
<if test="dcTrafficSurveyData.timeOccupancyRate != null">time_occupancy_rate,</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageHeadway != null">average_headway,</if>
|
|
|
|
<if test="dcTrafficSurveyData.trafficNumberOfInAndSmall != null">traffic_number_of_in_and_small,</if>
|
|
|
|
<if test="dcTrafficSurveyData.inAndSmallAverageVehicleSpeed != null">in_and_small_average_vehicle_speed,</if>
|
|
|
|
<if test="dcTrafficSurveyData.busTrafficVolume != null">bus_traffic_volume,</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfBus != null">average_speed_of_bus,</if>
|
|
|
|
<if test="dcTrafficSurveyData.trafficVolumeOfSmallTrucks != null">traffic_volume_of_small_trucks,</if>
|
|
|
|
<if test="dcTrafficSurveyData.smallTrucksAverageVehicleSpeed != null">small_trucks_average_vehicle_speed,</if>
|
|
|
|
<if test="dcTrafficSurveyData.mediumTruckTrafficVolume != null">medium_truck_traffic_volume,</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfMediumSizeTrucks != null">average_speed_of_medium_size_trucks,</if>
|
|
|
|
<if test="dcTrafficSurveyData.largeTruckTrafficVolume != null">large_truck_traffic_volume,</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfLargeTrucks != null">average_speed_of_large_trucks,</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfExtraLargeTrucks != null">average_speed_of_extra_large_trucks,</if>
|
|
|
|
<if test="dcTrafficSurveyData.extraLargeTrucksTrafficVolume != null">extra_large_trucks_traffic_volume,</if>
|
|
|
|
<if test="dcTrafficSurveyData.containerTruckTrafficVolume != null">container_truck_traffic_volume,</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfContainerTruck != null">average_speed_of_container_truck,</if>
|
|
|
|
<if test="dcTrafficSurveyData.motorcycleTrafficVolume != null">motorcycle_traffic_volume,</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfMotorcycle != null">average_speed_of_motorcycle,</if>
|
|
|
|
<if test="dcTrafficSurveyData.tractorTrafficVolume != null">tractor_traffic_volume,</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfTractor != null">average_speed_of_tractor,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="dcTrafficSurveyData.iotDeviceId != null">#{dcTrafficSurveyData.iotDeviceId},</if>
|
|
|
|
<if test="dcTrafficSurveyData.stakeMark != null">#{dcTrafficSurveyData.stakeMark},</if>
|
|
|
|
<if test="dcTrafficSurveyData.direction != null">#{dcTrafficSurveyData.direction},</if>
|
|
|
|
<if test="dcTrafficSurveyData.timestamp != null">#{dcTrafficSurveyData.timestamp},</if>
|
|
|
|
<if test="dcTrafficSurveyData.trafficVolume != null">#{dcTrafficSurveyData.trafficVolume},</if>
|
|
|
|
<if test="dcTrafficSurveyData.followingPercentage != null">#{dcTrafficSurveyData.followingPercentage},</if>
|
|
|
|
<if test="dcTrafficSurveyData.timeOccupancyRate != null">#{dcTrafficSurveyData.timeOccupancyRate},</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageHeadway != null">#{dcTrafficSurveyData.averageHeadway},</if>
|
|
|
|
<if test="dcTrafficSurveyData.trafficNumberOfInAndSmall != null">#{dcTrafficSurveyData.trafficNumberOfInAndSmall},</if>
|
|
|
|
<if test="dcTrafficSurveyData.inAndSmallAverageVehicleSpeed != null">#{dcTrafficSurveyData.inAndSmallAverageVehicleSpeed},</if>
|
|
|
|
<if test="dcTrafficSurveyData.busTrafficVolume != null">#{dcTrafficSurveyData.busTrafficVolume},</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfBus != null">#{dcTrafficSurveyData.averageSpeedOfBus},</if>
|
|
|
|
<if test="dcTrafficSurveyData.trafficVolumeOfSmallTrucks != null">#{dcTrafficSurveyData.trafficVolumeOfSmallTrucks},</if>
|
|
|
|
<if test="dcTrafficSurveyData.smallTrucksAverageVehicleSpeed != null">#{dcTrafficSurveyData.smallTrucksAverageVehicleSpeed},</if>
|
|
|
|
<if test="dcTrafficSurveyData.mediumTruckTrafficVolume != null">#{dcTrafficSurveyData.mediumTruckTrafficVolume},</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfMediumSizeTrucks != null">#{dcTrafficSurveyData.averageSpeedOfMediumSizeTrucks},</if>
|
|
|
|
<if test="dcTrafficSurveyData.largeTruckTrafficVolume != null">#{dcTrafficSurveyData.largeTruckTrafficVolume},</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfLargeTrucks != null">#{dcTrafficSurveyData.averageSpeedOfLargeTrucks},</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfExtraLargeTrucks != null">#{dcTrafficSurveyData.averageSpeedOfExtraLargeTrucks},</if>
|
|
|
|
<if test="dcTrafficSurveyData.extraLargeTrucksTrafficVolume != null">#{dcTrafficSurveyData.extraLargeTrucksTrafficVolume},</if>
|
|
|
|
<if test="dcTrafficSurveyData.containerTruckTrafficVolume != null">#{dcTrafficSurveyData.containerTruckTrafficVolume},</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfContainerTruck != null">#{dcTrafficSurveyData.averageSpeedOfContainerTruck},</if>
|
|
|
|
<if test="dcTrafficSurveyData.motorcycleTrafficVolume != null">#{dcTrafficSurveyData.motorcycleTrafficVolume},</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfMotorcycle != null">#{dcTrafficSurveyData.averageSpeedOfMotorcycle},</if>
|
|
|
|
<if test="dcTrafficSurveyData.tractorTrafficVolume != null">#{dcTrafficSurveyData.tractorTrafficVolume},</if>
|
|
|
|
<if test="dcTrafficSurveyData.averageSpeedOfTractor != null">#{dcTrafficSurveyData.averageSpeedOfTractor},</if>
|
|
|
|
</trim>
|
|
|
|
</foreach>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateDcTrafficSurveyData" parameterType="DcTrafficSurveyData">
|
|
|
|
update dc_traffic_survey_data
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="iotDeviceId != null">iot_device_id = #{iotDeviceId},</if>
|
|
|
|
<if test="stakeMark != null and stakeMark != ''">stake_mark = #{stakeMark},</if>
|
|
|
|
<if test="direction != null">direction = #{direction},</if>
|
|
|
|
<if test="timestamp != null">timestamp = #{timestamp},</if>
|
|
|
|
<if test="trafficVolume != null">traffic_volume = #{trafficVolume},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteDcTrafficSurveyDataById" parameterType="Long">
|
|
|
|
delete from dc_traffic_survey_data where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteDcTrafficSurveyDataByIds" parameterType="String">
|
|
|
|
delete from dc_traffic_survey_data where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|