Commit 9f1b36c1 authored by tangwei's avatar tangwei

增加修改

parent 90a36c7c
package com.yeejoin.amos.boot.module.jxiop.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mysql.cj.x.protobuf.MysqlxCrud;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.entity.MonitorFanIndicator;
import java.util.List;
/**
* @description:
* @author: tw
* @createDate: 2023/7/3
*/
public interface MonitorFanIndicatorMapper extends BaseMapper<MonitorFanIndicator> {
//批量修改
void UpdateMonitorFanIndicator(List<IndexDto> list);
}
package com.yeejoin.amos.boot.module.jxiop.api.service; package com.yeejoin.amos.boot.module.jxiop.api.service;
import com.mysql.cj.x.protobuf.MysqlxCrud;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import java.util.List;
/** /**
* @description: * @description:
* @author: tw * @author: tw
...@@ -8,4 +13,8 @@ package com.yeejoin.amos.boot.module.jxiop.api.service; ...@@ -8,4 +13,8 @@ package com.yeejoin.amos.boot.module.jxiop.api.service;
public interface IMonitorFanIndicator { public interface IMonitorFanIndicator {
//批量修改指标值
void UpdateMonitorFanIndicator(List<IndexDto> list);
} }
...@@ -26,7 +26,7 @@ public interface IStationDataTask { ...@@ -26,7 +26,7 @@ public interface IStationDataTask {
//每个分级信息处理 //每个分级信息处理
void setMonitorFanIndicator(List<IndexDto> list); void setMonitorFanIndicator(List<IndexDto> list);
......
<?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.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper">
<update id="">
<foreach collection="list" item="item" index="index">
update monitor_fan_indicator set indicator_value =#{item.indicatorValue} ,set time=#{item.time}
where gateway=#{time.gateway} and index_address=#{time.indexAddress}
</foreach>
</update>
</mapper>
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl; package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.yeejoin.amos.boot.module.jxiop.api.dto.IndexDto;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.MonitorFanIndicatorMapper;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.RegionMapper;
import com.yeejoin.amos.boot.module.jxiop.api.service.IMonitorFanIndicator; import com.yeejoin.amos.boot.module.jxiop.api.service.IMonitorFanIndicator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* @description: * @description:
* @author: tw * @author: tw
* @createDate: 2023/7/3 * @createDate: 2023/7/3
*/ */
@Service
public class MonitorFanIndicatorImpl implements IMonitorFanIndicator { public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
@Autowired
MonitorFanIndicatorMapper monitorFanIndicatorregionMapper;
@Async("jxiopAsyncExecutor")
@Override
public void UpdateMonitorFanIndicator(List<IndexDto> list) {
monitorFanIndicatorregionMapper.UpdateMonitorFanIndicator(list);
}
} }
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