Commit 46a30223 authored by duanruiming's avatar duanruiming

[add] 优化查区间灯态

parent 299c0aa2
......@@ -13,6 +13,9 @@ import java.util.List;
@Repository
public interface CrossLightsStatusHistMapper {
List<CrossLightsStatusHistPO> selectList(@Param("entity") CrossLightsStatusHistPO entity);
List<CrossLightsStatusHistPO> selectRangeList(@Param("crossId") String crossId,
@Param("startBatchTime") Integer startBatchTime,
@Param("endBatchTime") Integer endBatchTime);
void insertOne(@Param("entity") CrossLightsStatusHistPO entity);
}
......@@ -9,7 +9,7 @@ import lombok.Data;
* @date 2023/03/12 20:54
*/
@Data
@TableName("t_lane_data_hist")
@TableName("t_cross_turn_data_hist")
@ApiModel(value = "CrossTurnDataHistPO", description = "路口转向实时数据历史")
public class CrossTurnDataHistPO extends CrossTurnDataRealtimePO {
}
......@@ -27,6 +27,20 @@
</where>
</select>
<select id="selectRangeList" resultType="net.wanji.databus.dao.entity.CrossLightsStatusHistPO">
select
<include refid="Base_Column_List"/>
from t_cross_lights_status_hist
<where>
<if test="crossId != null and crossId != ''">
and cross_id = #{crossId}
</if>
<if test="crossId != null and crossId != ''">
and batch_time between #{startBatchTime} and #{endBatchTime}
</if>
</where>
</select>
<insert id="insertOne" parameterType="net.wanji.databus.dao.entity.CrossLightsStatusHistPO">
insert ignore into t_cross_lights_status_hist (cross_id, batch_time, lights_status_json)
values (#{entity.crossId}, #{entity.batchTime}, #{entity.lightsStatusJson})
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.wanji.databus.dao.mapper.CrossTurnDataHistMapper">
<resultMap id="BaseResultMap" type="net.wanji.databus.po.CrossTurnDataRealtimePO">
<resultMap id="BaseResultMap" type="net.wanji.databus.po.CrossTurnDataHistPO">
<result column="id" property="id"></result>
<result column="turn_type" property="turnType"></result>
<result column="in_dir" property="inDir"></result>
......@@ -40,7 +40,7 @@
green_light_efficiency,effusion_rate
</sql>
<insert id="insertBatch" parameterType="net.wanji.databus.po.CrossTurnDataRealtimePO">
<insert id="insertBatch" parameterType="net.wanji.databus.po.CrossTurnDataHistPO">
insert into t_cross_turn_data_hist
(<include refid="Base_Column_List"></include>)
values
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment