Browse Source

下行数据包接口

5 years ago
parent
commit
6ad53207b2

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

@@ -6,12 +6,12 @@
   <context id="context1" targetRuntime="MyBatis3">
   
     <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://118.190.47.230:3306/cloud_model"
-     userId="root" password="p011430seya10" >
+     userId="root" password="p011430seya1026" >
     </jdbcConnection>
     <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="mould_history_time" >
+    <table schema="cloud_model" tableName="mould_hoding" >
     	<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/MouldHodingMapper.java

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

+ 349 - 0
cloud-socket/src/com/js/kbt/mapper/MouldHodingMapper.xml

@@ -0,0 +1,349 @@
+<?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.MouldHodingMapper">
+  <resultMap id="BaseResultMap" type="com.js.kbt.model.MouldHoding">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 08 17:17:36 CST 2019.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="enable" jdbcType="INTEGER" property="enable" />
+    <result column="uploadcycle_work" jdbcType="INTEGER" property="uploadcycleWork" />
+    <result column="uploadcycle_free" jdbcType="INTEGER" property="uploadcycleFree" />
+    <result column="lowpowerlimit" jdbcType="VARCHAR" property="lowpowerlimit" />
+    <result column="hotalarmlimit" jdbcType="INTEGER" property="hotalarmlimit" />
+    <result column="retain" jdbcType="INTEGER" property="retain" />
+    <result column="time_count" jdbcType="INTEGER" property="timeCount" />
+    <result column="indate" jdbcType="TIMESTAMP" property="indate" />
+  </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 Tue Oct 08 17:17:36 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 Tue Oct 08 17:17:36 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 Tue Oct 08 17:17:36 CST 2019.
+    -->
+    id, enable, uploadcycle_work, uploadcycle_free, lowpowerlimit, hotalarmlimit, retain, 
+    time_count, indate
+  </sql>
+  <select id="selectByExample" parameterType="com.js.kbt.model.MouldHodingExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 08 17:17:36 CST 2019.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from mould_hoding
+    <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 Tue Oct 08 17:17:36 CST 2019.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from mould_hoding
+    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 Tue Oct 08 17:17:36 CST 2019.
+    -->
+    delete from mould_hoding
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.js.kbt.model.MouldHodingExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 08 17:17:36 CST 2019.
+    -->
+    delete from mould_hoding
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.js.kbt.model.MouldHoding">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 08 17:17:36 CST 2019.
+    -->
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into mould_hoding (enable, uploadcycle_work, uploadcycle_free, 
+      lowpowerlimit, hotalarmlimit, retain, 
+      time_count, indate)
+    values (#{enable,jdbcType=INTEGER}, #{uploadcycleWork,jdbcType=INTEGER}, #{uploadcycleFree,jdbcType=INTEGER}, 
+      #{lowpowerlimit,jdbcType=VARCHAR}, #{hotalarmlimit,jdbcType=INTEGER}, #{retain,jdbcType=INTEGER}, 
+      #{timeCount,jdbcType=INTEGER}, #{indate,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.js.kbt.model.MouldHoding">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 08 17:17:36 CST 2019.
+    -->
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into mould_hoding
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="enable != null">
+        enable,
+      </if>
+      <if test="uploadcycleWork != null">
+        uploadcycle_work,
+      </if>
+      <if test="uploadcycleFree != null">
+        uploadcycle_free,
+      </if>
+      <if test="lowpowerlimit != null">
+        lowpowerlimit,
+      </if>
+      <if test="hotalarmlimit != null">
+        hotalarmlimit,
+      </if>
+      <if test="retain != null">
+        retain,
+      </if>
+      <if test="timeCount != null">
+        time_count,
+      </if>
+      <if test="indate != null">
+        indate,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="enable != null">
+        #{enable,jdbcType=INTEGER},
+      </if>
+      <if test="uploadcycleWork != null">
+        #{uploadcycleWork,jdbcType=INTEGER},
+      </if>
+      <if test="uploadcycleFree != null">
+        #{uploadcycleFree,jdbcType=INTEGER},
+      </if>
+      <if test="lowpowerlimit != null">
+        #{lowpowerlimit,jdbcType=VARCHAR},
+      </if>
+      <if test="hotalarmlimit != null">
+        #{hotalarmlimit,jdbcType=INTEGER},
+      </if>
+      <if test="retain != null">
+        #{retain,jdbcType=INTEGER},
+      </if>
+      <if test="timeCount != null">
+        #{timeCount,jdbcType=INTEGER},
+      </if>
+      <if test="indate != null">
+        #{indate,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.js.kbt.model.MouldHodingExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 08 17:17:36 CST 2019.
+    -->
+    select count(*) from mould_hoding
+    <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 Tue Oct 08 17:17:36 CST 2019.
+    -->
+    update mould_hoding
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.enable != null">
+        enable = #{record.enable,jdbcType=INTEGER},
+      </if>
+      <if test="record.uploadcycleWork != null">
+        uploadcycle_work = #{record.uploadcycleWork,jdbcType=INTEGER},
+      </if>
+      <if test="record.uploadcycleFree != null">
+        uploadcycle_free = #{record.uploadcycleFree,jdbcType=INTEGER},
+      </if>
+      <if test="record.lowpowerlimit != null">
+        lowpowerlimit = #{record.lowpowerlimit,jdbcType=VARCHAR},
+      </if>
+      <if test="record.hotalarmlimit != null">
+        hotalarmlimit = #{record.hotalarmlimit,jdbcType=INTEGER},
+      </if>
+      <if test="record.retain != null">
+        retain = #{record.retain,jdbcType=INTEGER},
+      </if>
+      <if test="record.timeCount != null">
+        time_count = #{record.timeCount,jdbcType=INTEGER},
+      </if>
+      <if test="record.indate != null">
+        indate = #{record.indate,jdbcType=TIMESTAMP},
+      </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 Tue Oct 08 17:17:36 CST 2019.
+    -->
+    update mould_hoding
+    set id = #{record.id,jdbcType=INTEGER},
+      enable = #{record.enable,jdbcType=INTEGER},
+      uploadcycle_work = #{record.uploadcycleWork,jdbcType=INTEGER},
+      uploadcycle_free = #{record.uploadcycleFree,jdbcType=INTEGER},
+      lowpowerlimit = #{record.lowpowerlimit,jdbcType=VARCHAR},
+      hotalarmlimit = #{record.hotalarmlimit,jdbcType=INTEGER},
+      retain = #{record.retain,jdbcType=INTEGER},
+      time_count = #{record.timeCount,jdbcType=INTEGER},
+      indate = #{record.indate,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.js.kbt.model.MouldHoding">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 08 17:17:36 CST 2019.
+    -->
+    update mould_hoding
+    <set>
+      <if test="enable != null">
+        enable = #{enable,jdbcType=INTEGER},
+      </if>
+      <if test="uploadcycleWork != null">
+        uploadcycle_work = #{uploadcycleWork,jdbcType=INTEGER},
+      </if>
+      <if test="uploadcycleFree != null">
+        uploadcycle_free = #{uploadcycleFree,jdbcType=INTEGER},
+      </if>
+      <if test="lowpowerlimit != null">
+        lowpowerlimit = #{lowpowerlimit,jdbcType=VARCHAR},
+      </if>
+      <if test="hotalarmlimit != null">
+        hotalarmlimit = #{hotalarmlimit,jdbcType=INTEGER},
+      </if>
+      <if test="retain != null">
+        retain = #{retain,jdbcType=INTEGER},
+      </if>
+      <if test="timeCount != null">
+        time_count = #{timeCount,jdbcType=INTEGER},
+      </if>
+      <if test="indate != null">
+        indate = #{indate,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.js.kbt.model.MouldHoding">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Oct 08 17:17:36 CST 2019.
+    -->
+    update mould_hoding
+    set enable = #{enable,jdbcType=INTEGER},
+      uploadcycle_work = #{uploadcycleWork,jdbcType=INTEGER},
+      uploadcycle_free = #{uploadcycleFree,jdbcType=INTEGER},
+      lowpowerlimit = #{lowpowerlimit,jdbcType=VARCHAR},
+      hotalarmlimit = #{hotalarmlimit,jdbcType=INTEGER},
+      retain = #{retain,jdbcType=INTEGER},
+      time_count = #{timeCount,jdbcType=INTEGER},
+      indate = #{indate,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 302 - 0
cloud-socket/src/com/js/kbt/model/MouldHoding.java

@@ -0,0 +1,302 @@
+package com.js.kbt.model;
+
+import java.util.Date;
+
+public class MouldHoding {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_hoding.id
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_hoding.enable
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    private Integer enable;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_hoding.uploadcycle_work
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    private Integer uploadcycleWork;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_hoding.uploadcycle_free
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    private Integer uploadcycleFree;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_hoding.lowpowerlimit
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    private String lowpowerlimit;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_hoding.hotalarmlimit
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    private Integer hotalarmlimit;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_hoding.retain
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    private Integer retain;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_hoding.time_count
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    private Integer timeCount;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column mould_hoding.indate
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    private Date indate;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_hoding.id
+     *
+     * @return the value of mould_hoding.id
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_hoding.id
+     *
+     * @param id the value for mould_hoding.id
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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_hoding.enable
+     *
+     * @return the value of mould_hoding.enable
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public Integer getEnable() {
+        return enable;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_hoding.enable
+     *
+     * @param enable the value for mould_hoding.enable
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public void setEnable(Integer enable) {
+        this.enable = enable;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_hoding.uploadcycle_work
+     *
+     * @return the value of mould_hoding.uploadcycle_work
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public Integer getUploadcycleWork() {
+        return uploadcycleWork;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_hoding.uploadcycle_work
+     *
+     * @param uploadcycleWork the value for mould_hoding.uploadcycle_work
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public void setUploadcycleWork(Integer uploadcycleWork) {
+        this.uploadcycleWork = uploadcycleWork;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_hoding.uploadcycle_free
+     *
+     * @return the value of mould_hoding.uploadcycle_free
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public Integer getUploadcycleFree() {
+        return uploadcycleFree;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_hoding.uploadcycle_free
+     *
+     * @param uploadcycleFree the value for mould_hoding.uploadcycle_free
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public void setUploadcycleFree(Integer uploadcycleFree) {
+        this.uploadcycleFree = uploadcycleFree;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_hoding.lowpowerlimit
+     *
+     * @return the value of mould_hoding.lowpowerlimit
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public String getLowpowerlimit() {
+        return lowpowerlimit;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_hoding.lowpowerlimit
+     *
+     * @param lowpowerlimit the value for mould_hoding.lowpowerlimit
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public void setLowpowerlimit(String lowpowerlimit) {
+        this.lowpowerlimit = lowpowerlimit;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_hoding.hotalarmlimit
+     *
+     * @return the value of mould_hoding.hotalarmlimit
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public Integer getHotalarmlimit() {
+        return hotalarmlimit;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_hoding.hotalarmlimit
+     *
+     * @param hotalarmlimit the value for mould_hoding.hotalarmlimit
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public void setHotalarmlimit(Integer hotalarmlimit) {
+        this.hotalarmlimit = hotalarmlimit;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_hoding.retain
+     *
+     * @return the value of mould_hoding.retain
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public Integer getRetain() {
+        return retain;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_hoding.retain
+     *
+     * @param retain the value for mould_hoding.retain
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public void setRetain(Integer retain) {
+        this.retain = retain;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_hoding.time_count
+     *
+     * @return the value of mould_hoding.time_count
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public Integer getTimeCount() {
+        return timeCount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_hoding.time_count
+     *
+     * @param timeCount the value for mould_hoding.time_count
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public void setTimeCount(Integer timeCount) {
+        this.timeCount = timeCount;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column mould_hoding.indate
+     *
+     * @return the value of mould_hoding.indate
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public Date getIndate() {
+        return indate;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column mould_hoding.indate
+     *
+     * @param indate the value for mould_hoding.indate
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public void setIndate(Date indate) {
+        this.indate = indate;
+    }
+}

+ 853 - 0
cloud-socket/src/com/js/kbt/model/MouldHodingExample.java

@@ -0,0 +1,853 @@
+package com.js.kbt.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class MouldHodingExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table mould_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table mould_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table mould_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public MouldHodingExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 CST 2019
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table mould_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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 andEnableIsNull() {
+            addCriterion("enable is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableIsNotNull() {
+            addCriterion("enable is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableEqualTo(Integer value) {
+            addCriterion("enable =", value, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableNotEqualTo(Integer value) {
+            addCriterion("enable <>", value, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableGreaterThan(Integer value) {
+            addCriterion("enable >", value, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableGreaterThanOrEqualTo(Integer value) {
+            addCriterion("enable >=", value, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableLessThan(Integer value) {
+            addCriterion("enable <", value, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableLessThanOrEqualTo(Integer value) {
+            addCriterion("enable <=", value, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableIn(List<Integer> values) {
+            addCriterion("enable in", values, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableNotIn(List<Integer> values) {
+            addCriterion("enable not in", values, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableBetween(Integer value1, Integer value2) {
+            addCriterion("enable between", value1, value2, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andEnableNotBetween(Integer value1, Integer value2) {
+            addCriterion("enable not between", value1, value2, "enable");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkIsNull() {
+            addCriterion("uploadcycle_work is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkIsNotNull() {
+            addCriterion("uploadcycle_work is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkEqualTo(Integer value) {
+            addCriterion("uploadcycle_work =", value, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkNotEqualTo(Integer value) {
+            addCriterion("uploadcycle_work <>", value, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkGreaterThan(Integer value) {
+            addCriterion("uploadcycle_work >", value, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkGreaterThanOrEqualTo(Integer value) {
+            addCriterion("uploadcycle_work >=", value, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkLessThan(Integer value) {
+            addCriterion("uploadcycle_work <", value, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkLessThanOrEqualTo(Integer value) {
+            addCriterion("uploadcycle_work <=", value, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkIn(List<Integer> values) {
+            addCriterion("uploadcycle_work in", values, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkNotIn(List<Integer> values) {
+            addCriterion("uploadcycle_work not in", values, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkBetween(Integer value1, Integer value2) {
+            addCriterion("uploadcycle_work between", value1, value2, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleWorkNotBetween(Integer value1, Integer value2) {
+            addCriterion("uploadcycle_work not between", value1, value2, "uploadcycleWork");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeIsNull() {
+            addCriterion("uploadcycle_free is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeIsNotNull() {
+            addCriterion("uploadcycle_free is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeEqualTo(Integer value) {
+            addCriterion("uploadcycle_free =", value, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeNotEqualTo(Integer value) {
+            addCriterion("uploadcycle_free <>", value, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeGreaterThan(Integer value) {
+            addCriterion("uploadcycle_free >", value, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("uploadcycle_free >=", value, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeLessThan(Integer value) {
+            addCriterion("uploadcycle_free <", value, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeLessThanOrEqualTo(Integer value) {
+            addCriterion("uploadcycle_free <=", value, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeIn(List<Integer> values) {
+            addCriterion("uploadcycle_free in", values, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeNotIn(List<Integer> values) {
+            addCriterion("uploadcycle_free not in", values, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeBetween(Integer value1, Integer value2) {
+            addCriterion("uploadcycle_free between", value1, value2, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andUploadcycleFreeNotBetween(Integer value1, Integer value2) {
+            addCriterion("uploadcycle_free not between", value1, value2, "uploadcycleFree");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitIsNull() {
+            addCriterion("lowpowerlimit is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitIsNotNull() {
+            addCriterion("lowpowerlimit is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitEqualTo(String value) {
+            addCriterion("lowpowerlimit =", value, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitNotEqualTo(String value) {
+            addCriterion("lowpowerlimit <>", value, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitGreaterThan(String value) {
+            addCriterion("lowpowerlimit >", value, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitGreaterThanOrEqualTo(String value) {
+            addCriterion("lowpowerlimit >=", value, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitLessThan(String value) {
+            addCriterion("lowpowerlimit <", value, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitLessThanOrEqualTo(String value) {
+            addCriterion("lowpowerlimit <=", value, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitLike(String value) {
+            addCriterion("lowpowerlimit like", value, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitNotLike(String value) {
+            addCriterion("lowpowerlimit not like", value, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitIn(List<String> values) {
+            addCriterion("lowpowerlimit in", values, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitNotIn(List<String> values) {
+            addCriterion("lowpowerlimit not in", values, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitBetween(String value1, String value2) {
+            addCriterion("lowpowerlimit between", value1, value2, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andLowpowerlimitNotBetween(String value1, String value2) {
+            addCriterion("lowpowerlimit not between", value1, value2, "lowpowerlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitIsNull() {
+            addCriterion("hotalarmlimit is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitIsNotNull() {
+            addCriterion("hotalarmlimit is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitEqualTo(Integer value) {
+            addCriterion("hotalarmlimit =", value, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitNotEqualTo(Integer value) {
+            addCriterion("hotalarmlimit <>", value, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitGreaterThan(Integer value) {
+            addCriterion("hotalarmlimit >", value, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitGreaterThanOrEqualTo(Integer value) {
+            addCriterion("hotalarmlimit >=", value, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitLessThan(Integer value) {
+            addCriterion("hotalarmlimit <", value, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitLessThanOrEqualTo(Integer value) {
+            addCriterion("hotalarmlimit <=", value, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitIn(List<Integer> values) {
+            addCriterion("hotalarmlimit in", values, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitNotIn(List<Integer> values) {
+            addCriterion("hotalarmlimit not in", values, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitBetween(Integer value1, Integer value2) {
+            addCriterion("hotalarmlimit between", value1, value2, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andHotalarmlimitNotBetween(Integer value1, Integer value2) {
+            addCriterion("hotalarmlimit not between", value1, value2, "hotalarmlimit");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainIsNull() {
+            addCriterion("retain is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainIsNotNull() {
+            addCriterion("retain is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainEqualTo(Integer value) {
+            addCriterion("retain =", value, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainNotEqualTo(Integer value) {
+            addCriterion("retain <>", value, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainGreaterThan(Integer value) {
+            addCriterion("retain >", value, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainGreaterThanOrEqualTo(Integer value) {
+            addCriterion("retain >=", value, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainLessThan(Integer value) {
+            addCriterion("retain <", value, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainLessThanOrEqualTo(Integer value) {
+            addCriterion("retain <=", value, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainIn(List<Integer> values) {
+            addCriterion("retain in", values, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainNotIn(List<Integer> values) {
+            addCriterion("retain not in", values, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainBetween(Integer value1, Integer value2) {
+            addCriterion("retain between", value1, value2, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetainNotBetween(Integer value1, Integer value2) {
+            addCriterion("retain not between", value1, value2, "retain");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountIsNull() {
+            addCriterion("time_count is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountIsNotNull() {
+            addCriterion("time_count is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountEqualTo(Integer value) {
+            addCriterion("time_count =", value, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountNotEqualTo(Integer value) {
+            addCriterion("time_count <>", value, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountGreaterThan(Integer value) {
+            addCriterion("time_count >", value, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountGreaterThanOrEqualTo(Integer value) {
+            addCriterion("time_count >=", value, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountLessThan(Integer value) {
+            addCriterion("time_count <", value, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountLessThanOrEqualTo(Integer value) {
+            addCriterion("time_count <=", value, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountIn(List<Integer> values) {
+            addCriterion("time_count in", values, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountNotIn(List<Integer> values) {
+            addCriterion("time_count not in", values, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountBetween(Integer value1, Integer value2) {
+            addCriterion("time_count between", value1, value2, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andTimeCountNotBetween(Integer value1, Integer value2) {
+            addCriterion("time_count not between", value1, value2, "timeCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateIsNull() {
+            addCriterion("indate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateIsNotNull() {
+            addCriterion("indate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateEqualTo(Date value) {
+            addCriterion("indate =", value, "indate");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateNotEqualTo(Date value) {
+            addCriterion("indate <>", value, "indate");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateGreaterThan(Date value) {
+            addCriterion("indate >", value, "indate");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateGreaterThanOrEqualTo(Date value) {
+            addCriterion("indate >=", value, "indate");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateLessThan(Date value) {
+            addCriterion("indate <", value, "indate");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateLessThanOrEqualTo(Date value) {
+            addCriterion("indate <=", value, "indate");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateIn(List<Date> values) {
+            addCriterion("indate in", values, "indate");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateNotIn(List<Date> values) {
+            addCriterion("indate not in", values, "indate");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateBetween(Date value1, Date value2) {
+            addCriterion("indate between", value1, value2, "indate");
+            return (Criteria) this;
+        }
+
+        public Criteria andIndateNotBetween(Date value1, Date value2) {
+            addCriterion("indate not between", value1, value2, "indate");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table mould_hoding
+     *
+     * @mbg.generated do_not_delete_during_merge Tue Oct 08 17:17:36 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_hoding
+     *
+     * @mbg.generated Tue Oct 08 17:17:36 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);
+        }
+    }
+}

+ 377 - 297
cloud-socket/src/com/js/kbt/socket/UserHandler.java

@@ -1,5 +1,5 @@
 package com.js.kbt.socket;
- 
+
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -15,17 +15,20 @@ import com.alibaba.fastjson.JSONObject;
 import com.aliyuncs.http.HttpRequest;
 import com.js.kbt.mapper.MouldHistoryMapper;
 import com.js.kbt.mapper.MouldHistoryTimeMapper;
+import com.js.kbt.mapper.MouldHodingMapper;
 import com.js.kbt.mapper.TbFactoryMapper;
 import com.js.kbt.mapper.TbMouldEquipmentMapper;
 import com.js.kbt.mapper.TbMouldMapper;
 import com.js.kbt.model.MouldHistory;
 import com.js.kbt.model.MouldHistoryTime;
 import com.js.kbt.model.MouldHistoryTimeExample;
+import com.js.kbt.model.MouldHoding;
 import com.js.kbt.model.TbMould;
 import com.js.kbt.model.TbMouldEquipment;
 import com.js.kbt.model.TbMouldEquipmentExample;
 import com.js.kbt.model.TbMouldExample;
 import com.js.kbt.util.MathUtil;
+import com.sun.mail.dsn.message_deliverystatus;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
@@ -33,13 +36,14 @@ import io.netty.channel.ChannelHandlerContext;
 import io.netty.channel.SimpleChannelInboundHandler;
 import io.netty.handler.timeout.IdleState;
 import io.netty.handler.timeout.IdleStateEvent;
+
 @Service("userHandler")
 public class UserHandler extends SimpleChannelInboundHandler<String> {
 
-    private static final Logger logger = Logger.getLogger(UserHandler.class);
-    
+	private static final Logger logger = Logger.getLogger(UserHandler.class);
+
 	private ChannelHandlerContext ctx;
-	
+
 	@Resource
 	private MouldHistoryMapper mouldHistoryMapper;
 	@Resource
@@ -50,206 +54,285 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 	private TbMouldEquipmentMapper tbMouldEquipmentMapper;
 	@Resource
 	private TbFactoryMapper tbFactoryMapper;
-	
-    @Override
-    protected void channelRead0(ChannelHandlerContext arg0, String arg1)
-            {
-        System.out.println("收到==="+arg1+"\n");
-        String ret = processMsg(arg1);
-//        sendMsg(ret);
-    }
-    
-    private String processMsg(String input) {
-    	String ret = "FA AF 00 07 02 1e 78 1e 50 00 3C";
-    	logger.info("=====接收到======"+input);
-    	if (!input.startsWith("FAAF")) {
-    		logger.info("非云模盒消息,不处理");
-    		return ret;
-    	}
-    	MouldHistory item = new MouldHistory();
-    	
-    	//抽取手机号码
-    	String mobilePart = input.substring(4*2, 15*2);
-    	System.out.println("原始mobile="+mobilePart);
-    	String mobile = getStringFromHexStr(mobilePart);
-    	System.out.println("手机号码为"+mobile);
-    	item.setSim(mobile);
-    	//获取设备编码15-24
-    	String deviceNumPart = input.substring(15*2, 25*2);
-    	String deviceNum = getStringFromHexStr(deviceNumPart);
-    	System.out.println("设备No="+deviceNum);
-    	item.setEquipmentNo(deviceNum);
-    	//软件版本号25
-    	String version = input.substring(25*2, 26*2);
-    	System.out.println("软件版本号="+version);
-    	item.setVersion(version);
-    	String status = input.substring(26*2, 27*2);
-    	System.out.println("工作状态="+status);
-    	item.setStatus(Integer.decode("0x"+status).toString());
-    	//经度27-37
-    	String longitude = getStringFromHexStr(input.substring(27*2, 38*2));
-    	System.out.println("经度="+longitude);
-    	item.setLng(longitude);
-    	//38-47纬度以 N 开头
-    	String latitude = getStringFromHexStr(input.substring(38*2, 48*2));
-    	System.out.println("纬度="+latitude);
-    	item.setLat(latitude);
-    	System.out.println("==lac"+reverseParseHex(input.substring(48*2, 50*2)));
-    	System.out.println("==ci"+reverseParseHex(input.substring(50*2, 52*2)));
-    	item.setGprsLac(""+reverseParseHex(input.substring(48*2, 50*2)));
-    	item.setGprsCi(""+reverseParseHex(input.substring(50*2, 52*2)));
-    	item.setWifiBbsid(input.substring(52*2, 58*2));
-    	String temp = "0x"+input.substring(58*2, 59*2);
-    	System.out.println(temp);
-    	int i = Integer.decode(temp);
-    	System.out.println(i);
-    	item.setTemperature(i);
-    	item.setBattery(Integer.decode("0x"+input.substring(59*2, 60*2)));
-    	item.setSig2g(Integer.decode("0x"+input.substring(60*2, 61*2)));
-    	item.setSigNb(Integer.decode("0x"+input.substring(61*2, 62*2)));
-    	item.setSigWifi(Integer.decode("0x"+input.substring(62*2, 63*2)));
-    	item.setExt0(""+Integer.decode("0x"+input.substring(63*2, 64*2)));
-    	item.setAlarm(Integer.decode("0x"+input.substring(64*2, 65*2)));
-    	String str = input.substring(65*2, 69*2);
-    	item.setRunCnt(reverseParseHex(str));
-    	
-    	//根据基站lac和ci获取经纬度
-    	String api = "http://api.cellocation.com:81/cell/?mcc=460&mnc=0&lac="+item.getGprsLac()+"&ci="+item.getGprsCi()+"&output=json";
-    	String resp = com.js.kbt.util.HttpRequest.sendGet(api, null);
-    	JSONObject json = JSONObject.parseObject(resp);
-    	if (json.getInteger("errcode") == 0) {
-    		item.setLng(json.getDouble("lon") + "");
-    		item.setLat(json.getDouble("lat") + "");
-    	} else {
-    		logger.error("调用基站解析平台出错: " + resp);
-    	}
-    	String crcStr = input.substring(input.length() - 4);
-    	item.setCrcCode(""+reverseParseHex(crcStr));
-    	//存入数据库
-    	mouldHistoryMapper.insertSelective(item);
-    	//模具开合记录
-    	int cnt = item.getRunCnt();
-    	int start = 69;
-    	logger.info("累计开合模次数="+cnt);
-    	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.setHistoryId(item.getId());
-        		time.setEquipmentNo(item.getEquipmentNo());
-        		time.setSeq(pos + 1);
-        		Date closeTime = parseDate(input, start, pos, 0);
-        		time.setCloseTime(closeTime);
-        		//开模时间
-        		Date openTime = parseDate(input, start, pos, 6);
-        		time.setOpenTime(openTime);
-        		int timeCost = (int) (openTime.getTime() - closeTime.getTime());
-        		time.setTimeCost(timeCost);
-        		mouldHistoryTimeMapper.insertSelective(time);
-        	}
-    	} else {
-    		logger.info("本次开合模次数==0");
-    	}
-    	//统计该模盒的平均开合周期
-    	MouldHistoryTimeExample exp = new MouldHistoryTimeExample();
-    	exp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo());
-    	List<MouldHistoryTime> list = mouldHistoryTimeMapper.selectByExample(exp);
-    	int avgTime = 0;
-    	int totalTime = 0;
-    	for (MouldHistoryTime t : list) {
-    		totalTime += t.getTimeCost();
-    	}
-    	if (list.size() == 0) {
-    		avgTime = 0;
-    	} else {
-    		avgTime = totalTime / list.size();
-    	}
-    	
-    	handleModLogic(item, avgTime);
-    	return ret;
-    }
-    
-    private void handleModLogic(MouldHistory item, int avgTime) {
-    	TbMouldEquipmentExample meqExp = new TbMouldEquipmentExample();
-    	meqExp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo());
-    	if (tbMouldEquipmentMapper.countByExample(meqExp) > 0) {
-    		TbMouldEquipment me = tbMouldEquipmentMapper.selectByExample(meqExp).get(0);
-    		me.setHillNumber(item.getBattery()+"%");
-    		if (item.getLng() != null) {
-    			me.setLng(Double.parseDouble(item.getLng()));
-    			me.setLat(Double.parseDouble(item.getLat()));
-    		}
-			
+	@Resource
+	private MouldHodingMapper mouldHodingMapper;
+
+	@Override
+	protected void channelRead0(ChannelHandlerContext arg0, String arg1) {
+		System.out.println("收到===" + arg1 + "\n");
+		String ret = processMsg(arg1);
+		//以下是配置下行数据
+//		ret = downProcessMsg(arg1);
+		// sendMsg(ret);
+	}
+
+	private String processMsg(String input) {
+		String ret = "FA AF 00 07 02 1e 78 1e 50 00 3C";
+		logger.info("=====接收到======" + input);
+		if (!input.startsWith("FAAF")) {
+			logger.info("非云模盒消息,不处理");
+			return ret;
+		}
+		MouldHistory item = new MouldHistory();
+
+		// 抽取手机号码
+		String mobilePart = input.substring(4 * 2, 15 * 2);
+		System.out.println("原始mobile=" + mobilePart);
+		String mobile = getStringFromHexStr(mobilePart);
+		System.out.println("手机号码为" + mobile);
+		item.setSim(mobile);
+		// 获取设备编码15-24
+		String deviceNumPart = input.substring(15 * 2, 25 * 2);
+		String deviceNum = getStringFromHexStr(deviceNumPart);
+		System.out.println("设备No=" + deviceNum);
+		item.setEquipmentNo(deviceNum);
+		// 软件版本号25
+		String version = input.substring(25 * 2, 26 * 2);
+		System.out.println("软件版本号=" + version);
+		item.setVersion(version);
+		String status = input.substring(26 * 2, 27 * 2);
+		System.out.println("工作状态=" + status);
+		item.setStatus(Integer.decode("0x" + status).toString());
+		// 经度27-37
+		String longitude = getStringFromHexStr(input.substring(27 * 2, 38 * 2));
+		System.out.println("经度=" + longitude);
+		item.setLng(longitude);
+		// 38-47纬度以 N 开头
+		String latitude = getStringFromHexStr(input.substring(38 * 2, 48 * 2));
+		System.out.println("纬度=" + latitude);
+		item.setLat(latitude);
+		System.out.println("==lac" + reverseParseHex(input.substring(48 * 2, 50 * 2)));
+		System.out.println("==ci" + reverseParseHex(input.substring(50 * 2, 52 * 2)));
+		item.setGprsLac("" + reverseParseHex(input.substring(48 * 2, 50 * 2)));
+		item.setGprsCi("" + reverseParseHex(input.substring(50 * 2, 52 * 2)));
+		item.setWifiBbsid(input.substring(52 * 2, 58 * 2));
+		String temp = "0x" + input.substring(58 * 2, 59 * 2);
+		System.out.println(temp);
+		int i = Integer.decode(temp);
+		System.out.println(i);
+		item.setTemperature(i);
+		item.setBattery(Integer.decode("0x" + input.substring(59 * 2, 60 * 2)));
+		item.setSig2g(Integer.decode("0x" + input.substring(60 * 2, 61 * 2)));
+		item.setSigNb(Integer.decode("0x" + input.substring(61 * 2, 62 * 2)));
+		item.setSigWifi(Integer.decode("0x" + input.substring(62 * 2, 63 * 2)));
+		item.setExt0("" + Integer.decode("0x" + input.substring(63 * 2, 64 * 2)));
+		item.setAlarm(Integer.decode("0x" + input.substring(64 * 2, 65 * 2)));
+		String str = input.substring(65 * 2, 69 * 2);
+		item.setRunCnt(reverseParseHex(str));
+
+		// 根据基站lac和ci获取经纬度
+		String api = "http://api.cellocation.com:81/cell/?mcc=460&mnc=0&lac=" + item.getGprsLac() + "&ci="
+				+ item.getGprsCi() + "&output=json";
+		String resp = com.js.kbt.util.HttpRequest.sendGet(api, null);
+		JSONObject json = JSONObject.parseObject(resp);
+		if (json.getInteger("errcode") == 0) {
+			item.setLng(json.getDouble("lon") + "");
+			item.setLat(json.getDouble("lat") + "");
+		} else {
+			logger.error("调用基站解析平台出错: " + resp);
+		}
+		String crcStr = input.substring(input.length() - 4);
+		item.setCrcCode("" + reverseParseHex(crcStr));
+		// 存入数据库
+		mouldHistoryMapper.insertSelective(item);
+		// 模具开合记录
+		int cnt = item.getRunCnt();
+		int start = 69;
+		logger.info("累计开合模次数=" + cnt);
+		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.setHistoryId(item.getId());
+				time.setEquipmentNo(item.getEquipmentNo());
+				time.setSeq(pos + 1);
+				Date closeTime = parseDate(input, start, pos, 0);
+				time.setCloseTime(closeTime);
+				// 开模时间
+				Date openTime = parseDate(input, start, pos, 6);
+				time.setOpenTime(openTime);
+				int timeCost = (int) (openTime.getTime() - closeTime.getTime());
+				time.setTimeCost(timeCost);
+				mouldHistoryTimeMapper.insertSelective(time);
+			}
+		} else {
+			logger.info("本次开合模次数==0");
+		}
+		// 统计该模盒的平均开合周期
+		MouldHistoryTimeExample exp = new MouldHistoryTimeExample();
+		exp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo());
+		List<MouldHistoryTime> list = mouldHistoryTimeMapper.selectByExample(exp);
+		int avgTime = 0;
+		int totalTime = 0;
+		for (MouldHistoryTime t : list) {
+			totalTime += t.getTimeCost();
+		}
+		if (list.size() == 0) {
+			avgTime = 0;
+		} else {
+			avgTime = totalTime / list.size();
+		}
+
+		handleModLogic(item, avgTime);
+		return ret;
+	}
+
+	// 下行配置数据包
+	private String downProcessMsg(String input) {
+
+		String ret = "FA AF 00 07 02 1e 78 1e 50 00 3C";
+		logger.info("=====接收到======" + input);
+		if (!input.startsWith("FAAF")) {
+			logger.info("非云模盒消息,不处理");
+			return ret;
+		}
+		MouldHoding hoding = new MouldHoding();
+		
+		/**
+		 每次发送的下行数据均为 13 字节,若起始寄存器地址为 0x02,
+		则寄存器 0、寄存器 1 这两个寄存器的值不被模块读取;
+		但是服务器仍然需要发送一个任意值占位,否则数据会混乱;
+		*/
+		
+		// 抽取模块工作允许值 工作允许:0-停止 1-开始 2-清除开合总次数并开始 3-关机
+		String enablePart = input.substring(4 * 2, 5 * 2);
+		if(enablePart.equals("23")){
+			enablePart="24";
+		}
+		System.out.println("模块工作允许值=" + enablePart);
+		String enable = getStringFromHexStr(enablePart);
+		System.out.println("模块工作允许值" + enable);
+		hoding.setEnable(Integer.decode(enable));
+		// 工作忙状态上报周期:单位(分钟)
+		String uploadCycleWorkPart = input.substring(5 * 2, 6 * 2);
+		if(uploadCycleWorkPart.equals("23")){
+			uploadCycleWorkPart="24";
+		}
+		System.out.println("工作忙状态上报周期=" + uploadCycleWorkPart);
+		String uploadCycleWork = getStringFromHexStr(uploadCycleWorkPart);
+		System.out.println("工作忙状态上报周期" + uploadCycleWork);
+		hoding.setUploadcycleWork(Integer.decode(uploadCycleWork));
+		// 空闲状态上报周期:单位(分钟)
+		String uploadCycleFreePart = input.substring(6 * 2, 7 * 2);
+		if(uploadCycleFreePart.equals("23")){
+			uploadCycleFreePart="24";
+		}
+		System.out.println("空闲状态上报周期=" + uploadCycleFreePart);
+		String uploadCycleFree = getStringFromHexStr(uploadCycleFreePart);
+		System.out.println("空闲状态上报周期" + uploadCycleFree);
+		// 低电量报警限值:单位(百分数,0-100%)
+		String lowPowerLimitPart = input.substring(7 * 2, 8 * 2);
+		if(lowPowerLimitPart.equals("23")){
+			lowPowerLimitPart="24";
+		}
+		System.out.println("低电量报警限值=" + lowPowerLimitPart);
+		String lowPowerLimit = getStringFromHexStr(lowPowerLimitPart);
+		System.out.println("低电量报警限值" + lowPowerLimit);
+		hoding.setLowpowerlimit(lowPowerLimit + "%");
+		// 热报警限值:单位(度)
+		String hotAlarmLimitPart = input.substring(8 * 2, 9 * 2);
+		if(hotAlarmLimitPart.equals("23")){
+			hotAlarmLimitPart="24";
+		}
+		System.out.println("热报警限值=" + hotAlarmLimitPart);
+		String hotAlarmLimit = getStringFromHexStr(hotAlarmLimitPart);
+		System.out.println("热报警限值" + hotAlarmLimit);
+		hoding.setHotalarmlimit(Integer.decode(hotAlarmLimit));
+		// 由工作状态转换到非工作状态用的时间(0-255 分钟)
+		String timeCountPart = input.substring(9 * 2, 10 * 2);
+		if(timeCountPart.equals("23")){
+			timeCountPart="24";
+		}
+		System.out.println("工作状态转换到非工作状态用的时间=" + timeCountPart);
+		String timeCount = getStringFromHexStr(timeCountPart);
+		System.out.println("工作状态转换到非工作状态用的时间" + timeCount);
+		hoding.setHotalarmlimit(Integer.decode(timeCount));
+		// 存入数据库
+		mouldHodingMapper.insertSelective(hoding);
+		return ret;
+	}
+
+	private void handleModLogic(MouldHistory item, int avgTime) {
+		TbMouldEquipmentExample meqExp = new TbMouldEquipmentExample();
+		meqExp.createCriteria().andEquipmentNoEqualTo(item.getEquipmentNo());
+		if (tbMouldEquipmentMapper.countByExample(meqExp) > 0) {
+			TbMouldEquipment me = tbMouldEquipmentMapper.selectByExample(meqExp).get(0);
+			me.setHillNumber(item.getBattery() + "%");
+			if (item.getLng() != null) {
+				me.setLng(Double.parseDouble(item.getLng()));
+				me.setLat(Double.parseDouble(item.getLat()));
+			}
+
 			me.setTemperature(item.getTemperature());
 			tbMouldEquipmentMapper.updateByPrimaryKeySelective(me);
-			
-    		TbMouldExample tExp = new TbMouldExample();	
-    		tExp.setOrderByClause("id desc limit 1");
-    		tExp.createCriteria().andEquipmentIdEqualTo(me.getId());
-    		if (tbMouldMapper.countByExample(tExp) > 0) {
-    			TbMould tm = tbMouldMapper.selectByExample(tExp).get(0);
-    			tm.setState(item.getStatus());
-    			tm.setRunTimes(tm.getRunTimes() + item.getRunCnt());
-    			
-    			//处理每模平均周期(单位秒)
-    			BigDecimal bd = new BigDecimal(avgTime*1.00/1000);
-    			tm.setOcCycle(bd);
-    			tbMouldMapper.updateByPrimaryKeySelective(tm);
-    			
-    			//处理报警
-    			if (item.getAlarm() > 0) {
-    				/**
-    				 * 无报警  0;
-					  低电量报警 1;
-					  温度过热 2;
-					  安装被拆 8。
-    				 */
-    				logger.info("设备报警啦:"+item.getAlarm());
-    			}
-    		}
-    	}
-    }
-    
-    /**
-     * 低位在前的16进制解析
-     * @param rHex
-     * @return
-     */
-    public static int reverseParseHex(String rHex) {
-    	int size = rHex.length()/2;
-    	StringBuilder sb = new StringBuilder();
-    	for (int i=0;i<size; i++) {
-    		sb.append(rHex.substring((size - i -1)*2, (size - i)*2));
-    	}
-    	String str = sb.toString();
-    	return Integer.parseInt(str, 16);
-    }
-    
-    private static Date parseDate(String input, int start, int pos, int dateStartPos) {
-    	String year = input.substring((start+pos*6 + dateStartPos)*2, (start+pos*6 + 1 + dateStartPos)*2);
-		String month = input.substring((start+pos*6+1 + dateStartPos)*2, (start+pos*6 + 2 + dateStartPos)*2);
-		String day = input.substring((start+pos*6+2 + dateStartPos)*2, (start+pos*6 + 3 + dateStartPos)*2);
-		String hh = input.substring((start+pos*6+3 + dateStartPos)*2, (start+pos*6 + 4 + dateStartPos)*2);
-		String mm = input.substring((start+pos*6+4 + dateStartPos)*2, (start+pos*6 + 5 + dateStartPos)*2);
-		String ss = input.substring((start+pos*6+5 + dateStartPos)*2, (start+pos*6 + 6 + dateStartPos)*2);
+
+			TbMouldExample tExp = new TbMouldExample();
+			tExp.setOrderByClause("id desc limit 1");
+			tExp.createCriteria().andEquipmentIdEqualTo(me.getId());
+			if (tbMouldMapper.countByExample(tExp) > 0) {
+				TbMould tm = tbMouldMapper.selectByExample(tExp).get(0);
+				tm.setState(item.getStatus());
+				tm.setRunTimes(tm.getRunTimes() + item.getRunCnt());
+
+				// 处理每模平均周期(单位秒)
+				BigDecimal bd = new BigDecimal(avgTime * 1.00 / 1000);
+				tm.setOcCycle(bd);
+				tbMouldMapper.updateByPrimaryKeySelective(tm);
+
+				// 处理报警
+				if (item.getAlarm() > 0) {
+					/**
+					 * 无报警 0; 低电量报警 1; 温度过热 2; 安装被拆 8。
+					 */
+					logger.info("设备报警啦:" + item.getAlarm());
+				}
+			}
+		}
+	}
+
+	/**
+	 * 低位在前的16进制解析
+	 * 
+	 * @param rHex
+	 * @return
+	 */
+	public static int reverseParseHex(String rHex) {
+		int size = rHex.length() / 2;
+		StringBuilder sb = new StringBuilder();
+		for (int i = 0; i < size; i++) {
+			sb.append(rHex.substring((size - i - 1) * 2, (size - i) * 2));
+		}
+		String str = sb.toString();
+		return Integer.parseInt(str, 16);
+	}
+
+	private static Date parseDate(String input, int start, int pos, int dateStartPos) {
+		String year = input.substring((start + pos * 6 + dateStartPos) * 2, (start + pos * 6 + 1 + dateStartPos) * 2);
+		String month = input.substring((start + pos * 6 + 1 + dateStartPos) * 2,
+				(start + pos * 6 + 2 + dateStartPos) * 2);
+		String day = input.substring((start + pos * 6 + 2 + dateStartPos) * 2,
+				(start + pos * 6 + 3 + dateStartPos) * 2);
+		String hh = input.substring((start + pos * 6 + 3 + dateStartPos) * 2, (start + pos * 6 + 4 + dateStartPos) * 2);
+		String mm = input.substring((start + pos * 6 + 4 + dateStartPos) * 2, (start + pos * 6 + 5 + dateStartPos) * 2);
+		String ss = input.substring((start + pos * 6 + 5 + dateStartPos) * 2, (start + pos * 6 + 6 + dateStartPos) * 2);
 		StringBuilder sb = new StringBuilder();
 		int yearInt = Integer.parseInt(year, 16);
 		if (yearInt == 0) {
 			sb.append("2019-01-01");
 		} else {
-			sb.append(yearInt < 100?"20":"2");
+			sb.append(yearInt < 100 ? "20" : "2");
 			sb.append(yearInt).append("-");
 			int monthInt = Integer.parseInt(month, 16);
-			sb.append(monthInt<10?"0":"").append(monthInt).append("-");
+			sb.append(monthInt < 10 ? "0" : "").append(monthInt).append("-");
 			int dayInt = Integer.parseInt(day, 16);
-			sb.append(dayInt<10?"0":"").append(dayInt);
+			sb.append(dayInt < 10 ? "0" : "").append(dayInt);
 		}
-		
+
 		Date parseDate = null;
 		try {
 			parseDate = new SimpleDateFormat("yyyy-MM-dd").parse(sb.toString());
@@ -260,51 +343,50 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 			e.printStackTrace();
 		}
 		return parseDate;
-    }
-    
-    
-    private String getStringFromHexStr(String hexStr) {
-    	StringBuilder sb = new StringBuilder();
-    	for (int i=0;i<hexStr.length()/2; i++) {
-    		String str = "0x"+hexStr.substring(i*2, i*2 + 2);
-    		int intVal = Integer.decode(str).intValue();
-    		char c = (char)intVal;
-    		sb.append(c);
-    	}
-    	return sb.toString();
-    }
-    
-    
-    public void close() {
-    	ctx.close();
-    }
-    
-    public void sendMsg(String hexString) {
-    	System.out.println("发送消息=="+hexString);
-    	byte[] buffer = hexStrToBinaryStr(hexString);
-    	ByteBuf bf = Unpooled.buffer(hexString.length()/2);
-    	bf.writeBytes(buffer);
-    	
-    	ctx.writeAndFlush(bf);
-//    	ctx.close();
-    }
-    
-    /**
-     * channel被激活时调用
-     */
-    @Override
-    public void channelActive(ChannelHandlerContext ctx){
-        // TODO Auto-generated method stub
-        this.ctx = ctx; 
-        System.out.println("==========Active========="+ctx.channel().localAddress().toString()+", connection num="+HelloServer.deviceMap.size());
-    }
+	}
+
+	private String getStringFromHexStr(String hexStr) {
+		StringBuilder sb = new StringBuilder();
+		for (int i = 0; i < hexStr.length() / 2; i++) {
+			String str = "0x" + hexStr.substring(i * 2, i * 2 + 2);
+			int intVal = Integer.decode(str).intValue();
+			char c = (char) intVal;
+			sb.append(c);
+		}
+		return sb.toString();
+	}
+
+	public void close() {
+		ctx.close();
+	}
+
+	public void sendMsg(String hexString) {
+		System.out.println("发送消息==" + hexString);
+		byte[] buffer = hexStrToBinaryStr(hexString);
+		ByteBuf bf = Unpooled.buffer(hexString.length() / 2);
+		bf.writeBytes(buffer);
+
+		ctx.writeAndFlush(bf);
+		// ctx.close();
+	}
+
+	/**
+	 * channel被激活时调用
+	 */
+	@Override
+	public void channelActive(ChannelHandlerContext ctx) {
+		// TODO Auto-generated method stub
+		this.ctx = ctx;
+		System.out.println("==========Active=========" + ctx.channel().localAddress().toString() + ", connection num="
+				+ HelloServer.deviceMap.size());
+	}
 
 	@Override
 	public void channelInactive(ChannelHandlerContext ctx) throws Exception {
 		super.channelInactive(ctx);
 		System.out.println("==========Inactive=========");
 	}
-	
+
 	@Override
 	public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
 		// TODO Auto-generated method stub
@@ -313,33 +395,31 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 	}
 
 	@Override
-	public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
-			throws Exception {
+	public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
 		// TODO Auto-generated method stub
 		super.exceptionCaught(ctx, cause);
 		System.out.println("我捕捉到异常信息了");
 	}
- 
-	
+
 	@Override
-    public void userEventTriggered(ChannelHandlerContext ctx, Object evt)
-	    throws Exception {
+	public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
 		if (evt instanceof IdleStateEvent) {
-		    IdleStateEvent event = (IdleStateEvent) evt;
-		    if (event.state().equals(IdleState.READER_IDLE)) {
-		    } else if (event.state().equals(IdleState.WRITER_IDLE)) {
-//		    	System.out.println("WRITER_IDLE=="+userInfo.getWxName());
-	//			logger.debug(ctx.channel().remoteAddress().toString()+ "WRITER_IDLE");
+			IdleStateEvent event = (IdleStateEvent) evt;
+			if (event.state().equals(IdleState.READER_IDLE)) {
+			} else if (event.state().equals(IdleState.WRITER_IDLE)) {
+				// System.out.println("WRITER_IDLE=="+userInfo.getWxName());
+				// logger.debug(ctx.channel().remoteAddress().toString()+
+				// "WRITER_IDLE");
 				// 超时关闭channel
-		//		ctx.close();
-		    } else if (event.state().equals(IdleState.ALL_IDLE)) {
-		    	// 发送心跳
-		    	ctx.channel().writeAndFlush("$&_".toString());
-		    }
+				// ctx.close();
+			} else if (event.state().equals(IdleState.ALL_IDLE)) {
+				// 发送心跳
+				ctx.channel().writeAndFlush("$&_".toString());
+			}
 		}
-//		super.userEventTriggered(ctx, evt);
-    }
-	
+		// super.userEventTriggered(ctx, evt);
+	}
+
 	/**
 	 * 将十六进制的字符串转换成字节数组
 	 *
@@ -356,64 +436,64 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 		byte[] bytes = new byte[len / 2];
 		while (index < len) {
 			String sub = hexString.substring(index, index + 2);
-			bytes[index/2] = (byte)Integer.parseInt(sub,16);
+			bytes[index / 2] = (byte) Integer.parseInt(sub, 16);
 			index += 2;
 		}
 		return bytes;
 	}
-	
+
 	/**
 	 * 将字节数组转换成十六进制的字符串
 	 *
 	 * @return
 	 */
 	public static String BinaryToHexString(byte[] bytes) {
-	    String hexStr = "0123456789ABCDEF";
-	    String result = "";
-	    String hex = "";
-	    for (byte b : bytes) {
-	        hex = String.valueOf(hexStr.charAt((b & 0xF0) >> 4));
-	        hex += String.valueOf(hexStr.charAt(b & 0x0F));
-	        result += hex + " ";
-	    }
-	    return result;
+		String hexStr = "0123456789ABCDEF";
+		String result = "";
+		String hex = "";
+		for (byte b : bytes) {
+			hex = String.valueOf(hexStr.charAt((b & 0xF0) >> 4));
+			hex += String.valueOf(hexStr.charAt(b & 0x0F));
+			result += hex + " ";
+		}
+		return result;
 	}
-	
+
 	public static void main(String[] args) {
-//		String str = "1F51";
+		// String str = "1F51";
 		String input = "FAAF530000000000000000000000003137333030303239343310010000000000000000000000000000000000000000001F51E85F00000000000045004A54000100110000001308160F171F1308160F2D188FCA";
-//		String temp = "0x"+str;
-//		int i = Integer.decode(temp);
-//		System.out.println(i);
-//		int p = reverseParseHex(str);
-//		System.out.println(p);
-//		int start = 69;
-//		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);
-        		time.setCloseTime(closeTime);
-        		//开模时间
-        		Date openTime = parseDate(input, start, pos, 6);
-        		time.setOpenTime(openTime);
-        		int timeCost = (int) (openTime.getTime() - closeTime.getTime());
-        		time.setTimeCost(timeCost);
-        	}
-    	} else {
-    		logger.info("本次开合模次数==0");
-    	}
+		// String temp = "0x"+str;
+		// int i = Integer.decode(temp);
+		// System.out.println(i);
+		// int p = reverseParseHex(str);
+		// System.out.println(p);
+		// int start = 69;
+		// 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);
+				time.setCloseTime(closeTime);
+				// 开模时间
+				Date openTime = parseDate(input, start, pos, 6);
+				time.setOpenTime(openTime);
+				int timeCost = (int) (openTime.getTime() - closeTime.getTime());
+				time.setTimeCost(timeCost);
+			}
+		} else {
+			logger.info("本次开合模次数==0");
+		}
 	}
-	
+
 }

+ 1 - 1
cloud-socket/src/jdbc.properties

@@ -2,7 +2,7 @@ classPath=D:/workspace/yunsu/cloud-socket/WebContent/WEB-INF/lib/mysql-connector
 driver=com.mysql.jdbc.Driver
 url=jdbc:mysql://118.190.47.230:3306/cloud_model?autoReconnect=true&rewriteBatchedStatements=TRUE&zeroDateTimeBehavior=convertToNull&useUnicode=true&characterEncoding=UTF-8
 username=root
-password=p011430seya10
+password=p011430seya1026
 maxActive=255
 maxIdle=20
 maxWait=100