Commit 0cf1f054 authored by zhangsen's avatar zhangsen

脑图APIbug修改

parent 3eb57a14
......@@ -49,7 +49,7 @@ public class TestController extends BaseController {
public void test2 () {
// commonService.healthWarningMinuteByFJ();
commonService.healthWarningMinuteByFan();
commonService.healthWarningMinuteByPv();
}
......
......@@ -1686,7 +1686,17 @@ public class CommonServiceImpl {
}
}
idxBizFanHealthIndexService.saveBatch(idxBizFanHealthIndexs);
fanHealthIndexMapper.saveBatchHealthIndexList(fanHealthIndices1, "fan_health_index_moment");
ArrayList<FanHealthIndex> newList = new ArrayList<>();
for (int i = 0; i < fanHealthIndices1.size(); i++) {
//分批次处理
newList.add(fanHealthIndices1.get(i));//循环将数据填入载体list
if (500 == newList.size() || i == fanHealthIndices1.size() - 1) { //载体list达到要求,进行批量操作
//调用批量插入
fanHealthIndexMapper.saveBatchHealthIndexList(newList, "fan_health_index_moment");
newList.clear();//每次批量操作后,清空载体list,等待下次的数据填入
}
}
}
try {
......@@ -1914,7 +1924,16 @@ public class CommonServiceImpl {
}
}
idxBizPvHealthIndexService.saveBatch(idxBizPvHealthIndexs);
pvHealthIndexMapper.saveBatchHealthIndexList(fanHealthIndices1, "pv_health_index_moment");
ArrayList<PvHealthIndex> newList = new ArrayList<>();
for (int i = 0; i < fanHealthIndices1.size(); i++) {
//分批次处理
newList.add(fanHealthIndices1.get(i));//循环将数据填入载体list
if (500 == newList.size() || i == fanHealthIndices1.size() - 1) { //载体list达到要求,进行批量操作
//调用批量插入
pvHealthIndexMapper.saveBatchHealthIndexList(newList, "pv_health_index_moment");
newList.clear();//每次批量操作后,清空载体list,等待下次的数据填入
}
}
}
try {
logger.info("--------------------response: " + response);
......
......@@ -4,12 +4,12 @@
<insert id="saveBatchHealthIndexList">
insert into
${tableName}
using fan_health_index_data TAGS ('按时刻')
values
<foreach collection="list" separator="," item="item" index="index">
${tableName}
using fan_health_index_data TAGS (#{item.analysisType})
values
(
now + #{index}a,
now + #{index},
#{item.recDate, jdbcType=VARCHAR},
#{item.analysisObjType, jdbcType=VARCHAR},
#{item.analysisObjSeq, jdbcType=VARCHAR},
......
......@@ -2,35 +2,68 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper">
<insert id="saveBatchHealthIndexList">
insert into
<foreach collection="list" separator="," item="item" index="index">
${tableName}
using pv_health_index_data TAGS (#{item.analysisType})
<!--<insert id="saveBatchHealthIndexList">-->
<!-- insert into-->
<!-- <foreach collection="list" separator=" " item="item" index="index">-->
<!-- ${tableName}-->
<!-- using pv_health_index_data TAGS (#{item.analysisType})-->
<!-- values-->
<!-- (-->
<!-- now,-->
<!-- #{item.recDate, jdbcType=VARCHAR},-->
<!-- #{item.analysisObjType, jdbcType=VARCHAR},-->
<!-- #{item.analysisObjSeq, jdbcType=VARCHAR},-->
<!-- #{item.weight, jdbcType=FLOAT},-->
<!-- #{item.healthIndex, jdbcType=FLOAT},-->
<!-- #{item.healthLevel, jdbcType=VARCHAR},-->
<!-- #{item.analysisStartTime, jdbcType=VARCHAR},-->
<!-- #{item.analysisEndTime, jdbcType=VARCHAR},-->
<!-- #{item.area, jdbcType=VARCHAR},-->
<!-- #{item.station, jdbcType=VARCHAR},-->
<!-- #{item.subarray, jdbcType=VARCHAR},-->
<!-- #{item.manufacturer, jdbcType=VARCHAR},-->
<!-- #{item.deviceType, jdbcType=VARCHAR},-->
<!-- #{item.equipmentName, jdbcType=VARCHAR},-->
<!-- #{item.gatewayId, jdbcType=VARCHAR},-->
<!-- #{item.indexAddress, jdbcType=VARCHAR},-->
<!-- #{item.anomaly, jdbcType=FLOAT},-->
<!-- #{item.pointName, jdbcType=VARCHAR},-->
<!-- #{item.analysisTime, jdbcType=VARCHAR},-->
<!-- #{item.kks, jdbcType=VARCHAR},-->
<!-- )-->
<!-- </foreach>-->
<!-- </insert>-->
<insert id="saveBatchHealthIndexList">
insert into ${tableName}
using pv_health_index_data TAGS ('按时刻')
values
(
now,
#{item.recDate, jdbcType=VARCHAR},
#{item.analysisObjType, jdbcType=VARCHAR},
#{item.analysisObjSeq, jdbcType=VARCHAR},
#{item.weight, jdbcType=FLOAT},
#{item.healthIndex, jdbcType=FLOAT},
#{item.healthLevel, jdbcType=VARCHAR},
#{item.analysisStartTime, jdbcType=VARCHAR},
#{item.analysisEndTime, jdbcType=VARCHAR},
#{item.area, jdbcType=VARCHAR},
#{item.station, jdbcType=VARCHAR},
#{item.subarray, jdbcType=VARCHAR},
#{item.manufacturer, jdbcType=VARCHAR},
#{item.deviceType, jdbcType=VARCHAR},
#{item.equipmentName, jdbcType=VARCHAR},
#{item.gatewayId, jdbcType=VARCHAR},
#{item.indexAddress, jdbcType=VARCHAR},
#{item.anomaly, jdbcType=FLOAT},
#{item.pointName, jdbcType=VARCHAR},
#{item.analysisTime, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR},
)
</foreach>
<foreach collection="list" separator="," item="item" index="index">
(
now + #{index},
#{item.recDate, jdbcType=VARCHAR},
#{item.analysisObjType, jdbcType=VARCHAR},
#{item.analysisObjSeq, jdbcType=VARCHAR},
#{item.weight, jdbcType=FLOAT},
#{item.healthIndex, jdbcType=FLOAT},
#{item.healthLevel, jdbcType=VARCHAR},
#{item.analysisStartTime, jdbcType=VARCHAR},
#{item.analysisEndTime, jdbcType=VARCHAR},
#{item.area, jdbcType=VARCHAR},
#{item.station, jdbcType=VARCHAR},
#{item.subarray, jdbcType=VARCHAR},
#{item.manufacturer, jdbcType=VARCHAR},
#{item.deviceType, jdbcType=VARCHAR},
#{item.equipmentName, jdbcType=VARCHAR},
#{item.gatewayId, jdbcType=VARCHAR},
#{item.indexAddress, jdbcType=VARCHAR},
#{item.anomaly, jdbcType=FLOAT},
#{item.pointName, jdbcType=VARCHAR},
#{item.analysisTime, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR}
)
</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