smart-man-boot/src/main/java/com/qianwen/smartman/common/config/MdcMqttConfig.java
@@ -2,6 +2,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Random; import org.eclipse.paho.client.mqttv3.MqttConnectOptions; @@ -113,11 +114,11 @@ String payload = (String)message.getPayload(); logger.info("æ¥æ¶å°mqttæ¶æ¯readtime,data={}",payload);//æ¶æ¯ä½å¦ä½å®ä¹ï¼æ°æ®ç¹åç§°ï¼å¼ï¼æ¶é´ï¼ç¨jsonå¯¹è±¡ä¼ è¿æ¥ //TelemetryDataMessage result = TelemetryDataUtils.handleTelemetryDataMessage(telemetryDataMessage, workStationItem); JSONObject data = JSONObject.parseObject(payload); long workstationId = data.getLong("workstationId"); String name = data.getString("name");//keyï¼ long time = data.getLong("time"); String v = data.getString("value"); JSONObject payLoadJson = JSONObject.parseObject(payload); long workstationId = payLoadJson.getLong("workstationId"); String name = payLoadJson.getString("name");//keyï¼ long time = payLoadJson.getLong("time"); String v = payLoadJson.getString("value"); //å°æ°æ®å å ¥ç¼å TelemetryDataResponseDTO telemetryDataResponseDTO = new TelemetryDataResponseDTO(v, time); @@ -126,15 +127,32 @@ //åéwebsocketæ¶æ¯ RealTimeDaraResponseJsonWebSocketMessage jsonWebSocketMessage = new RealTimeDaraResponseJsonWebSocketMessage(); jsonWebSocketMessage.setId(""+workstationId); /* jsonWebSocketMessage.setData(new HashMap<String, Object>() { // from class: org.springblade.modules.cps.message.consumer.TelemetryDataRealTimeConsumer.1 { put(name, telemetryDataResponseDTO); } }); */ Map<String, Object> map = WorkstationCache.getWorkstationRealTime(workstationId+""); jsonWebSocketMessage.setData(map); //RedisMessageDistributor messageDistributor = (RedisMessageDistributor) SpringUtil.getBean(RedisMessageDistributor.class); MessageDO messageDO = new MessageDO(); messageDO.setNeedBroadcast(Boolean.FALSE); messageDO.setMessageText(JSONUtil.toJsonStr(jsonWebSocketMessage)); messageDO.setNeedBroadcast(false); String msgtxt =JSONUtil.toJsonStr(jsonWebSocketMessage); logger.info("websockettxt={}",msgtxt); messageDO.setMessageText(msgtxt); /* JSONObject testMsg = new JSONObject(); JSONObject msgdata = JSONObject.parseObject(JSONUtil.toJsonStr(map)); testMsg.put("data", msgdata); testMsg.put("id", workstationId+""); String msgtxt = testMsg.toJSONString(); */ messageDistributor.distribute(messageDO); } smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/controller/ShiftController.java
@@ -62,14 +62,14 @@ @PreAuth @PutResource @ApiOperation("ç¼è¾ç次模å") @ApiOperation("ç¼è¾ç次模å") public R<ShiftModelVO> updateShift(@Validated @RequestBody ShiftUpdateVO shiftUpdateVO) { return R.data(ShiftConvert.INSTANCE.convert(this.shiftModelService.update(shiftUpdateVO))); } @PreAuth @PutResource({"/updateBasic"}) @ApiOperation("ç¼è¾ç次模ååºç¡ä¿¡æ¯") @ApiOperation("ç¼è¾ç次模ååºç¡ä¿¡æ¯") public R<ShiftModelVO> updateShiftBasic(@RequestBody ShiftUpdateBasicVO shiftUpdateBasicVO) { return R.data(ShiftConvert.INSTANCE.convert(this.shiftModelService.updateShiftBasic(shiftUpdateBasicVO))); } smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/controller/WorkstationWcsController.java
@@ -38,6 +38,11 @@ this.machineService = machineService; } /** * å°±æ¯å·¥ä½çé¢ é 置工ä½éé ä¿åçï¼è¿ä¸ªåºè¯¥ä¸è¦äºï¼æä»¬æ¹ä¸ºæ°æ®ç¹é ç½®äº * @param workstationWcsSaveVOList * @return */ @PreAuth @PostResource({"/save"}) @ApiOperation("æ°å¢ææ´æ¹å·¥åµåæ°ä¿¡æ¯") smart-man-boot/src/main/java/com/qianwen/smartman/modules/cps/vo/ShiftUpdateVO.java
@@ -14,6 +14,11 @@ private Long id; @ApiModelProperty("çæ¬¡æ°é") private Integer shiftNumber; @ApiModelProperty("çå¶åç§°") private String name; @ApiModelProperty("çå¶é¢è²") private String colour; @ApiModelProperty("çæ¬¡æ¥å¼å§æ¶é´") private Integer startTime; @ApiModelProperty("çæ¬¡æ¥ç»ææ¶é´") @@ -193,4 +198,21 @@ public List<ShiftDetailDTO> getShiftDetailDTOList() { return this.shiftDetailDTOList; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getColour() { return colour; } public void setColour(String colour) { this.colour = colour; } } smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/dto/ProcessParameterVO.java
@@ -103,11 +103,13 @@ } public Long getRealTime() { return this.realTime; /* if(this.time != null) { return this.time.getTime(); }else { return null; } }*/ } public String getCollectItem() { smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.java
@@ -53,7 +53,7 @@ * @return */ //ProcessParameterVO oldFirstStatue(@Param("workstationId") String workstationId, @Param("item") String item, @Param("startTime") Long startTime); LastProcessParam lastParameterLessThanTime(@Param("workstationId") Long workstationId, @Param("item") String item, @Param("startTime") Long startTime); //LastProcessParam lastParameterLessThanTime(@Param("workstationId") Long workstationId, @Param("item") String item, @Param("startTime") Long startTime); /** * @@ -63,7 +63,7 @@ * @return */ //ProcessParameterVO oldLastStatue(@Param("workstationId") String workstationId, @Param("item") String item, @Param("endTime") Long endTime); LastProcessParam lastParameterGreaterThanTime(@Param("workstationId") Long workstationId, @Param("item") String item, @Param("endTime") Long endTime); //LastProcessParam lastParameterGreaterThanTime(@Param("workstationId") Long workstationId, @Param("item") String item, @Param("endTime") Long endTime); smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/IEfficiencyAnalysisService.java
@@ -10,6 +10,12 @@ import com.qianwen.smartman.modules.mdc.vo.StatisticsVO; public interface IEfficiencyAnalysisService { /** * æ§è¡æçåæï¼è¾åºç»æå¯¹è±¡ * @param statisticsAnalysisQueryVO * @param query * @return */ StatisticsVO efficiencyAnalysis(StatisticsAnalysisQueryVO statisticsAnalysisQueryVO, Query query); List<ColumnInfoVO> getIntervalDate(QueryIntervalDateVO queryIntervalDateVO); smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/IProcessParameterService.java
@@ -7,6 +7,7 @@ import com.qianwen.smartman.modules.cps.dto.WorkstationWcsDmpDTO; import com.qianwen.smartman.modules.cps.entity.GlobalWcs; import com.qianwen.smartman.modules.mdc.dto.ProcessParameterRealVO; import com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO; import com.qianwen.smartman.modules.mdc.entity.WorkstationCollectData; import com.qianwen.smartman.modules.mdc.vo.AllShiftTimeDetail; import com.qianwen.smartman.modules.mdc.vo.CollectParamResVO; @@ -61,4 +62,6 @@ * @return */ List<WorkstationCollectData> queryLastParameter(long workstationId); } smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/ISuperAggregateStateService.java
@@ -18,6 +18,14 @@ */ List<SuperAggregateState> getStatusData(List<Long> workstationIds, StatisticalMethodEnum statisticalMethod, LocalDate startDate, LocalDate endDate); /** * 稼å¨çæ°æ®æ¥è¯¢ * @param workstationIds * @param statisticalMethod * @param startDate * @param endDate * @return */ List<SuperAggregateState> getStatusDataWithFeedback(List<Long> workstationIds, StatisticalMethodEnum statisticalMethod, LocalDate startDate, LocalDate endDate); List<SuperAggregateState> getStatusByCondition(List<Long> workstationIds, LocalDateTime startTime, LocalDateTime endTime); smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/ProcessParameterHelperService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,119 @@ package com.qianwen.smartman.modules.mdc.service; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Service; import com.baomidou.dynamic.datasource.annotation.DS; import com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO; @DS("iotdb") @Service public class ProcessParameterHelperService { private static final Logger log = LoggerFactory.getLogger(ProcessParameterHelperService.class); @Autowired private JdbcTemplate jdbcTemplate; @DS("iotdb") public ProcessParameterVO queryLastParameterLessThenTime(long workstationId,String item,Long time) { /** *tdengineå®ç°ï¼oldFirstStatue * select last(ts) as realTime, last(v) as value_collect from iot_data.super_collect_data where n = #{item} and ts < #{startTime} and workstation_id = #{workstationId} */ ProcessParameterVO vo = null; String sql ="select max_time(n) as ts,last_value(n) as n,last_value(v) as v,last_value(workstation_id) as workstationId from root.f2.process_param_"+workstationId+"_"+item+" where time<"+time+" limit 1 align by device"; List<ProcessParameterVO> list = jdbcTemplate.query(sql, new RowMapper<ProcessParameterVO>() { @Override public ProcessParameterVO mapRow(ResultSet rs, int rowNum) throws SQLException { ProcessParameterVO p = new ProcessParameterVO(); Long time = rs.getLong("ts"); p.setRealTime(time); p.setCollectItem(rs.getString("n")); p.setValueCollect(rs.getString("v")); return p; } }); if(!list.isEmpty()) { vo = list.get(0); } return vo; } /** * è·å工使æ°åæ°å¼(ééæ¶é´åºå¤§äºæå®æ¶é´) * @param workstationId * @param item åæ°åç§°,å¦DeviceStatus/Output * @param time æå®çæ¶é´ * @return */ @DS("iotdb") public ProcessParameterVO getLastParameterGreaterThenTime(long workstationId,String item,Long time) { /* oldLastStatue select last(ts) as realTime, last(v) as value_collect from iot_data.super_collect_data where n = #{item} and ts > #{endTime} and workstation_id = #{workstationId} * */ /* LastProcessParam lp = this.parameterMapper.lastParameterGreaterThanTime(workstationId,item,time); if(lp == null) { return null; } ProcessParameterVO vo = new ProcessParameterVO(); //è§£æjson为对象å表 JSONObject paramsObj = JSONObject.parseObject(lp.getParamJson()); if(paramsObj.containsKey(item)) { JSONObject itemObj = paramsObj.getJSONObject(item); Long lastTime = itemObj.getLong("time"); vo.setTime(new Timestamp(lastTime)); vo.setRealTime(lastTime); vo.setValueCollect(itemObj.getString("value")); } return vo;*/ ProcessParameterVO vo = null; String sql ="select max_time(n) as ts,last_value(n) as n,last_value(v) as v,last_value(workstation_id) as workstationId from root.f2.process_param_"+workstationId+"_"+item+" where time>"+time+" limit 1 align by device"; List<ProcessParameterVO> list = jdbcTemplate.query(sql, new RowMapper<ProcessParameterVO>() { @Override public ProcessParameterVO mapRow(ResultSet rs, int rowNum) throws SQLException { ProcessParameterVO p = new ProcessParameterVO(); p.setRealTime(rs.getLong("ts")); p.setCollectItem(rs.getString("n")); p.setValueCollect(rs.getString("v")); return p; } }); if(!list.isEmpty()) { vo = list.get(0); } return vo; } } smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/ProcessParameterServiceImpl.java
@@ -1,7 +1,9 @@ package com.qianwen.smartman.modules.mdc.service.impl; import cn.hutool.core.lang.Tuple; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -49,8 +51,10 @@ import com.qianwen.smartman.modules.cps.entity.Workstation; import com.qianwen.smartman.modules.cps.service.ICalendarService; import com.qianwen.smartman.modules.cps.service.IWorkstationService; import com.qianwen.smartman.modules.cps.service.WorkstationDatapointsService; import com.qianwen.smartman.modules.cps.utils.ThrowFun; import com.qianwen.smartman.modules.cps.vo.ShiftTimeDetailVO; import com.qianwen.smartman.modules.cps.vo.WorkstationDatapointsVO; import com.qianwen.smartman.modules.mdc.dto.GroupWorkDTO; import com.qianwen.smartman.modules.mdc.dto.NewParamDTO; import com.qianwen.smartman.modules.mdc.dto.ParamDTO; @@ -65,6 +69,7 @@ import com.qianwen.smartman.modules.mdc.mapper.SuperCollectJsonMapper; import com.qianwen.smartman.modules.mdc.mapper.SuperProcessParameterMapper; import com.qianwen.smartman.modules.mdc.service.IProcessParameterService; import com.qianwen.smartman.modules.mdc.service.ProcessParameterHelperService; import com.qianwen.smartman.modules.mdc.utils.ExcelStrategyUtil; import com.qianwen.smartman.modules.mdc.vo.AllShiftTimeDetail; import com.qianwen.smartman.modules.mdc.vo.CollectParamResVO; @@ -99,6 +104,11 @@ private ICalendarService calendarService; @Autowired private JdbcTemplate jdbcTemplate; @Autowired private WorkstationDatapointsService dpService; @Autowired private ProcessParameterHelperService helperService; /* public ProcessParameterServiceImpl(final SuperCollectJsonMapper collectJsonMapper, final IWorkstationService workstationService, final OssBuilder ossBuilder, final SuperProcessParameterMapper parameterMapper, final ICalendarService calendarService) { this.collectJsonMapper = collectJsonMapper; @@ -157,13 +167,45 @@ @Override public List<WorkstationWcsDmpDTO> processParam(String workstationId) { /* List<WorkstationWcsDmpDTO> vos =WorkstationCache.getWorkstationWcsList(workstationId).stream().filter((v0) -> { return v0.getProcessParameter(); }).collect(Collectors.toList()); if (Func.isEmpty(vos)) { return Lists.newArrayList(); } return vos; return vos;*/ //è·åå±ç¤ºå¨è¿ç¨åæ°ä¸çåé List<WorkstationWcsDmpDTO> dps = new ArrayList<>(); if(ObjectUtil.isEmpty(workstationId)) { return Collections.emptyList(); } WorkstationDatapointsVO dpVo = dpService.getDatapoints(Long.parseLong(workstationId)); if(ObjectUtil.isEmpty(dpVo.getDpConfig())) { return Collections.emptyList(); } JSONArray dpArrJson = JSONArray.parseArray(dpVo.getDpConfig()); String dpName; JSONObject dp; for(int i=0; i<dpArrJson.size();i++) { dp = dpArrJson.getJSONObject(i); WorkstationWcsDmpDTO dto = new WorkstationWcsDmpDTO(); dto.setDescription(dp.getString("dpLabel")); dpName = dp.getString("dpName"); dto.setName(dpName); if("DeviceStatus".equals(dpName)) { dto.setWcsDataType(WcsDataTypeEnums.WcsDataType.STATE.getCode()); }else if("Output".equals(dpName)) { dto.setWcsDataType(WcsDataTypeEnums.WcsDataType.YIELD.getCode()); } dps.add(dto); } return dps; } @Override @@ -221,7 +263,9 @@ } private CollectParamResVO<?> getCollectParamResVO(WorkstationWcsDmpDTO dmpDTO, List<ProcessParameterVO> processParameterList) { if (WcsDataTypeEnums.WcsDataType.STATE.getCode().equals(dmpDTO.getWcsDataType())) { //ç¶æç¹æ®å¤çï¼ //if (WcsDataTypeEnums.WcsDataType.STATE.getCode().equals(dmpDTO.getWcsDataType())) {//yys if (WcsDataTypeEnums.WcsDataType.STATE.getCode().equals(dmpDTO.getWcsDataType())) { Map<String, String> colorMap = Maps.newHashMap(); Map<String, String> nameMap = Maps.newHashMap(); Set<String> codes = Sets.newHashSet(); @@ -240,6 +284,7 @@ .build(); //return CollectParamResVO.builder().collectItem(dmpDTO.getDescription()).collectRealItem(dmpDTO.getName()).data(list).build(); } //空æé List<ParamDTO> collect = processParameterList.stream().map(param -> ParamDTO.builder().time(DateUtil.formatDateTime(DateUtil.fromMilliseconds(param.getRealTime().longValue()))).value(param.getValue()).build()).collect(Collectors.toList()); return CollectParamResVO.<ParamDTO>builder() .collectItem(dmpDTO.getDescription()) @@ -274,10 +319,11 @@ private List<ProcessParameterVO> getProcessParameterList(Date startTime, Date endTime, Long workstationId, WorkstationWcsDmpDTO dmpDTO) { ProcessParameterVO firstStatue = oldFirstStatue(startTime, dmpDTO.getName(), workstationId); ProcessParameterVO endStatue = oldLastStatue(endTime, dmpDTO.getName(), workstationId); List<ProcessParameterVO> processParameterList = oldOneCollectList(startTime, endTime, dmpDTO.getName(), workstationId); if (Func.isNotEmpty(processParameterList)) { if (Func.notNull(firstStatue) && !firstStatue.getRealTime().equals(Long.valueOf(startTime.getTime()))) { firstStatue.setRealTime(Long.valueOf(startTime.getTime())); firstStatue.setRealTime(startTime.getTime()); processParameterList.add(0, firstStatue); } if (Func.notNull(endStatue) && !endStatue.getRealTime().equals(Long.valueOf(endTime.getTime()))) { @@ -533,7 +579,7 @@ private ProcessParameterVO oldFirstStatue(Date startTime, String item, Long workstationId) { //ProcessParameterVO vo = this.parameterMapper.oldFirstStatue(workstationId, item, Long.valueOf(startTime.getTime())); ProcessParameterVO vo = this.getLastParameterLessThanTime(workstationId, item, startTime.getTime()); ProcessParameterVO vo = helperService.queryLastParameterLessThenTime(workstationId, item, startTime.getTime()); if (Func.notNull(vo)) { vo.setCollectItem(item); } @@ -542,7 +588,7 @@ private ProcessParameterVO oldLastStatue(Date endTime, String item, Long workstationId) { //ProcessParameterVO vo = this.parameterMapper.oldLastStatue(workstationId, item, Long.valueOf(endTime.getTime())); ProcessParameterVO vo = this.getLastParameterGreaterThenTime(workstationId, item, Long.valueOf(endTime.getTime())); ProcessParameterVO vo = helperService.getLastParameterGreaterThenTime(workstationId, item, endTime.getTime()); if (Func.notNull(vo)) { vo.setCollectItem(item); } @@ -550,7 +596,9 @@ } private List<ProcessParameterVO> oldOneCollectList(Date startTime, Date endTime, String item, Long workstationId) { return this.parameterMapper.oldOneCollectList(workstationId, item, Long.valueOf(startTime.getTime()), Long.valueOf(endTime.getTime())); List<ProcessParameterVO> list = this.parameterMapper.oldOneCollectList(workstationId, item, startTime.getTime(), endTime.getTime()); list.forEach(p -> {p.setRealTime(p.getTime().getTime());}); return list; } private ProcessParameterResVO entityVO(List<ProcessParameterVO> dtoList, WorkstationWcsDmpDTO wcs, Map<String, WorkstationWcsDmpDTO> collectItemMap) { @@ -696,8 +744,9 @@ * @param time æ¶é´ï¼åæ°åºå°äºè¯¥æ¶é´ * @return */ public ProcessParameterVO getLastParameterLessThanTime(long workstationId,String item,Long time) { //yys /* public ProcessParameterVO getLastParameterLessThanTimeOld_notuse(long workstationId,String item,Long time) { //yys LastProcessParam lp = this.parameterMapper.lastParameterLessThanTime(workstationId,item,time); if(lp == null) { return null; @@ -716,6 +765,36 @@ } return vo; }*/ @DS("iotdb") public ProcessParameterVO queryLastParameterLessThenTime1(long workstationId,String item,Long time) { /** *tdengineå®ç°ï¼oldFirstStatue * select last(ts) as realTime, last(v) as value_collect from iot_data.super_collect_data where n = #{item} and ts < #{startTime} and workstation_id = #{workstationId} */ ProcessParameterVO vo = null; String sql ="select max_time(n) as ts,last_value(n) as n,last_value(v) as v,last_value(workstation_id) as workstationId from root.f2.process_param_"+workstationId+"_"+item+" where time<"+time+" align by device limit 1"; List<ProcessParameterVO> list = jdbcTemplate.query(sql, new RowMapper<ProcessParameterVO>() { @Override public ProcessParameterVO mapRow(ResultSet rs, int rowNum) throws SQLException { ProcessParameterVO p = new ProcessParameterVO(); p.setRealTime(rs.getLong("ts")); p.setValueCollect(rs.getString("v")); return p; } }); if(!list.isEmpty()) { vo = list.get(0); } return vo; } /** @@ -725,8 +804,18 @@ * @param time æå®çæ¶é´ * @return */ public ProcessParameterVO getLastParameterGreaterThenTime(long workstationId,String item,Long time) { //yys @DS("iotdb") public ProcessParameterVO getLastParameterGreaterThenTime1(long workstationId,String item,Long time) { /* oldLastStatue select last(ts) as realTime, last(v) as value_collect from iot_data.super_collect_data where n = #{item} and ts > #{endTime} and workstation_id = #{workstationId} * */ /* LastProcessParam lp = this.parameterMapper.lastParameterGreaterThanTime(workstationId,item,time); if(lp == null) { return null; @@ -744,7 +833,28 @@ vo.setValueCollect(itemObj.getString("value")); } return vo;*/ ProcessParameterVO vo = null; String sql ="select max_time(n) as ts,last_value(n) as n,last_value(v) as v,last_value(workstation_id) as workstationId from root.f2.process_param_"+workstationId+"_"+item+" where time>"+time+" align by device limit 1"; List<ProcessParameterVO> list = jdbcTemplate.query(sql, new RowMapper<ProcessParameterVO>() { @Override public ProcessParameterVO mapRow(ResultSet rs, int rowNum) throws SQLException { ProcessParameterVO p = new ProcessParameterVO(); p.setRealTime(rs.getLong("ts")); p.setValueCollect(rs.getString("v")); return p; } }); if(!list.isEmpty()) { vo = list.get(0); } return vo; } @DS("iotdb") smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/SuperAggregateStateServiceImpl.java
@@ -71,7 +71,6 @@ @Override public List<SuperAggregateState> getStatusDataWithFeedback(List<Long> workstationIds, StatisticalMethodEnum statisticalMethod, LocalDate startDate, LocalDate endDate) { //稼å¨çæ¥è¯¢ List<SuperAggregateState> statusDataList; if (StatisticalMethodEnum.SHIFT.equals(statisticalMethod) || StatisticalMethodEnum.DAY.equals(statisticalMethod) || StatisticalMethodEnum.WEEK.equals(statisticalMethod) || StatisticalMethodEnum.MONTH.equals(statisticalMethod)) { //statusDataList = this.aggregateStateFeedbackMapper.getStatusDataByFactoryDate(workstationIds, LocalDateTimeUtil.format(startDate, "yyyyMMdd"), LocalDateTimeUtil.format(endDate, "yyyyMMdd")); smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperAggregateStateFeedbackMapper.xml
@@ -2,7 +2,7 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.qianwen.smartman.modules.mdc.mapper.SuperAggregateStateFeedbackMapper"> <!-- <sql id="superAggregateStateColumnSql"> ts as startTime, end_time as endTime, @@ -22,7 +22,7 @@ is_plan as isPlan, feedback_id as feedbackId </sql> --> <!-- ä¿®æ¹sqlå¼å§ --> <sql id="aggregateStateColumnSql"> @@ -44,7 +44,7 @@ feedback_id as feedbackId </sql> <!-- ç±äºè¡¨æ°æ®ä¸æ ·ï¼iot_data.super_aggregate_state_with_feedbackï¼ï¼æä»¬ä¹æ²¡æåé¦ï¼æä»¥ææ¶é½æ¥ä¸ä¸ªè¡¨ --> <select id="getStatusData" resultType="com.qianwen.smartman.modules.mdc.entity.SuperAggregateState"> select <include refid="aggregateStateColumnSql"/> smart-man-boot/src/main/resources/com/qianwen/smartman/modules/mdc/mapper/SuperProcessParameterMapper.xml
@@ -154,28 +154,28 @@ <!-- æ ¹æ®oldFirstStatue æ¹é ç--> <!-- <select id="lastParameterLessThanTime" resultType="com.qianwen.smartman.modules.mdc.entity.LastProcessParam"> select workstation_id as workstationId,update_time as updateTime, param_json as paramJson from root.f2.last_process_param where n = #{item} and time < #{startTime} and workstation_id = #{workstationId} </select> </select> --> <!-- æ ¹æ®oldLastStatueæ¹ç --> <!-- <select id="lastParameterGreaterThanTime" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO"> select workstation_id as workstationId,update_time as updateTime, param_json as paramJson from root.f2.last_process_param where n = #{item} and ts > #{endTime} and workstation_id = #{workstationId} </select> </select> --> <select id="oldOneCollectList" resultType="com.qianwen.smartman.modules.mdc.dto.ProcessParameterVO"> select n as collectItem,v as valueCollect from root.f2.process_param_* where n = #{item} and time >= #{startTime} select n as collectItem,v as valueCollect from root.f2.process_param_${workstationId}_${item} where time >= #{startTime} and time <= #{endTime} and workstation_id = #{workstationId} order by time align by device </select>