소스 검색

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

# Conflicts:
#	target/classes/main/resources/mapper/MouldEquipmentMapper.xml
#	target/classes/main/resources/mapper/MouldMapper.xml
5 년 전
부모
커밋
6bb37ac543

+ 2 - 2
cloud-model/src/main/resources/application-prod.properties

@@ -14,9 +14,9 @@ spring.thymeleaf.jackson.date-format=yyyy-MM-dd HH:mm:ss
 # 数据源配置
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 # 云模服务器对应的数据库
-#spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 # 我们测试的自己服务器数据库
-spring.datasource.url=jdbc:mysql://118.190.47.230:3306/new_cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+#spring.datasource.url=jdbc:mysql://118.190.47.230:3306/new_cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 spring.datasource.username=root
 spring.datasource.password=p011430seya1026
 #spring.datasource.druid.test-on-borrow=true

+ 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="tb_mould_equipment" >
+    <table schema="cloud_model" tableName="time_calibration_record" >
     	<generatedKey column="id" identity="true" sqlStatement="SELECT LAST_INSERT_ID()"/>
     </table>
 <!--     <table schema="cloud_model" tableName="tb_mould_equipment" > -->

+ 98 - 0
cloud-socket/src/com/js/kbt/mapper/TimeCalibrationRecordMapper.java

@@ -0,0 +1,98 @@
+package com.js.kbt.mapper;
+
+import com.js.kbt.model.TimeCalibrationRecord;
+import com.js.kbt.model.TimeCalibrationRecordExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface TimeCalibrationRecordMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    long countByExample(TimeCalibrationRecordExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    int deleteByExample(TimeCalibrationRecordExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    int insert(TimeCalibrationRecord record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    int insertSelective(TimeCalibrationRecord record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    List<TimeCalibrationRecord> selectByExample(TimeCalibrationRecordExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    TimeCalibrationRecord selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    int updateByExampleSelective(@Param("record") TimeCalibrationRecord record, @Param("example") TimeCalibrationRecordExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    int updateByExample(@Param("record") TimeCalibrationRecord record, @Param("example") TimeCalibrationRecordExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    int updateByPrimaryKeySelective(TimeCalibrationRecord record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    int updateByPrimaryKey(TimeCalibrationRecord record);
+
+	Integer selectCountByToday();
+}

+ 245 - 0
cloud-socket/src/com/js/kbt/mapper/TimeCalibrationRecordMapper.xml

@@ -0,0 +1,245 @@
+<?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.TimeCalibrationRecordMapper">
+  <resultMap id="BaseResultMap" type="com.js.kbt.model.TimeCalibrationRecord">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Oct 10 15:45:15 CST 2019.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <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 Thu Oct 10 15:45:15 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 Thu Oct 10 15:45:15 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 Thu Oct 10 15:45:15 CST 2019.
+    -->
+    id, indate
+  </sql>
+  <select id="selectByExample" parameterType="com.js.kbt.model.TimeCalibrationRecordExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Oct 10 15:45:15 CST 2019.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from time_calibration_record
+    <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 Thu Oct 10 15:45:15 CST 2019.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from time_calibration_record
+    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 Thu Oct 10 15:45:15 CST 2019.
+    -->
+    delete from time_calibration_record
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.js.kbt.model.TimeCalibrationRecordExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Oct 10 15:45:15 CST 2019.
+    -->
+    delete from time_calibration_record
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.js.kbt.model.TimeCalibrationRecord">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Oct 10 15:45:15 CST 2019.
+    -->
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into time_calibration_record (indate)
+    values (#{indate,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.js.kbt.model.TimeCalibrationRecord">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Oct 10 15:45:15 CST 2019.
+    -->
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
+      SELECT LAST_INSERT_ID()
+    </selectKey>
+    insert into time_calibration_record
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="indate != null">
+        indate,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="indate != null">
+        #{indate,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.js.kbt.model.TimeCalibrationRecordExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Oct 10 15:45:15 CST 2019.
+    -->
+    select count(*) from time_calibration_record
+    <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 Thu Oct 10 15:45:15 CST 2019.
+    -->
+    update time_calibration_record
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,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 Thu Oct 10 15:45:15 CST 2019.
+    -->
+    update time_calibration_record
+    set id = #{record.id,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.TimeCalibrationRecord">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Oct 10 15:45:15 CST 2019.
+    -->
+    update time_calibration_record
+    <set>
+      <if test="indate != null">
+        indate = #{indate,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.js.kbt.model.TimeCalibrationRecord">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Thu Oct 10 15:45:15 CST 2019.
+    -->
+    update time_calibration_record
+    set indate = #{indate,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  
+  <select id="selectCountByToday" resultType="java.lang.Integer">
+  select count(id) from time_calibration_record
+  WHERE TO_DAYS(indate) = TO_DAYS(NOW())
+  </select>
+  
+</mapper>

+ 71 - 0
cloud-socket/src/com/js/kbt/model/TimeCalibrationRecord.java

@@ -0,0 +1,71 @@
+package com.js.kbt.model;
+
+import java.util.Date;
+
+public class TimeCalibrationRecord {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column time_calibration_record.id
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column time_calibration_record.indate
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    private Date indate;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column time_calibration_record.id
+     *
+     * @return the value of time_calibration_record.id
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column time_calibration_record.id
+     *
+     * @param id the value for time_calibration_record.id
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 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 time_calibration_record.indate
+     *
+     * @return the value of time_calibration_record.indate
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public Date getIndate() {
+        return indate;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column time_calibration_record.indate
+     *
+     * @param indate the value for time_calibration_record.indate
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public void setIndate(Date indate) {
+        this.indate = indate;
+    }
+}

+ 423 - 0
cloud-socket/src/com/js/kbt/model/TimeCalibrationRecordExample.java

@@ -0,0 +1,423 @@
+package com.js.kbt.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class TimeCalibrationRecordExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public TimeCalibrationRecordExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 CST 2019
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 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 time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 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 time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 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 time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 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 time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 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 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 time_calibration_record
+     *
+     * @mbg.generated do_not_delete_during_merge Thu Oct 10 15:45:15 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 time_calibration_record
+     *
+     * @mbg.generated Thu Oct 10 15:45:15 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);
+        }
+    }
+}

+ 24 - 2
cloud-socket/src/com/js/kbt/socket/UserHandler.java

@@ -19,6 +19,7 @@ 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.mapper.TimeCalibrationRecordMapper;
 import com.js.kbt.model.MouldDownPacket;
 import com.js.kbt.model.MouldDownPacketExample;
 import com.js.kbt.model.MouldHistory;
@@ -28,6 +29,8 @@ 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.model.TimeCalibrationRecord;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import io.netty.channel.ChannelHandlerContext;
@@ -56,9 +59,14 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 	private MouldHodingMapper mouldHodingMapper;
 	@Resource
 	private MouldDownPacketMapper mouldDownPacketMapper;
+	@Resource
+	private TimeCalibrationRecordMapper timeCalibrationRecordMapper;
+	
 
 	@Override
 	protected void channelRead0(ChannelHandlerContext arg0, String arg1) {
+		//校准时间
+		timeCalibration();
 		System.out.println("收到===" + arg1 + "\n");
 		String equipmentNo = processMsg(arg1);
 		//以下是配置下行数据
@@ -189,6 +197,7 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 	
 	public void sendPackage(String equipmentNo){
 		if(equipmentNo.indexOf("FAAF") != -1){
+			logger.info("非法云模盒编号,不作下发处理");
 			return;
 		}
 		MouldDownPacketExample exp = new MouldDownPacketExample();
@@ -202,6 +211,21 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 			}
 		}
 	}
+	
+	public void timeCalibration(){
+		Integer count = timeCalibrationRecordMapper.selectCountByToday();
+		if(count==0){
+			Date date = new Date();
+			SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd,HH:mm:ss");
+			String dateStr = sdf.format(date);
+			dateStr = "#TIME="+dateStr+";";
+			//#TIME=18-03-06,15:31:48;
+			logger.info("校准系统模块时间==>"+dateStr);
+			sendMsg(dateStr);
+			TimeCalibrationRecord timeCalibrationRecord = new TimeCalibrationRecord();
+			timeCalibrationRecordMapper.insertSelective(timeCalibrationRecord);
+		}
+	}
 
 	
 
@@ -419,7 +443,6 @@ 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));
@@ -445,5 +468,4 @@ public class UserHandler extends SimpleChannelInboundHandler<String> {
 			logger.info("本次开合模次数==0");
 		}
 	}
-
 }

+ 2 - 2
target/classes/main/resources/application-prod.properties

@@ -14,9 +14,9 @@ spring.thymeleaf.jackson.date-format=yyyy-MM-dd HH:mm:ss
 # 数据源配置
 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 # 云模服务器对应的数据库
-#spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+spring.datasource.url=jdbc:mysql://118.190.47.230:3306/cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 # 我们测试的自己服务器数据库
-spring.datasource.url=jdbc:mysql://118.190.47.230:3306/new_cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+#spring.datasource.url=jdbc:mysql://118.190.47.230:3306/new_cloud_model?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 spring.datasource.username=root
 spring.datasource.password=p011430seya1026
 #spring.datasource.druid.test-on-borrow=true