<?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"><mappernamespace="net.wanji.databus.dao.mapper.CrossDirDataHistMapper"><resultMapid="BaseResultMap"type="net.wanji.databus.po.CrossDirDataHistPO"><resultcolumn="id"property="id"></result><resultcolumn="dir_type"property="dirType"></result><resultcolumn="in_out_type"property="inOutType"></result><resultcolumn="cross_id"property="crossId"></result><resultcolumn="length"property="length"></result><resultcolumn="status"property="status"></result><resultcolumn="traffic_index"property="trafficIndex"></result><resultcolumn="start_time"property="startTime"></result><resultcolumn="capacity"property="capacity"></result><resultcolumn="duration"property="duration"></result><resultcolumn="flow"property="flow"></result><resultcolumn="speed"property="speed"></result><resultcolumn="queue_length"property="queueLength"></result><resultcolumn="stop_times"property="stopTimes"></result><resultcolumn="delay_time"property="delayTime"></result><resultcolumn="sturation"property="sturation"></result><resultcolumn="batch_time"property="batchTime"></result><resultcolumn="gmt_create"property="gmtCreate"></result><resultcolumn="gmt_modified"property="gmtModified"></result><resultcolumn="effusion_rate"property="effusionRate"></result><resultcolumn="green_light_efficiency"property="greenLightEfficiency"></result></resultMap><sqlid="Base_Column_List">
id,dir_type,in_out_type,cross_id,length,status,traffic_index,start_time,capacity,duration,flow,speed,queue_length,stop_times,
delay_time,sturation,no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,batch_time,gmt_create,gmt_modified,effusion_rate,
green_light_efficiency,dt
</sql><insertid="insertBatch"parameterType="net.wanji.databus.po.CrossDirDataHistPO">
insert ignore into t_cross_dir_data_hist
(<includerefid="Base_Column_List"></include>)
values
<foreachcollection="list"item="entity"separator=",">
( #{entity.id}, #{entity.dirType}, #{entity.inOutType}, #{entity.crossId}, #{entity.length}, #{entity.status},
#{entity.trafficIndex}, #{entity.startTime}, #{entity.capacity}, #{entity.duration}, #{entity.flow},
#{entity.speed}, #{entity.queueLength}, #{entity.stopTimes}, #{entity.delayTime}, #{entity.sturation},
#{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate},#{entity.batchTime},
#{entity.gmtCreate}, #{entity.gmtModified},#{entity.effusionRate},#{entity.greenLightEfficiency}, DATE_FORMAT(#{entity.startTime}, '%Y%m%d')
)
</foreach></insert><deleteid="deleteBatch"parameterType="String">
delete from t_cross_dir_data_hist
where cross_id in
<foreachcollection="list"item="crossId"separator=","open="("close=")">
#{crossId}
</foreach></delete><selectid="selectByCrossIdAndTimestamp"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1
and batch_time <![CDATA[ >= ]]> #{preSeconds}
order by batch_time
</select><selectid="selectByCrossIdDirAndTimestamp"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1 and dir_type = #{dir}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
order by batch_time
</select><selectid="selectByCrossIdInOutTimestamp"resultType="net.wanji.databus.bo.CrossDirDataHistAvgBO">
SELECT dir_type as dirType, avg(capacity) as avgCapacity, avg(flow) as avgFlow,
avg(queue_length) as avgQueueLength, avg(traffic_index) as avgIndex,
avg(effusion_rate) as avgeffusionRate
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND in_out_type = #{inOutType}
AND batch_time <![CDATA[ >= ]]> #{preSeconds}
AND batch_time <![CDATA[ < ]]> #{endSeconds}
GROUP BY dir_type
</select><selectid="selectNoPark"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 2 and dir_type = #{dir}
and batch_time <![CDATA[ <= ]]> #{currentSeconds}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
</select><selectid="selectPhaseQueue"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 2 and dir_type != #{dir}
and batch_time <![CDATA[ <= ]]> #{currentSeconds}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
</select><selectid="selectNoParkEnd"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1 and dir_type = #{dir}
and batch_time <![CDATA[ <= ]]> #{currentSeconds}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
</select><selectid="selectPhaseQueueEnd"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1 and dir_type != #{dir}
and batch_time <![CDATA[ <= ]]> #{currentSeconds}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
</select><selectid="selectMetricHistDTO"resultType="net.wanji.databus.dto.MetricHistDTO">
select status, start_time, duration, flow, speed, sturation, capacity, stop_times, delay_time, batch_time, one_stop_rate, queue_length, effusion_rate, no_stop_rate, green_light_efficiency
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1 and dir_type = #{dir}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
order by batch_time
</select><selectid="selectByCrossIdAndStartEnd"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select><selectid="selectMaxDelayTime"resultType="java.lang.Integer">
select max(delay_time)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select><selectid="selectMaxQueueLength"resultType="java.lang.Double">
select max(queue_length)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select><selectid="selectMaxSaturation"resultType="java.lang.Double">
select max(sturation)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select><selectid="selectMaxGreenLightEfficiency"resultType="java.lang.Double">
select max(green_light_efficiency)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirCode} and in_out_type = #{code}
and batch_time <![CDATA[ >= ]]> #{startTimeStamp}
and batch_time <![CDATA[ <= ]]> #{endTimeStamp}
</select><selectid="selectByMetrics"resultType="net.wanji.databus.po.CrossDirDataHistPOExt">
SELECT <includerefid="Base_Column_List"/>
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND in_out_type = 1
AND dir_type = #{dirInt}
AND batch_time <![CDATA[ <= ]]> #{endTimeStamp}
AND batch_time <![CDATA[ >= ]]> #{startTimeStamp}
</select><selectid="selectByCrossIdsDirsAndTimestamp"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"></include>
from t_cross_dir_data_hist
where cross_id in
<foreachcollection="crossIdList"item="crossId"separator=","open="("close=")">
#{crossId}
</foreach>
and dir_type in
<foreachcollection="dirCodeList"item="dirCode"separator=","open="("close=")">
#{dirCode}
</foreach><!-- and in_out_type = 1-->
and batch_time <![CDATA[ >= ]]> #{startTimeStamp}
and batch_time <![CDATA[ <= ]]> #{endTimeStamp}
order by batch_time
</select><selectid="selectByCrossDirAndTimeSection"resultType="net.wanji.databus.po.CrossDirDataHistPO">
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND dir_type = #{dirCode}
AND in_out_type = 1
AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%Y-%m-%d') BETWEEN #{boStartDayStr} AND #{boEndDayStr}
AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%H:%i') BETWEEN #{startHourMinuteStr} AND #{endHourMinuteStr}
</select><selectid="selectByCrossIdDirsAndTimestamp"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"></include>
from t_cross_dir_data_hist
where cross_id = #{crossId}
and dir_type in
<foreachcollection="dirCodeList"item="dirCode"separator=","open="("close=")">
#{dirCode}
</foreach>
and in_out_type = 1
and batch_time <![CDATA[ >= ]]> #{startTimeStamp}
and batch_time <![CDATA[ <= ]]> #{endTimeStamp}
order by batch_time
</select><!-- 神思推送数据in_out_type=0 --><selectid="selectDirDataList"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"></include>
from t_cross_dir_data_hist
where cross_id = #{crossId}
and dir_type in
<foreachcollection="dirCodeList"item="dirCode"separator=","open="("close=")">
#{dirCode}
</foreach>
and batch_time <![CDATA[ >= ]]> #{startTimeStamp}
and batch_time <![CDATA[ <= ]]> #{endTimeStamp}
order by batch_time
</select><selectid="selectByCrossDirsAndTimeSection"resultType="net.wanji.databus.po.CrossDirDataHistPO">
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND dir_type in
<foreachcollection="dirCodeList"item="dirCode"separator=","open="("close=")">
#{dirCode}
</foreach>
AND in_out_type = 1
AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%Y-%m-%d') BETWEEN #{boStartDayStr} AND #{boEndDayStr}
AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%H:%i') BETWEEN #{startHourMinuteStr} AND #{endHourMinuteStr}
</select><selectid="selectByTimeSection"resultType="net.wanji.databus.po.CrossDirDataHistPO"><!-- SELECT <include refid="Base_Column_List"></include>--><!-- FROM t_cross_dir_data_hist--><!-- WHERE in_out_type = 1--><!-- AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%Y-%m-%d') BETWEEN #{boStartDayStr} AND #{boEndDayStr}--><!-- AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%H:%i') BETWEEN #{startHourMinuteStr} AND #{endHourMinuteStr}-->
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE batch_time BETWEEN UNIX_TIMESTAMP(STR_TO_DATE(concat(#{boStartDayStr}, #{startHourMinuteStr}), '%Y-%m-%d%H:%i'))
AND UNIX_TIMESTAMP(STR_TO_DATE(concat(#{boEndDayStr}, #{endHourMinuteStr}), '%Y-%m-%d%H:%i'))
AND in_out_type = 1
</select><selectid="selectExtByTimeSection"resultType="net.wanji.databus.po.CrossDirDataHistPOExt">
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE batch_time BETWEEN UNIX_TIMESTAMP(STR_TO_DATE(concat(#{boStartDayStr}, #{startHourMinuteStr}), '%Y-%m-%d%H:%i'))
AND UNIX_TIMESTAMP(STR_TO_DATE(concat(#{boEndDayStr}, #{endHourMinuteStr}), '%Y-%m-%d%H:%i'))
AND in_out_type = 1
</select><selectid="selectByCrossIdAndHour"resultType="net.wanji.databus.po.CrossDirDataHistPO">
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND start_time >= DATE_SUB( NOW(), INTERVAL #{hour} HOUR )
ORDER BY
start_time DESC
</select></mapper>
\ No newline at end of file
<?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"><mappernamespace="net.wanji.databus.dao.mapper.CrossDirDataHistMapper"><resultMapid="BaseResultMap"type="net.wanji.databus.po.CrossDirDataHistPO"><resultcolumn="id"property="id"></result><resultcolumn="dir_type"property="dirType"></result><resultcolumn="in_out_type"property="inOutType"></result><resultcolumn="cross_id"property="crossId"></result><resultcolumn="length"property="length"></result><resultcolumn="status"property="status"></result><resultcolumn="traffic_index"property="trafficIndex"></result><resultcolumn="start_time"property="startTime"></result><resultcolumn="capacity"property="capacity"></result><resultcolumn="duration"property="duration"></result><resultcolumn="flow"property="flow"></result><resultcolumn="speed"property="speed"></result><resultcolumn="queue_length"property="queueLength"></result><resultcolumn="stop_times"property="stopTimes"></result><resultcolumn="delay_time"property="delayTime"></result><resultcolumn="sturation"property="sturation"></result><resultcolumn="batch_time"property="batchTime"></result><resultcolumn="gmt_create"property="gmtCreate"></result><resultcolumn="gmt_modified"property="gmtModified"></result><resultcolumn="effusion_rate"property="effusionRate"></result><resultcolumn="green_light_efficiency"property="greenLightEfficiency"></result></resultMap><sqlid="Base_Column_List">
id,dir_type,in_out_type,cross_id,length,status,traffic_index,start_time,capacity,duration,flow,speed,queue_length,stop_times,
delay_time,sturation,no_stop_rate,one_stop_rate,two_stop_rate,three_stop_rate,batch_time,gmt_create,gmt_modified,effusion_rate,
green_light_efficiency,dt
</sql><insertid="insertBatch"parameterType="net.wanji.databus.po.CrossDirDataHistPO">
insert ignore into t_cross_dir_data_hist
(<includerefid="Base_Column_List"></include>)
values
<foreachcollection="list"item="entity"separator=",">
( #{entity.id}, #{entity.dirType}, #{entity.inOutType}, #{entity.crossId}, #{entity.length}, #{entity.status},
#{entity.trafficIndex}, #{entity.startTime}, #{entity.capacity}, #{entity.duration}, #{entity.flow},
#{entity.speed}, #{entity.queueLength}, #{entity.stopTimes}, #{entity.delayTime}, #{entity.sturation},
#{entity.noStopRate},#{entity.oneStopRate},#{entity.twoStopRate},#{entity.threeStopRate},#{entity.batchTime},
now(), now(), #{entity.effusionRate},#{entity.greenLightEfficiency}, DATE_FORMAT(#{entity.startTime}, '%Y%m%d')
)
</foreach></insert><deleteid="deleteBatch"parameterType="String">
delete from t_cross_dir_data_hist
where cross_id in
<foreachcollection="list"item="crossId"separator=","open="("close=")">
#{crossId}
</foreach></delete><selectid="selectByCrossIdAndTimestamp"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1
and batch_time <![CDATA[ >= ]]> #{preSeconds}
order by batch_time
</select><selectid="selectByCrossIdDirAndTimestamp"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1 and dir_type = #{dir}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
order by batch_time
</select><selectid="selectByCrossIdInOutTimestamp"resultType="net.wanji.databus.bo.CrossDirDataHistAvgBO">
SELECT dir_type as dirType, avg(capacity) as avgCapacity, avg(flow) as avgFlow,
avg(queue_length) as avgQueueLength, avg(traffic_index) as avgIndex,
avg(effusion_rate) as avgeffusionRate
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND in_out_type = #{inOutType}
AND batch_time <![CDATA[ >= ]]> #{preSeconds}
AND batch_time <![CDATA[ < ]]> #{endSeconds}
GROUP BY dir_type
</select><selectid="selectNoPark"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 2 and dir_type = #{dir}
and batch_time <![CDATA[ <= ]]> #{currentSeconds}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
</select><selectid="selectPhaseQueue"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 2 and dir_type != #{dir}
and batch_time <![CDATA[ <= ]]> #{currentSeconds}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
</select><selectid="selectNoParkEnd"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1 and dir_type = #{dir}
and batch_time <![CDATA[ <= ]]> #{currentSeconds}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
</select><selectid="selectPhaseQueueEnd"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1 and dir_type != #{dir}
and batch_time <![CDATA[ <= ]]> #{currentSeconds}
and batch_time <![CDATA[ >= ]]> #{preSeconds}
</select><selectid="selectMetricHistDTO"resultType="net.wanji.databus.dto.MetricHistDTO">
select status, start_time, duration, flow, speed, sturation, capacity, stop_times, delay_time, batch_time, one_stop_rate, queue_length, effusion_rate, no_stop_rate, green_light_efficiency
from t_cross_dir_data_hist
where cross_id = #{crossId} and in_out_type = 1 and dir_type = #{dir}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
order by batch_time
</select><selectid="selectByCrossIdAndStartEnd"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"/>
from t_cross_dir_data_hist
where cross_id = #{crossId}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select><selectid="selectMaxDelayTime"resultType="java.lang.Integer">
select max(delay_time)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select><selectid="selectMaxQueueLength"resultType="java.lang.Double">
select max(queue_length)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select><selectid="selectMaxSaturation"resultType="java.lang.Double">
select max(sturation)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirType} and in_out_type = #{inOutType}
and batch_time <![CDATA[ >= ]]> #{startStamp}
and batch_time <![CDATA[ <= ]]> #{endStamp}
</select><selectid="selectMaxGreenLightEfficiency"resultType="java.lang.Double">
select max(green_light_efficiency)
from t_cross_dir_data_hist
where cross_id = #{crossId} and dir_type = #{dirCode} and in_out_type = #{code}
and batch_time <![CDATA[ >= ]]> #{startTimeStamp}
and batch_time <![CDATA[ <= ]]> #{endTimeStamp}
</select><selectid="selectByMetrics"resultType="net.wanji.databus.po.CrossDirDataHistPOExt">
SELECT <includerefid="Base_Column_List"/>
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND in_out_type = 1
AND dir_type = #{dirInt}
AND batch_time <![CDATA[ <= ]]> #{endTimeStamp}
AND batch_time <![CDATA[ >= ]]> #{startTimeStamp}
</select><selectid="selectByCrossIdsDirsAndTimestamp"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"></include>
from t_cross_dir_data_hist
where cross_id in
<foreachcollection="crossIdList"item="crossId"separator=","open="("close=")">
#{crossId}
</foreach>
and dir_type in
<foreachcollection="dirCodeList"item="dirCode"separator=","open="("close=")">
#{dirCode}
</foreach><!-- and in_out_type = 1-->
and batch_time <![CDATA[ >= ]]> #{startTimeStamp}
and batch_time <![CDATA[ <= ]]> #{endTimeStamp}
order by batch_time
</select><selectid="selectByCrossDirAndTimeSection"resultType="net.wanji.databus.po.CrossDirDataHistPO">
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND dir_type = #{dirCode}
AND in_out_type = 1
AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%Y-%m-%d') BETWEEN #{boStartDayStr} AND #{boEndDayStr}
AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%H:%i') BETWEEN #{startHourMinuteStr} AND #{endHourMinuteStr}
</select><selectid="selectByCrossIdDirsAndTimestamp"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"></include>
from t_cross_dir_data_hist
where cross_id = #{crossId}
and dir_type in
<foreachcollection="dirCodeList"item="dirCode"separator=","open="("close=")">
#{dirCode}
</foreach>
and in_out_type = 1
and batch_time <![CDATA[ >= ]]> #{startTimeStamp}
and batch_time <![CDATA[ <= ]]> #{endTimeStamp}
order by batch_time
</select><!-- 神思推送数据in_out_type=0 --><selectid="selectDirDataList"resultType="net.wanji.databus.po.CrossDirDataHistPO">
select <includerefid="Base_Column_List"></include>
from t_cross_dir_data_hist
where cross_id = #{crossId}
and dir_type in
<foreachcollection="dirCodeList"item="dirCode"separator=","open="("close=")">
#{dirCode}
</foreach>
and batch_time <![CDATA[ >= ]]> #{startTimeStamp}
and batch_time <![CDATA[ <= ]]> #{endTimeStamp}
order by batch_time
</select><selectid="selectByCrossDirsAndTimeSection"resultType="net.wanji.databus.po.CrossDirDataHistPO">
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND dir_type in
<foreachcollection="dirCodeList"item="dirCode"separator=","open="("close=")">
#{dirCode}
</foreach>
AND in_out_type = 1
AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%Y-%m-%d') BETWEEN #{boStartDayStr} AND #{boEndDayStr}
AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%H:%i') BETWEEN #{startHourMinuteStr} AND #{endHourMinuteStr}
</select><selectid="selectByTimeSection"resultType="net.wanji.databus.po.CrossDirDataHistPO"><!-- SELECT <include refid="Base_Column_List"></include>--><!-- FROM t_cross_dir_data_hist--><!-- WHERE in_out_type = 1--><!-- AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%Y-%m-%d') BETWEEN #{boStartDayStr} AND #{boEndDayStr}--><!-- AND DATE_FORMAT(FROM_UNIXTIME(batch_time), '%H:%i') BETWEEN #{startHourMinuteStr} AND #{endHourMinuteStr}-->
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE batch_time BETWEEN UNIX_TIMESTAMP(STR_TO_DATE(concat(#{boStartDayStr}, #{startHourMinuteStr}), '%Y-%m-%d%H:%i'))
AND UNIX_TIMESTAMP(STR_TO_DATE(concat(#{boEndDayStr}, #{endHourMinuteStr}), '%Y-%m-%d%H:%i'))
AND in_out_type = 1
</select><selectid="selectExtByTimeSection"resultType="net.wanji.databus.po.CrossDirDataHistPOExt">
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE batch_time BETWEEN UNIX_TIMESTAMP(STR_TO_DATE(concat(#{boStartDayStr}, #{startHourMinuteStr}), '%Y-%m-%d%H:%i'))
AND UNIX_TIMESTAMP(STR_TO_DATE(concat(#{boEndDayStr}, #{endHourMinuteStr}), '%Y-%m-%d%H:%i'))
AND in_out_type = 1
</select><selectid="selectByCrossIdAndHour"resultType="net.wanji.databus.po.CrossDirDataHistPO">
SELECT <includerefid="Base_Column_List"></include>
FROM t_cross_dir_data_hist
WHERE cross_id = #{crossId}
AND start_time >= DATE_SUB( NOW(), INTERVAL #{hour} HOUR )
ORDER BY
start_time DESC
</select></mapper>