Commit a95e90da authored by duanruiming's avatar duanruiming

[add] 添加绿波实时和历史表插入语法

parent 5d9c6328
......@@ -2,6 +2,7 @@ package net.wanji.databus.dao.mapper;
import net.wanji.databus.dao.entity.GreenwaveHistPO;
import net.wanji.databus.dao.entity.GreenwaveHistPOExt;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Date;
......@@ -18,4 +19,6 @@ public interface GreenwaveHistMapper {
List<GreenwaveHistPO> selectByTimeSection(String startTimeStr, String endTimeStr);
List<GreenwaveHistPO> selectByIdAndTimeSection(Integer greenwaveId, String startTimeStr, String endTimeStr);
int insertBatch(@Param("list") List<GreenwaveHistPO> list);
}
package net.wanji.databus.dao.mapper;
import feign.Param;
import net.wanji.databus.dao.entity.GreenwaveRealtimePO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author Kent HAN
* @date 2022/10/31 11:03
......@@ -10,4 +13,6 @@ import org.springframework.stereotype.Repository;
@Repository
public interface GreenwaveRealtimeMapper {
GreenwaveRealtimePO selectById(Integer id);
int insertBatch(@Param("list") List<GreenwaveRealtimePO> list);
}
......@@ -41,4 +41,16 @@
and gmt_modified <![CDATA[ >= ]]> #{startTimeStr}
</select>
<insert id="insertBatch" parameterType="net.wanji.databus.dao.entity.GreenwaveHistPO">
insert into t_greenwave_realtime
<include refid="baseColumnList"></include>
values
<foreach collection="list" item="entity" separator="," open="(" close=")">
(#{entity.id}, #{entity.status}, #{entity.type}, #{entity.trafficIndex},#{entity.speed},
#{entity.trvalTime}, #{entity.stopTimes}, #{entity.queueLength}, #{entity.congRate},
#{entity.delayTime}, #{entity.noparkPassRate}, #{entity.cordReliability}, #{entity.cordQueueRatio},
#{entity.uncoordinatePhaseQueue})
</foreach>
</insert>
</mapper>
......@@ -8,9 +8,22 @@
</sql>
<select id="selectById" resultType="net.wanji.databus.dao.entity.GreenwaveRealtimePO">
select <include refid="baseColumnList"/>
select
<include refid="baseColumnList"/>
from t_greenwave_realtime
where id = #{id}
</select>
<insert id="insertBatch" parameterType="net.wanji.databus.dao.entity.GreenwaveRealtimePO">
insert into t_greenwave_realtime
<include refid="baseColumnList"></include>
values
<foreach collection="list" item="entity" separator="," open="(" close=")">
(#{entity.id}, #{entity.status}, #{entity.type}, #{entity.trafficIndex},#{entity.speed},
#{entity.trvalTime}, #{entity.stopTimes}, #{entity.queueLength}, #{entity.congRate},
#{entity.delayTime}, #{entity.noparkPassRate}, #{entity.cordReliability}, #{entity.cordQueueRatio},
#{entity.uncoordinatePhaseQueue})
</foreach>
</insert>
</mapper>
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