Explorar el Código

完善产线对比功能

wukai hace 3 meses
padre
commit
0f3455c2f7

+ 5 - 3
jjt-admin/src/test/java/com/jjt/dye/DyeTest.java

@@ -8,6 +8,7 @@ import com.jjt.dyeing.service.IDyeingHourLineService;
 import com.jjt.utils.IotService;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.ActiveProfiles;
 
 import javax.annotation.Resource;
 import java.time.LocalDate;
@@ -21,6 +22,7 @@ import java.time.LocalTime;
  * @date 2025/10/19 03:38
  */
 @SpringBootTest(classes = JjtApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("devp")
 public class DyeTest {
     @Resource
     private IotService iotService;
@@ -28,8 +30,8 @@ public class DyeTest {
     private IDyeCalcHourService calcHourService;
     @Resource
     private IDyeHourLineService hourLineService;
-    String st = "2025-11-07";
-    String ed = "2025-11-07";
+    String st = "2025-11-04";
+    String ed = "2025-11-09";
     LocalDate localDate = LocalDate.parse(st);
     LocalDate endDate = LocalDate.parse(ed);
     LocalDateTime start = LocalDateTime.of(localDate, LocalTime.MIN).plusHours(0);
@@ -53,7 +55,7 @@ public class DyeTest {
 
     @Test
     public void line() {
-        iotService.setToken();
+//        iotService.setToken();
 //        calcHourService.calc(start.toLocalDate(), 18);
         LocalDateTime end = LocalDateTime.of(endDate.plusDays(1), LocalTime.MIN).plusHours(23);
         LocalDateTime curr = LocalDateTime.now();

+ 9 - 0
jjt-biz/src/main/java/com/jjt/calc/service/ITwinCalcHourYhjService.java

@@ -2,6 +2,7 @@ package com.jjt.calc.service;
 
 import com.jjt.calc.domain.TwinCalcHourYhj;
 
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.List;
 
@@ -98,4 +99,12 @@ public interface ITwinCalcHourYhjService {
      */
     void calc2Curr();
 
+    /**
+     * 按指定时间查询
+     *
+     * @param date 指定日期
+     * @param hour 指定时间
+     * @return 结果
+     */
+    List<TwinCalcHourYhj> selectByTime(LocalDate date, int hour);
 }

+ 15 - 0
jjt-biz/src/main/java/com/jjt/calc/service/impl/TwinCalcHourYhjServiceImpl.java

@@ -277,6 +277,21 @@ public class TwinCalcHourYhjServiceImpl implements ITwinCalcHourYhjService {
     }
 
     /**
+     * 按指定时间查询
+     *
+     * @param date 指定日期
+     * @param hour 指定时间
+     * @return 结果
+     */
+    @Override
+    public List<TwinCalcHourYhj> selectByTime(LocalDate date, int hour) {
+        TwinCalcHourYhj yhj = new TwinCalcHourYhj();
+        yhj.setDataDate(DateUtils.toDate(date));
+        yhj.setHour(hour);
+        return selectTwinCalcHourYhjList(yhj);
+    }
+
+    /**
      * 按时间和小时删除数据
      *
      * @param date 时间

+ 4 - 1
jjt-biz/src/main/java/com/jjt/dye/domain/DyeCalcHour.java

@@ -37,7 +37,10 @@ public class DyeCalcHour extends BaseEntity {
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date dataDate;
-
+    
+    @ApiModelProperty("工作天")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date workDay;
     /**
      * 小时
      */

+ 88 - 26
jjt-biz/src/main/java/com/jjt/dye/domain/DyeHourLine.java

@@ -1,16 +1,15 @@
 package com.jjt.dye.domain;
 
-import java.math.BigDecimal;
-import java.util.Date;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.jjt.common.annotation.Excel;
+import com.jjt.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import com.jjt.common.annotation.Excel;
-import com.jjt.common.core.domain.BaseEntity;
+
+import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * 产线小时统计数据对象 DYE_HOUR_LINE
@@ -20,84 +19,147 @@ import com.jjt.common.core.domain.BaseEntity;
  */
 @ApiModel(value = "DyeHourLine", description = "产线小时统计数据")
 @Data
-public class DyeHourLine extends BaseEntity{
+public class DyeHourLine extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 产线小时统计ID */
+    /**
+     * 产线小时统计ID
+     */
     @ApiModelProperty("产线小时统计ID")
     @TableId
     private Long hourLineId;
 
-    /** 日期 */
+    /**
+     * 日期
+     */
     @ApiModelProperty("日期")
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "日期", width = 30, dateFormat = "yyyy-MM-dd")
     private Date dataDate;
 
-    /** 小时 */
+    @ApiModelProperty("工作天")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date workDay;
+    /**
+     * 小时
+     */
     @ApiModelProperty("小时")
     @Excel(name = "小时")
     private Integer hour;
 
-    /** 产线编号 */
+    /**
+     * 产线编号
+     */
     @ApiModelProperty("产线编号")
     @Excel(name = "产线编号")
     private String line;
 
-    /** 稼动率 */
+    /**
+     * 稼动率
+     */
     @ApiModelProperty("稼动率")
     @Excel(name = "稼动率")
     private BigDecimal uptime;
 
-    /** 产量 */
+    /**
+     * 产量
+     */
     @ApiModelProperty("产量")
     @Excel(name = "产量")
     private BigDecimal length;
 
-    /** 产量分钟级数据 */
+    /**
+     * 产量分钟级数据
+     */
     @ApiModelProperty("产量分钟级数据")
     private String lengthM;
 
-    /** 速度 */
+    /**
+     * 速度
+     */
     @ApiModelProperty("速度")
     @Excel(name = "速度")
     private BigDecimal speed;
 
-    /** 速度分钟级数据 */
+    /**
+     * 速度分钟级数据
+     */
     @ApiModelProperty("速度分钟级数据")
     private String speedM;
 
-    /** 电量 */
+    /**
+     * 电量
+     */
     @ApiModelProperty("电量")
     @Excel(name = "电量")
     private BigDecimal energy;
 
-    /** 电量分钟级数据 */
+    /**
+     * 电量分钟级数据
+     */
     @ApiModelProperty("电量分钟级数据")
     private String energyM;
 
-    /** 电流 */
+    /**
+     * 电流
+     */
     @ApiModelProperty("电流")
     @Excel(name = "电流")
     private BigDecimal amp;
 
-    /** 电流分钟级数据 */
+    /**
+     * 电流分钟级数据
+     */
     @ApiModelProperty("电流分钟级数据")
     private String ampM;
-
-    /** 创建人 */
+    /**
+     * 定型平均温度
+     */
+    @ApiModelProperty("定型平均温度")
+    @Excel(name = "定型平均温度")
+    private BigDecimal tmpDx;
+
+    /**
+     * 定型温度分钟级数据
+     */
+    @ApiModelProperty("定型温度分钟级数据")
+    @Excel(name = "定型温度分钟级数据")
+    private String tmpDxM;
+
+    /**
+     * 烫光平均温度
+     */
+    @ApiModelProperty("烫光平均温度")
+    @Excel(name = "烫光平均温度")
+    private BigDecimal tmpTg;
+
+    /**
+     * 烫光温度分钟级数据
+     */
+    @ApiModelProperty("烫光温度分钟级数据")
+    @Excel(name = "烫光温度分钟级数据")
+    private String tmpTgM;
+    /**
+     * 创建人
+     */
     @ApiModelProperty("创建人")
     private String createdBy;
 
-    /** 创建时间 */
+    /**
+     * 创建时间
+     */
     @ApiModelProperty("创建时间")
     private Date createdTime;
 
-    /** 更新人 */
+    /**
+     * 更新人
+     */
     @ApiModelProperty("更新人")
     private String updatedBy;
 
-    /** 更新时间 */
+    /**
+     * 更新时间
+     */
     @ApiModelProperty("更新时间")
     private Date updatedTime;
 

+ 104 - 55
jjt-biz/src/main/java/com/jjt/dye/service/impl/DyeHourLineServiceImpl.java

@@ -3,6 +3,8 @@ package com.jjt.dye.service.impl;
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
+import com.jjt.calc.domain.TwinCalcHourYhj;
+import com.jjt.calc.service.ITwinCalcHourYhjService;
 import com.jjt.common.utils.DateUtils;
 import com.jjt.dye.domain.DyeCalcHour;
 import com.jjt.dye.domain.DyeDevice;
@@ -38,6 +40,8 @@ public class DyeHourLineServiceImpl implements IDyeHourLineService {
     private IDyeCalcHourService calcHourService;
     @Resource
     private IDyeDeviceService deviceService;
+    @Resource
+    private ITwinCalcHourYhjService yhjService;
 
     /**
      * 查询产线小时统计数据
@@ -130,90 +134,134 @@ public class DyeHourLineServiceImpl implements IDyeHourLineService {
         dyeHourLineMapper.deleteByHour(DateUtils.toDate(date), hour);
         //1.先查询小时统计数据
         List<DyeCalcHour> calcHours = calcHourService.selectByTime(date, hour);
+        List<TwinCalcHourYhj> yhjList = yhjService.selectByTime(date, hour);
+        Map<Integer, Integer> yhjLengthMap = yhjList.stream()
+                .collect(Collectors.groupingBy(TwinCalcHourYhj::getDeviceId,
+                        Collectors.summingInt(yhj -> yhj.getLength())));
         for (DyeCalcHour calcHour : calcHours) {
             DyeDevice device = deviceMap.get(calcHour.getDeviceId());
             calcHour.setCreatedBy(device.getLine());
+            switch (calcHour.getParaCode()) {
+                case "P_u9m9n9v1o900":
+                case "P_osu9096knpc0":
+                case "P_ocgfbdif79k0":
+                case "P_rj0t7h4eqpo0":
+                    calcHour.setParaCode("P_dx_tmp");
+                    break;
+                case "P_ubk8dkl0p1o0":
+                case "P_n4hg31666hs0":
+                    calcHour.setParaCode("P_tg_tmp");
+                    break;
+            }
         }
         //按生产线分组统计
         Map<String, List<DyeCalcHour>> lineMap = calcHours.stream()
                 .collect(Collectors.groupingBy(DyeCalcHour::getCreatedBy));
 
-        for (Map.Entry<String, List<DyeCalcHour>> entry : lineMap.entrySet()) {
-            String line = entry.getKey();
-            List<DyeCalcHour> lineCalcHours = entry.getValue();
-            
-            // 计算能耗总和
-            BigDecimal engEnergy = calculateParameterValue(lineCalcHours, "ENG_energy", BigDecimal::add);
-            String combinedEnergyMValue = combineParaMValues(lineCalcHours, "ENG_energy");
-            
-            // 计算电流平均值
-            BigDecimal engAmpA = calculateParameterValue(lineCalcHours, "ENG_amp_a", BigDecimal::add);
-            String avgAmpAMValue = averageParaMValues(lineCalcHours, "ENG_amp_a");
-            BigDecimal avgEngAmpA = lineCalcHours.isEmpty() ? BigDecimal.ZERO : 
-                engAmpA.divide(BigDecimal.valueOf(lineCalcHours.size()), 2, RoundingMode.HALF_UP);
-            
-            // 获取速度值和对应的分钟级数据
-            BigDecimal speed = lineCalcHours.stream()
-                    .filter(item -> item.getParaCode().equals("P_tt051hr93980"))
-                    .findFirst()
-                    .map(DyeCalcHour::getParaValue)
-                    .orElse(BigDecimal.ZERO);
-            
-            String speedMValue = lineCalcHours.stream()
-                    .filter(item -> item.getParaCode().equals("P_tt051hr93980") && item.getParaMValue() != null)
-                    .findFirst()
-                    .map(DyeCalcHour::getParaMValue)
-                    .orElse(null);
-
+        for (int line = 1; line <= 8; line++) {
+            Integer length = yhjLengthMap.getOrDefault(line, 0);
             // 创建产线小时统计数据对象
             DyeHourLine dyeHourLine = new DyeHourLine();
-            dyeHourLine.setLine(line);
+            dyeHourLine.setLine(line + "");
             dyeHourLine.setDataDate(DateUtils.toDate(date));
             dyeHourLine.setHour(hour);
-            dyeHourLine.setSpeed(speed);
-            dyeHourLine.setEnergy(engEnergy);
-            dyeHourLine.setEnergyM(combinedEnergyMValue);
-            dyeHourLine.setAmpM(avgAmpAMValue);
-            dyeHourLine.setSpeedM(speedMValue);
-            dyeHourLine.setAmp(avgEngAmpA);
+            dyeHourLine.setLength(BigDecimal.valueOf(length));
+            List<DyeCalcHour> lineCalcHours = lineMap.get(line + "");
+            if (lineCalcHours!=null&&!lineCalcHours.isEmpty()) {
+                // 计算能耗总和
+                BigDecimal engEnergy = calculateParameterValue(lineCalcHours, "ENG_energy", BigDecimal::add);
+                String combinedEnergyMValue = combineParaMValues(lineCalcHours, "ENG_energy");
+
+                // 计算电流平均值
+                List<DyeCalcHour> engAmpAList = lineCalcHours.stream()
+                        .filter(item -> item.getParaCode().equals("ENG_amp_a"))
+                        .collect(Collectors.toList());
+                BigDecimal engAmpA = calculateParameterValue(lineCalcHours, "ENG_amp_a", BigDecimal::add);
+                String avgAmpAMValue = averageParaMValues(lineCalcHours, "ENG_amp_a");
+                BigDecimal avgEngAmpA = engAmpAList.isEmpty() ? BigDecimal.ZERO :
+                        engAmpA.divide(BigDecimal.valueOf(engAmpAList.size()), 2, RoundingMode.HALF_UP);
+
+                // 计算定型机平均温度
+                List<DyeCalcHour> dxTmpList = lineCalcHours.stream()
+                        .filter(item -> item.getParaCode().equals("P_dx_tmp"))
+                        .collect(Collectors.toList());
+                BigDecimal dxTmp = calculateParameterValue(lineCalcHours, "P_dx_tmp", BigDecimal::add);
+                String dxTmpMValue = averageParaMValues(lineCalcHours, "P_dx_tmp");
+                BigDecimal avgDxTmp = dxTmpList.isEmpty() ? BigDecimal.ZERO :
+                        dxTmp.divide(BigDecimal.valueOf(dxTmpList.size()), 2, RoundingMode.HALF_UP);
+
+                // 计算烫光平均温度
+                List<DyeCalcHour> tgTmpList = lineCalcHours.stream()
+                        .filter(item -> item.getParaCode().equals("P_tg_tmp"))
+                        .collect(Collectors.toList());
+                BigDecimal tgTmp = calculateParameterValue(lineCalcHours, "P_tg_tmp", BigDecimal::add);
+                String tgTmpMValue = averageParaMValues(lineCalcHours, "P_tg_tmp");
+                BigDecimal avgTgTmp = tgTmpList.isEmpty() ? BigDecimal.ZERO :
+                        tgTmp.divide(BigDecimal.valueOf(tgTmpList.size()), 2, RoundingMode.HALF_UP);
+                // 获取速度值和对应的分钟级数据
+                BigDecimal speed = lineCalcHours.stream()
+                        .filter(item -> item.getParaCode().equals("P_tt051hr93980"))
+                        .findFirst()
+                        .map(DyeCalcHour::getParaValue)
+                        .orElse(BigDecimal.ZERO);
+
+                String speedMValue = lineCalcHours.stream()
+                        .filter(item -> item.getParaCode().equals("P_tt051hr93980") && item.getParaMValue() != null)
+                        .findFirst()
+                        .map(DyeCalcHour::getParaMValue)
+                        .orElse(null);
+
+                dyeHourLine.setEnergy(engEnergy);
+                dyeHourLine.setEnergyM(combinedEnergyMValue);
+                dyeHourLine.setAmp(avgEngAmpA);
+                dyeHourLine.setAmpM(avgAmpAMValue);
+                dyeHourLine.setSpeed(speed);
+                dyeHourLine.setSpeedM(speedMValue);
+                dyeHourLine.setTmpDx(avgDxTmp);
+                dyeHourLine.setTmpDxM(dxTmpMValue);
+                dyeHourLine.setTmpTg(avgTgTmp);
+                dyeHourLine.setTmpTgM(tgTmpMValue);
+            }
             // 保存产线小时统计数据
             dyeHourLineMapper.insertDyeHourLine(dyeHourLine);
         }
     }
-    
+
     /**
      * 计算指定参数的值
+     *
      * @param lineCalcHours 数据列表
-     * @param paraCode 参数代码
-     * @param operator 计算操作符
+     * @param paraCode      参数代码
+     * @param operator      计算操作符
      * @return 计算结果
      */
-    private BigDecimal calculateParameterValue(List<DyeCalcHour> lineCalcHours, String paraCode, 
-                                              BinaryOperator<BigDecimal> operator) {
+    private BigDecimal calculateParameterValue(List<DyeCalcHour> lineCalcHours, String paraCode,
+                                               BinaryOperator<BigDecimal> operator) {
         return lineCalcHours.stream()
                 .filter(item -> item.getParaCode().equals(paraCode))
                 .map(DyeCalcHour::getParaValue)
                 .reduce(BigDecimal.ZERO, operator);
     }
-    
+
     /**
      * 合并多个paraMValue字段中的JSON数据,保持原有格式
+     *
      * @param lineCalcHours 数据列表
-     * @param paraCode 参数代码
+     * @param paraCode      参数代码
      * @return 合并后的JSON字符串
      */
     private String combineParaMValues(List<DyeCalcHour> lineCalcHours, String paraCode) {
         List<DyeCalcHour> items = lineCalcHours.stream()
                 .filter(item -> item.getParaCode().equals(paraCode) && item.getParaMValue() != null)
                 .collect(Collectors.toList());
-        
+
         if (items.isEmpty()) {
             return null;
         }
-        
+
         // 创建一个Map来存储time-value对,key为time,value为value的累加值
         Map<String, BigDecimal> combinedValues = new java.util.HashMap<>();
-        
+
         // 遍历所有items中的paraMValue
         for (DyeCalcHour item : items) {
             try {
@@ -222,7 +270,7 @@ public class DyeHourLineServiceImpl implements IDyeHourLineService {
                     JSONObject dataObj = dataArray.getJSONObject(i);
                     String time = dataObj.getStr("time");
                     BigDecimal value = dataObj.getBigDecimal("value", BigDecimal.ZERO);
-                    
+
                     // 累加相同time的value
                     combinedValues.merge(time, value, BigDecimal::add);
                 }
@@ -231,7 +279,7 @@ public class DyeHourLineServiceImpl implements IDyeHourLineService {
                 continue;
             }
         }
-        
+
 
         // 构建合并后的JSONArray,按数字顺序排序
         JSONArray combinedArray = new JSONArray();
@@ -253,30 +301,31 @@ public class DyeHourLineServiceImpl implements IDyeHourLineService {
                     dataObj.set("value", entry.getValue());
                     combinedArray.add(dataObj);
                 });
-        
+
         return combinedArray.toString();
     }
-    
+
     /**
      * 对多个paraMValue字段中的JSON数据计算平均值,保持原有格式
+     *
      * @param lineCalcHours 数据列表
-     * @param paraCode 参数代码
+     * @param paraCode      参数代码
      * @return 平均值后的JSON字符串
      */
     private String averageParaMValues(List<DyeCalcHour> lineCalcHours, String paraCode) {
         List<DyeCalcHour> items = lineCalcHours.stream()
                 .filter(item -> item.getParaCode().equals(paraCode) && item.getParaMValue() != null)
                 .collect(Collectors.toList());
-        
+
         if (items.isEmpty()) {
             return null;
         }
-        
+
         // 创建一个Map来存储time-value对,key为time,value为value的累加值
         Map<String, BigDecimal> combinedValues = new java.util.HashMap<>();
         // 创建一个Map来存储time出现的次数,用于计算平均值
         Map<String, Integer> timeCounts = new java.util.HashMap<>();
-        
+
         // 遍历所有items中的paraMValue
         for (DyeCalcHour item : items) {
             try {
@@ -285,7 +334,7 @@ public class DyeHourLineServiceImpl implements IDyeHourLineService {
                     JSONObject dataObj = dataArray.getJSONObject(i);
                     String time = dataObj.getStr("time");
                     BigDecimal value = dataObj.getBigDecimal("value", BigDecimal.ZERO);
-                    
+
                     // 累加相同time的value
                     combinedValues.merge(time, value, BigDecimal::add);
                     // 记录time出现的次数
@@ -296,7 +345,7 @@ public class DyeHourLineServiceImpl implements IDyeHourLineService {
                 continue;
             }
         }
-        
+
         // 构建平均值后的JSONArray,按数字顺序排序
         JSONArray averagedArray = new JSONArray();
         combinedValues.entrySet().stream()
@@ -315,7 +364,7 @@ public class DyeHourLineServiceImpl implements IDyeHourLineService {
                     String time = entry.getKey();
                     BigDecimal sum = entry.getValue();
                     int count = timeCounts.getOrDefault(time, 1);
-                    
+
                     JSONObject dataObj = new JSONObject();
                     dataObj.set("time", time);
                     // 计算平均值

+ 11 - 3
jjt-biz/src/main/resources/mapper/calc/TwinCalcHourYhjMapper.xml

@@ -16,7 +16,14 @@
     </resultMap>
 
     <sql id="selectTwinCalcHourYhjVo">
-        select ID, DATA_DATE, HOUR, DEVICE_ID, LENGTH, WEIGHT,DISTANCE, REMARK
+        select ID,
+               DATA_DATE,
+               HOUR,
+               DEVICE_ID,
+               LENGTH,
+               WEIGHT,
+               DISTANCE,
+               REMARK
         from TWIN_CALC_HOUR_YHJ
     </sql>
 
@@ -26,6 +33,7 @@
             <if test="params.beginDataDate != null and params.beginDataDate != '' and params.endDataDate != null and params.endDataDate != ''">
                 and DATA_DATE between #{params.beginDataDate} and #{params.endDataDate}
             </if>
+            <if test="dataDate != null ">and DATA_DATE = #{dataDate}</if>
             <if test="hour != null ">and HOUR = #{hour}</if>
             <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
             <if test="length != null ">and LENGTH = #{length}</if>
@@ -36,7 +44,7 @@
                 and DATEADD(hour, HOUR, DATA_DATE) between #{params.sTime} and #{params.eTime}
             </if>
         </where>
-        order by id desc
+        order by data_date desc, hour desc
     </select>
 
     <select id="selectTwinCalcHourYhjById" parameterType="Long" resultMap="TwinCalcHourYhjResult">
@@ -46,7 +54,7 @@
     <select id="lastRecord" resultType="com.jjt.calc.domain.TwinCalcHourYhj">
         select top 1 *
         from TWIN_CALC_HOUR_YHJ
-        order by id desc
+        order by data_date desc, hour desc
     </select>
 
     <insert id="insertTwinCalcHourYhj" parameterType="TwinCalcHourYhj">

+ 2 - 0
jjt-biz/src/main/resources/mapper/dye/DyeCalcHourMapper.xml

@@ -7,6 +7,7 @@
     <resultMap type="DyeCalcHour" id="DyeCalcHourResult">
         <result property="chId" column="CH_ID"/>
         <result property="dataDate" column="DATA_DATE"/>
+        <result property="workDay"    column="WORK_DAY"    />
         <result property="hour" column="HOUR"/>
         <result property="deviceId" column="DEVICE_ID"/>
         <result property="paraCode" column="PARA_CODE"/>
@@ -32,6 +33,7 @@
         <include refid="selectDyeCalcHourVo"/>
         <where>
             <if test="dataDate != null ">and DATA_DATE = #{dataDate}</if>
+            <if test="workDay != null ">and WORK_DAY = #{workDay}</if>
             <if test="hour != null ">and HOUR = #{hour}</if>
             <if test="deviceId != null ">and DEVICE_ID = #{deviceId}</if>
             <if test="deviceName != null  and deviceName != ''">and device_name like concat('%', #{deviceName}, '%')

+ 37 - 37
jjt-biz/src/main/resources/mapper/dye/DyeHourLineMapper.xml

@@ -5,52 +5,40 @@
 <mapper namespace="com.jjt.dye.mapper.DyeHourLineMapper">
 
     <resultMap type="DyeHourLine" id="DyeHourLineResult">
-        <result property="hourLineId" column="HOUR_LINE_ID"/>
-        <result property="dataDate" column="DATA_DATE"/>
-        <result property="hour" column="HOUR"/>
-        <result property="line" column="LINE"/>
-        <result property="uptime" column="UPTIME"/>
-        <result property="length" column="LENGTH"/>
-        <result property="lengthM" column="LENGTH_M"/>
-        <result property="speed" column="SPEED"/>
-        <result property="speedM" column="SPEED_M"/>
-        <result property="energy" column="ENERGY"/>
-        <result property="energyM" column="ENERGY_M"/>
-        <result property="amp" column="AMP"/>
-        <result property="ampM" column="AMP_M"/>
-        <result property="createdBy" column="CREATED_BY"/>
-        <result property="createdTime" column="CREATED_TIME"/>
-        <result property="updatedBy" column="UPDATED_BY"/>
-        <result property="updatedTime" column="UPDATED_TIME"/>
-        <result property="remark" column="REMARK"/>
+        <result property="hourLineId"    column="HOUR_LINE_ID"    />
+        <result property="dataDate"    column="DATA_DATE"    />
+        <result property="workDay"    column="WORK_DAY"    />
+        <result property="hour"    column="HOUR"    />
+        <result property="line"    column="LINE"    />
+        <result property="uptime"    column="UPTIME"    />
+        <result property="length"    column="LENGTH"    />
+        <result property="lengthM"    column="LENGTH_M"    />
+        <result property="speed"    column="SPEED"    />
+        <result property="speedM"    column="SPEED_M"    />
+        <result property="energy"    column="ENERGY"    />
+        <result property="energyM"    column="ENERGY_M"    />
+        <result property="amp"    column="AMP"    />
+        <result property="ampM"    column="AMP_M"    />
+        <result property="tmpDx"    column="TMP_DX"    />
+        <result property="tmpDxM"    column="TMP_DX_M"    />
+        <result property="tmpTg"    column="TMP_TG"    />
+        <result property="tmpTgM"    column="TMP_TG_M"    />
+        <result property="createdBy"    column="CREATED_BY"    />
+        <result property="createdTime"    column="CREATED_TIME"    />
+        <result property="updatedBy"    column="UPDATED_BY"    />
+        <result property="updatedTime"    column="UPDATED_TIME"    />
+        <result property="remark"    column="REMARK"    />
     </resultMap>
 
     <sql id="selectDyeHourLineVo">
-        select HOUR_LINE_ID,
-               DATA_DATE,
-               HOUR,
-               LINE,
-               UPTIME,
-               LENGTH,
-               LENGTH_M,
-               SPEED,
-               SPEED_M,
-               ENERGY,
-               ENERGY_M,
-               AMP,
-               AMP_M,
-               CREATED_BY,
-               CREATED_TIME,
-               UPDATED_BY,
-               UPDATED_TIME,
-               REMARK
-        from DYE_HOUR_LINE
+        select HOUR_LINE_ID, DATA_DATE, HOUR, LINE, UPTIME, LENGTH, LENGTH_M, SPEED, SPEED_M, ENERGY, ENERGY_M, AMP, AMP_M, TMP_DX, TMP_DX_M, TMP_TG, TMP_TG_M, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, REMARK from DYE_HOUR_LINE
     </sql>
 
     <select id="selectDyeHourLineList" parameterType="DyeHourLine" resultMap="DyeHourLineResult">
         <include refid="selectDyeHourLineVo"/>
         <where>
             <if test="dataDate != null ">and DATA_DATE = #{dataDate}</if>
+            <if test="workDay != null ">and WORK_DAY = #{workDay}</if>
             <if test="hour != null ">and HOUR = #{hour}</if>
             <if test="line != null  and line != ''">and LINE = #{line}</if>
             <if test="length != null ">and LENGTH = #{length}</if>
@@ -77,6 +65,10 @@
             <if test="energyM != null">ENERGY_M,</if>
             <if test="amp != null">AMP,</if>
             <if test="ampM != null">AMP_M,</if>
+            <if test="tmpDx != null">TMP_DX,</if>
+            <if test="tmpDxM != null">TMP_DX_M,</if>
+            <if test="tmpTg != null">TMP_TG,</if>
+            <if test="tmpTgM != null">TMP_TG_M,</if>
             <if test="createdBy != null">CREATED_BY,</if>
             <if test="createdTime != null">CREATED_TIME,</if>
             <if test="updatedBy != null">UPDATED_BY,</if>
@@ -96,6 +88,10 @@
             <if test="energyM != null">#{energyM},</if>
             <if test="amp != null">#{amp},</if>
             <if test="ampM != null">#{ampM},</if>
+            <if test="tmpDx != null">#{tmpDx},</if>
+            <if test="tmpDxM != null">#{tmpDxM},</if>
+            <if test="tmpTg != null">#{tmpTg},</if>
+            <if test="tmpTgM != null">#{tmpTgM},</if>
             <if test="createdBy != null">#{createdBy},</if>
             <if test="createdTime != null">#{createdTime},</if>
             <if test="updatedBy != null">#{updatedBy},</if>
@@ -119,6 +115,10 @@
             <if test="energyM != null">ENERGY_M = #{energyM},</if>
             <if test="amp != null">AMP = #{amp},</if>
             <if test="ampM != null">AMP_M = #{ampM},</if>
+            <if test="tmpDx != null">TMP_DX = #{tmpDx},</if>
+            <if test="tmpDxM != null">TMP_DX_M = #{tmpDxM},</if>
+            <if test="tmpTg != null">TMP_TG = #{tmpTg},</if>
+            <if test="tmpTgM != null">TMP_TG_M = #{tmpTgM},</if>
             <if test="createdBy != null">CREATED_BY = #{createdBy},</if>
             <if test="createdTime != null">CREATED_TIME = #{createdTime},</if>
             <if test="updatedBy != null">UPDATED_BY = #{updatedBy},</if>