瀏覽代碼

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

# Conflicts:
#	website/src/main/resources/templates/index.html
5 年之前
父節點
當前提交
28cfcb60ca

+ 0 - 1
.idea/modules.xml

@@ -4,7 +4,6 @@
     <modules>
       <module fileurl="file://$PROJECT_DIR$/cloud-model/cloud-model.iml" filepath="$PROJECT_DIR$/cloud-model/cloud-model.iml" />
       <module fileurl="file://$PROJECT_DIR$/website/website.iml" filepath="$PROJECT_DIR$/website/website.iml" />
-      <module fileurl="file://$PROJECT_DIR$/website/website.iml" filepath="$PROJECT_DIR$/website/website.iml" />
       <module fileurl="file://$PROJECT_DIR$/.idea/yunsu.iml" filepath="$PROJECT_DIR$/.idea/yunsu.iml" />
     </modules>
   </component>

+ 48 - 24
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldHistoryServiceImpl.java

@@ -40,53 +40,77 @@ public class MouldHistoryServiceImpl extends ServiceImpl<MouldHistoryMapper, Mou
         Map<String, List<MouldHistoryVO>> mapList = list.stream().collect(Collectors.groupingBy(MouldHistoryVO::getTime));
         for(Map.Entry<String, List<MouldHistoryVO>> entry:mapList.entrySet()){
             if("00".equals(entry.getKey())){
-                map.put("00:00-01:00",(int)(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("00:00-01:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("01".equals(entry.getKey())){
-                map.put("01:00-02:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("01:00-02:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("02".equals(entry.getKey())){
-                map.put("02:00-03:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("02:00-03:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("03".equals(entry.getKey())){
-                map.put("03:00-04:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("03:00-04:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("04".equals(entry.getKey())){
-                map.put("04:00-05:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("04:00-05:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("05".equals(entry.getKey())){
-                map.put("05:00-06:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("05:00-06:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("06".equals(entry.getKey())){
-                map.put("06:00-07:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("06:00-07:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("07".equals(entry.getKey())){
-                map.put("07:00-08:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("07:00-08:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("08".equals(entry.getKey())){
-                map.put("08:00-09:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("08:00-09:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("09".equals(entry.getKey())){
-                map.put("09:00-10:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("09:00-10:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("10".equals(entry.getKey())){
-                map.put("10:00-11:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("10:00-11:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("11".equals(entry.getKey())){
-                map.put("11:00-12:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("11:00-12:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("12".equals(entry.getKey())){
-                map.put("12:00-13:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("12:00-13:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("13".equals(entry.getKey())){
-                map.put("13:00-14:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("13:00-14:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("14".equals(entry.getKey())){
-                map.put("14:00-15:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("14:00-15:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("15".equals(entry.getKey())){
-                map.put("15:00-16:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("15:00-16:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("16".equals(entry.getKey())){
-                map.put("16:00-17:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("16:00-17:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("17".equals(entry.getKey())){
-                map.put("17:00-18:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("17:00-18:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("18".equals(entry.getKey())){
-                map.put("18:00-19:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("18:00-19:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("19".equals(entry.getKey())){
-                map.put("19:00-20:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("19:00-20:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("20".equals(entry.getKey())){
-                map.put("20:00-21:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("20:00-21:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("21".equals(entry.getKey())){
-                map.put("21:00-22:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("21:00-22:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("22".equals(entry.getKey())){
-                map.put("22:00-23:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("22:00-23:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }else if("23".equals(entry.getKey())){
-                map.put("23:00-24:00",(int)entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).average().getAsDouble());
+                map.put("23:00-24:00",entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).max().getAsInt()
+                                - entry.getValue().stream().mapToInt(MouldHistoryVO::getRunCnt).min().getAsInt());
             }
         }
         System.out.println("原来的map===>"+map);

+ 1 - 1
cloud-socket/src/com/js/kbt/UserTempGenConfig.xml

@@ -11,7 +11,7 @@
     <javaModelGenerator targetPackage="com.js.kbt.model" targetProject="cloud-socket" />
     <sqlMapGenerator targetPackage="com.js.kbt.mapper" targetProject="cloud-socket" />
     <javaClientGenerator targetPackage="com.js.kbt.mapper" targetProject="cloud-socket" type="XMLMAPPER" />
-    <table schema="cloud_model" tableName="time_calibration_record" >
+    <table schema="cloud_model" tableName="mould_cycle_runtime" >
     	<generatedKey column="id" identity="true" sqlStatement="SELECT LAST_INSERT_ID()"/>
     </table>
 <!--     <table schema="cloud_model" tableName="tb_mould_equipment" > -->

+ 96 - 0
cloud-socket/src/com/js/kbt/mapper/MouldCycleRuntimeMapper.java

@@ -0,0 +1,96 @@
+package com.js.kbt.mapper;
+
+import com.js.kbt.model.MouldCycleRuntime;
+import com.js.kbt.model.MouldCycleRuntimeExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface MouldCycleRuntimeMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    long countByExample(MouldCycleRuntimeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    int deleteByExample(MouldCycleRuntimeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    int insert(MouldCycleRuntime record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    int insertSelective(MouldCycleRuntime record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    List<MouldCycleRuntime> selectByExample(MouldCycleRuntimeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    MouldCycleRuntime selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    int updateByExampleSelective(@Param("record") MouldCycleRuntime record, @Param("example") MouldCycleRuntimeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    int updateByExample(@Param("record") MouldCycleRuntime record, @Param("example") MouldCycleRuntimeExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    int updateByPrimaryKeySelective(MouldCycleRuntime record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    int updateByPrimaryKey(MouldCycleRuntime record);
+}

+ 286 - 0
cloud-socket/src/com/js/kbt/mapper/MouldCycleRuntimeMapper.xml

@@ -0,0 +1,286 @@
+<?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.js.kbt.mapper.MouldCycleRuntimeMapper">
+  <resultMap id="BaseResultMap" type="com.js.kbt.model.MouldCycleRuntime">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="runtime" jdbcType="INTEGER" property="runtime" />
+    <result column="time_slot" jdbcType="VARCHAR" property="timeSlot" />
+    <result column="date_str" jdbcType="VARCHAR" property="dateStr" />
+    <result column="equipment_no" jdbcType="VARCHAR" property="equipmentNo" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    id, runtime, time_slot, date_str, equipment_no
+  </sql>
+  <select id="selectByExample" parameterType="com.js.kbt.model.MouldCycleRuntimeExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from mould_cycle_runtime
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from mould_cycle_runtime
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    delete from mould_cycle_runtime
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.js.kbt.model.MouldCycleRuntimeExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    delete from mould_cycle_runtime
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.js.kbt.model.MouldCycleRuntime">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into mould_cycle_runtime (runtime, time_slot, date_str, 
+      equipment_no)
+    values (#{runtime,jdbcType=INTEGER}, #{timeSlot,jdbcType=VARCHAR}, #{dateStr,jdbcType=VARCHAR}, 
+      #{equipmentNo,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.js.kbt.model.MouldCycleRuntime">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into mould_cycle_runtime
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="runtime != null">
+        runtime,
+      </if>
+      <if test="timeSlot != null">
+        time_slot,
+      </if>
+      <if test="dateStr != null">
+        date_str,
+      </if>
+      <if test="equipmentNo != null">
+        equipment_no,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="runtime != null">
+        #{runtime,jdbcType=INTEGER},
+      </if>
+      <if test="timeSlot != null">
+        #{timeSlot,jdbcType=VARCHAR},
+      </if>
+      <if test="dateStr != null">
+        #{dateStr,jdbcType=VARCHAR},
+      </if>
+      <if test="equipmentNo != null">
+        #{equipmentNo,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.js.kbt.model.MouldCycleRuntimeExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    select count(*) from mould_cycle_runtime
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    update mould_cycle_runtime
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.runtime != null">
+        runtime = #{record.runtime,jdbcType=INTEGER},
+      </if>
+      <if test="record.timeSlot != null">
+        time_slot = #{record.timeSlot,jdbcType=VARCHAR},
+      </if>
+      <if test="record.dateStr != null">
+        date_str = #{record.dateStr,jdbcType=VARCHAR},
+      </if>
+      <if test="record.equipmentNo != null">
+        equipment_no = #{record.equipmentNo,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    update mould_cycle_runtime
+    set id = #{record.id,jdbcType=INTEGER},
+      runtime = #{record.runtime,jdbcType=INTEGER},
+      time_slot = #{record.timeSlot,jdbcType=VARCHAR},
+      date_str = #{record.dateStr,jdbcType=VARCHAR},
+      equipment_no = #{record.equipmentNo,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.js.kbt.model.MouldCycleRuntime">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    update mould_cycle_runtime
+    <set>
+      <if test="runtime != null">
+        runtime = #{runtime,jdbcType=INTEGER},
+      </if>
+      <if test="timeSlot != null">
+        time_slot = #{timeSlot,jdbcType=VARCHAR},
+      </if>
+      <if test="dateStr != null">
+        date_str = #{dateStr,jdbcType=VARCHAR},
+      </if>
+      <if test="equipmentNo != null">
+        equipment_no = #{equipmentNo,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.js.kbt.model.MouldCycleRuntime">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Mon Oct 28 14:23:48 CST 2019.
+    -->
+    update mould_cycle_runtime
+    set runtime = #{runtime,jdbcType=INTEGER},
+      time_slot = #{timeSlot,jdbcType=VARCHAR},
+      date_str = #{dateStr,jdbcType=VARCHAR},
+      equipment_no = #{equipmentNo,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 168 - 0
cloud-socket/src/com/js/kbt/model/MouldCycleRuntime.java

@@ -0,0 +1,168 @@
+package com.js.kbt.model;
+
+public class MouldCycleRuntime {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_cycle_runtime.id
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_cycle_runtime.runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    private Integer runtime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_cycle_runtime.time_slot
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    private String timeSlot;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_cycle_runtime.date_str
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    private String dateStr;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_cycle_runtime.equipment_no
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    private String equipmentNo;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_cycle_runtime.id
+     *
+     * @return the value of mould_cycle_runtime.id
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_cycle_runtime.id
+     *
+     * @param id the value for mould_cycle_runtime.id
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_cycle_runtime.runtime
+     *
+     * @return the value of mould_cycle_runtime.runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public Integer getRuntime() {
+        return runtime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_cycle_runtime.runtime
+     *
+     * @param runtime the value for mould_cycle_runtime.runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public void setRuntime(Integer runtime) {
+        this.runtime = runtime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_cycle_runtime.time_slot
+     *
+     * @return the value of mould_cycle_runtime.time_slot
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public String getTimeSlot() {
+        return timeSlot;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_cycle_runtime.time_slot
+     *
+     * @param timeSlot the value for mould_cycle_runtime.time_slot
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public void setTimeSlot(String timeSlot) {
+        this.timeSlot = timeSlot;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_cycle_runtime.date_str
+     *
+     * @return the value of mould_cycle_runtime.date_str
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public String getDateStr() {
+        return dateStr;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_cycle_runtime.date_str
+     *
+     * @param dateStr the value for mould_cycle_runtime.date_str
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public void setDateStr(String dateStr) {
+        this.dateStr = dateStr;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_cycle_runtime.equipment_no
+     *
+     * @return the value of mould_cycle_runtime.equipment_no
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public String getEquipmentNo() {
+        return equipmentNo;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_cycle_runtime.equipment_no
+     *
+     * @param equipmentNo the value for mould_cycle_runtime.equipment_no
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public void setEquipmentNo(String equipmentNo) {
+        this.equipmentNo = equipmentNo;
+    }
+}

+ 632 - 0
cloud-socket/src/com/js/kbt/model/MouldCycleRuntimeExample.java

@@ -0,0 +1,632 @@
+package com.js.kbt.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MouldCycleRuntimeExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public MouldCycleRuntimeExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Integer value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Integer value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Integer value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Integer value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Integer> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Integer> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Integer value1, Integer value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeIsNull() {
+            addCriterion("runtime is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeIsNotNull() {
+            addCriterion("runtime is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeEqualTo(Integer value) {
+            addCriterion("runtime =", value, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeNotEqualTo(Integer value) {
+            addCriterion("runtime <>", value, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeGreaterThan(Integer value) {
+            addCriterion("runtime >", value, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("runtime >=", value, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeLessThan(Integer value) {
+            addCriterion("runtime <", value, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeLessThanOrEqualTo(Integer value) {
+            addCriterion("runtime <=", value, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeIn(List<Integer> values) {
+            addCriterion("runtime in", values, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeNotIn(List<Integer> values) {
+            addCriterion("runtime not in", values, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeBetween(Integer value1, Integer value2) {
+            addCriterion("runtime between", value1, value2, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andRuntimeNotBetween(Integer value1, Integer value2) {
+            addCriterion("runtime not between", value1, value2, "runtime");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotIsNull() {
+            addCriterion("time_slot is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotIsNotNull() {
+            addCriterion("time_slot is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotEqualTo(String value) {
+            addCriterion("time_slot =", value, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotNotEqualTo(String value) {
+            addCriterion("time_slot <>", value, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotGreaterThan(String value) {
+            addCriterion("time_slot >", value, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotGreaterThanOrEqualTo(String value) {
+            addCriterion("time_slot >=", value, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotLessThan(String value) {
+            addCriterion("time_slot <", value, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotLessThanOrEqualTo(String value) {
+            addCriterion("time_slot <=", value, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotLike(String value) {
+            addCriterion("time_slot like", value, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotNotLike(String value) {
+            addCriterion("time_slot not like", value, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotIn(List<String> values) {
+            addCriterion("time_slot in", values, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotNotIn(List<String> values) {
+            addCriterion("time_slot not in", values, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotBetween(String value1, String value2) {
+            addCriterion("time_slot between", value1, value2, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeSlotNotBetween(String value1, String value2) {
+            addCriterion("time_slot not between", value1, value2, "timeSlot");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrIsNull() {
+            addCriterion("date_str is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrIsNotNull() {
+            addCriterion("date_str is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrEqualTo(String value) {
+            addCriterion("date_str =", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotEqualTo(String value) {
+            addCriterion("date_str <>", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrGreaterThan(String value) {
+            addCriterion("date_str >", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrGreaterThanOrEqualTo(String value) {
+            addCriterion("date_str >=", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrLessThan(String value) {
+            addCriterion("date_str <", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrLessThanOrEqualTo(String value) {
+            addCriterion("date_str <=", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrLike(String value) {
+            addCriterion("date_str like", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotLike(String value) {
+            addCriterion("date_str not like", value, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrIn(List<String> values) {
+            addCriterion("date_str in", values, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotIn(List<String> values) {
+            addCriterion("date_str not in", values, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrBetween(String value1, String value2) {
+            addCriterion("date_str between", value1, value2, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andDateStrNotBetween(String value1, String value2) {
+            addCriterion("date_str not between", value1, value2, "dateStr");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoIsNull() {
+            addCriterion("equipment_no is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoIsNotNull() {
+            addCriterion("equipment_no is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoEqualTo(String value) {
+            addCriterion("equipment_no =", value, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoNotEqualTo(String value) {
+            addCriterion("equipment_no <>", value, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoGreaterThan(String value) {
+            addCriterion("equipment_no >", value, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoGreaterThanOrEqualTo(String value) {
+            addCriterion("equipment_no >=", value, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoLessThan(String value) {
+            addCriterion("equipment_no <", value, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoLessThanOrEqualTo(String value) {
+            addCriterion("equipment_no <=", value, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoLike(String value) {
+            addCriterion("equipment_no like", value, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoNotLike(String value) {
+            addCriterion("equipment_no not like", value, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoIn(List<String> values) {
+            addCriterion("equipment_no in", values, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoNotIn(List<String> values) {
+            addCriterion("equipment_no not in", values, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoBetween(String value1, String value2) {
+            addCriterion("equipment_no between", value1, value2, "equipmentNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andEquipmentNoNotBetween(String value1, String value2) {
+            addCriterion("equipment_no not between", value1, value2, "equipmentNo");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated do_not_delete_during_merge Mon Oct 28 14:23:48 CST 2019
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table mould_cycle_runtime
+     *
+     * @mbg.generated Mon Oct 28 14:23:48 CST 2019
+     */
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 121 - 29
cloud-socket/src/com/js/kbt/socket/UserHandler.java

@@ -11,6 +11,7 @@ import javax.annotation.Resource;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Service;
 import com.alibaba.fastjson.JSONObject;
+import com.js.kbt.mapper.MouldCycleRuntimeMapper;
 import com.js.kbt.mapper.MouldDownPacketMapper;
 import com.js.kbt.mapper.MouldHistoryMapper;
 import com.js.kbt.mapper.MouldHistoryTimeMapper;
@@ -19,6 +20,8 @@ import com.js.kbt.mapper.TbFactoryMapper;
 import com.js.kbt.mapper.TbMouldEquipmentMapper;
 import com.js.kbt.mapper.TbMouldMapper;
 import com.js.kbt.mapper.TimeCalibrationRecordMapper;
+import com.js.kbt.model.MouldCycleRuntime;
+import com.js.kbt.model.MouldCycleRuntimeExample;
 import com.js.kbt.model.MouldDownPacket;
 import com.js.kbt.model.MouldDownPacketExample;
 import com.js.kbt.model.MouldHistory;
@@ -30,6 +33,8 @@ import com.js.kbt.model.TbMouldEquipment;
 import com.js.kbt.model.TbMouldEquipmentExample;
 import com.js.kbt.model.TbMouldExample;
 import com.js.kbt.model.TimeCalibrationRecord;
+import com.sun.mail.dsn.message_deliverystatus;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import io.netty.channel.ChannelHandlerContext;
@@ -60,9 +65,11 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 	private MouldDownPacketMapper mouldDownPacketMapper;
 	@Resource
 	private TimeCalibrationRecordMapper timeCalibrationRecordMapper;
+	@Resource
+	private MouldCycleRuntimeMapper mouldCycleRuntimeMapper;
 
 	@Override
-	protected void channelRead0(ChannelHandlerContext arg0, String arg1) {
+	protected void channelRead0(ChannelHandlerContext arg0, String arg1) throws ParseException {
 		String pack = "FAAF0007001e781e50003C37D5";
 		// 校准时间
 		timeCalibration();
@@ -72,7 +79,7 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		// sendPackage(equipmentNo);
 	}
 
-	private String processMsg(String input) {
+	private String processMsg(String input) throws ParseException {
 		String ret = "FA AF 00 07 02 1e 78 1e 50 00 3C";
 		ret.replaceAll(" ", "");
 		logger.info("=====接收到======" + input);
@@ -188,6 +195,8 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 					time.setTimeCost((int)(openTime.getTime() - aHeadOpenTimeLongVal));
 				}
 				mouldHistoryTimeMapper.insertSelective(time);
+				//处理周期逻辑
+				handleMouldCycleRuntimeLogic(openTime,item);
 				logger.info("mouldHistoryTime数据添加完毕");
 				aHeadOpenTimeLongVal = openTime.getTime();
 				logger.info("上一包数据的开合时间戳--"+aHeadOpenTimeLongVal);
@@ -387,6 +396,85 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		return parseDate;
 	}
 	
+	private void handleMouldCycleRuntimeLogic(Date openTime,MouldHistory item) throws ParseException{
+		MouldCycleRuntime mcr = new MouldCycleRuntime();
+		Integer hours = openTime.getHours();
+		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+		SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:");
+		int housTime = openTime.getHours()-1;
+		openTime.setHours(housTime);
+		String lastOpenTime = sdf.format(openTime);
+		Date lastOpenTimeDate = sdf1.parse(lastOpenTime+"59:59");
+		MouldHistoryTimeExample mExp = new MouldHistoryTimeExample();
+		mExp.setOrderByClause("open_time desc limit 1");
+		mExp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo()).andOpenTimeLessThanOrEqualTo(lastOpenTimeDate);
+		List<MouldHistoryTime> list = mouldHistoryTimeMapper.selectByExample(mExp);
+		if(list.size()>0){
+			MouldHistory mouldHistory = mouldHistoryMapper.selectByPrimaryKey(list.get(0).getHistoryId());
+			mcr.setDateStr(sdf.format(openTime));
+			mcr.setEquipmentNo(item.getEquipmentNo());
+			mcr.setRuntime(item.getRunCnt() - mouldHistory.getRunCnt());
+			if(hours==0){
+				mcr.setTimeSlot("00:00-01:00");
+			}else if(hours==1){
+				mcr.setTimeSlot("01:00-02:00");
+			}else if(hours==2){
+				mcr.setTimeSlot("02:00-03:00");
+			}else if(hours==3){
+				mcr.setTimeSlot("03:00-04:00");
+			}else if(hours==4){
+				mcr.setTimeSlot("04:00-05:00");
+			}else if(hours==5){
+				mcr.setTimeSlot("05:00-06:00");
+			}else if(hours==6){
+				mcr.setTimeSlot("06:00-07:00");
+			}else if(hours==7){
+				mcr.setTimeSlot("07:00-08:00");
+			}else if(hours==8){
+				mcr.setTimeSlot("08:00-09:00");
+			}else if(hours==9){
+				mcr.setTimeSlot("09:00-10:00");
+			}else if(hours==10){
+				mcr.setTimeSlot("10:00-11:00");
+			}else if(hours==11){
+				mcr.setTimeSlot("11:00-12:00");
+			}else if(hours==12){
+				mcr.setTimeSlot("12:00-13:00");
+			}else if(hours==13){
+				mcr.setTimeSlot("13:00-14:00");
+			}else if(hours==14){
+				mcr.setTimeSlot("14:00-15:00");
+			}else if(hours==15){
+				mcr.setTimeSlot("15:00-16:00");
+			}else if(hours==16){
+				mcr.setTimeSlot("16:00-17:00");
+			}else if(hours==17){
+				mcr.setTimeSlot("17:00-18:00");
+			}else if(hours==18){
+				mcr.setTimeSlot("18:00-19:00");
+			}else if(hours==19){
+				mcr.setTimeSlot("19:00-20:00");
+			}else if(hours==20){
+				mcr.setTimeSlot("20:00-21:00");
+			}else if(hours==21){
+				mcr.setTimeSlot("21:00-22:00");
+			}else if(hours==22){
+				mcr.setTimeSlot("22:00-23:00");
+			}else if(hours==23){
+				mcr.setTimeSlot("23:00-00:00");
+			}
+			MouldCycleRuntimeExample mcrExp = new MouldCycleRuntimeExample();
+			mcrExp.createCriteria().andDateStrEqualTo(mcr.getDateStr()).andEquipmentNoEqualTo(item.getEquipmentNo()).andTimeSlotEqualTo(mcr.getTimeSlot());
+			List<MouldCycleRuntime> mList = mouldCycleRuntimeMapper.selectByExample(mcrExp);
+			if(mList.size()>0){
+				mcr.setId(mList.get(0).getId());
+				mouldCycleRuntimeMapper.updateByPrimaryKeySelective(mcr);
+			}else{
+				mouldCycleRuntimeMapper.insertSelective(mcr);
+			}
+		}
+	}
+	
 	private static String getStringFromHexStr(String hexStr) {
 		StringBuilder sb = new StringBuilder();
 		for (int i = 0; i < hexStr.length() / 2; i++) {
@@ -522,9 +610,13 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		return sb.toString().trim();
 	}
 
-	public static void main(String[] args) {
-		UserHandler h = new UserHandler();
-		h.timeCalibration();
+	public static void main(String[] args) throws ParseException {
+//		UserHandler h = new UserHandler();
+//		h.timeCalibration();
+		String a = "00:25:32";
+		SimpleDateFormat s = new SimpleDateFormat("HH:mm:ss");
+		Date d = new Date();
+//		System.out.println(s.parse(a).getHours());
 		// Date date = new Date();
 		// SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd,HH:mm:ss");
 		// String dateStr = sdf.format(date);
@@ -548,29 +640,29 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		// System.out.println(str.substring(69*2));
 		// Date d = parseDate(str, start, 0, 0);
 		// System.out.println(d.toGMTString());
-		int start = 69;
-		int end = input.length() - 4; // 最后2位 0xXX,0xXX ,是CRC校验位
-		logger.info("时间信息==" + input.substring(start * 2, end));
-		if (end - start * 2 >= 24) {// 时间最少6位,1位显示0x00,开合算两个时间,所以是6*2*2=24
-			// 本次运行周期内的开合模次数
-			int periodCnt = (end - start * 2) / 24;
-			logger.info("本次开合模次数==" + periodCnt);
-			for (int pos = 0; pos < periodCnt; pos++) {
-				// 合模时间
-				MouldHistoryTime time = new MouldHistoryTime();
-				time.setSeq(pos + 1);
-				Date closeTime = parseDate(input, start, pos, 0);
-				System.out.println(closeTime);
-				time.setCloseTime(closeTime);
-				// 开模时间
-				Date openTime = parseDate(input, start, pos, 6);
-				time.setOpenTime(openTime);
-				System.out.println(openTime);
-				int timeCost = (int) (openTime.getTime() - closeTime.getTime());
-				time.setTimeCost(timeCost);
-			}
-		} else {
-			logger.info("本次开合模次数==0");
-		}
+//		int start = 69;
+//		int end = input.length() - 4; // 最后2位 0xXX,0xXX ,是CRC校验位
+//		logger.info("时间信息==" + input.substring(start * 2, end));
+//		if (end - start * 2 >= 24) {// 时间最少6位,1位显示0x00,开合算两个时间,所以是6*2*2=24
+//			// 本次运行周期内的开合模次数
+//			int periodCnt = (end - start * 2) / 24;
+//			logger.info("本次开合模次数==" + periodCnt);
+//			for (int pos = 0; pos < periodCnt; pos++) {
+//				// 合模时间
+//				MouldHistoryTime time = new MouldHistoryTime();
+//				time.setSeq(pos + 1);
+//				Date closeTime = parseDate(input, start, pos, 0);
+//				System.out.println(closeTime);
+//				time.setCloseTime(closeTime);
+//				// 开模时间
+//				Date openTime = parseDate(input, start, pos, 6);
+//				time.setOpenTime(openTime);
+//				System.out.println(openTime);
+//				int timeCost = (int) (openTime.getTime() - closeTime.getTime());
+//				time.setTimeCost(timeCost);
+//			}
+//		} else {
+//			logger.info("本次开合模次数==0");
+//		}
 	}
 }