1
0

3 Commitit 8b2ffdb757 ... 6a3c95f686

Tekijä SHA1 Viesti Päivämäärä
  zhangqian 6a3c95f686 生成日志操作的对应文件 1 vuosi sitten
  zhangqian feb0810c92 Merge branch 'master' of http://120.55.44.4:10080/zhangqian/IotServer 1 vuosi sitten
  zhangqian ddfd51d103 update 1 vuosi sitten

+ 8 - 0
pom.xml

@@ -146,6 +146,14 @@
                     </dependency>
                     </dependency>
                 </dependencies>
                 </dependencies>
             </plugin>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>8</source>
+                    <target>8</target>
+                </configuration>
+            </plugin>
         </plugins>
         </plugins>
         <!--扫描指定的配置文件 如果mapper的xml文件没有放在resources目录下,而是放在了和接口类在一起的包,这里就必须配置-->
         <!--扫描指定的配置文件 如果mapper的xml文件没有放在resources目录下,而是放在了和接口类在一起的包,这里就必须配置-->
         <resources>
         <resources>

+ 111 - 0
src/main/java/com/greentech/gateservice/entity/GateOplog.java

@@ -0,0 +1,111 @@
+package com.greentech.gateservice.entity;
+
+import org.springframework.stereotype.Component;
+
+import java.io.Serializable;
+import java.util.Date;
+
+@Component
+public class GateOplog implements Serializable {
+    private Integer id;
+
+    private Integer projectId;
+
+    private String gateName;
+
+    private Date createdTime;
+
+    private Byte isDelete;
+
+    private String userName;
+
+    private String eventType;
+
+    private String checkType;
+
+    private String status;
+
+    private String serialNum;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getProjectId() {
+        return projectId;
+    }
+
+    public void setProjectId(Integer projectId) {
+        this.projectId = projectId;
+    }
+
+    public String getGateName() {
+        return gateName;
+    }
+
+    public void setGateName(String gateName) {
+        this.gateName = gateName == null ? null : gateName.trim();
+    }
+
+    public Date getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Date createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Byte getIsDelete() {
+        return isDelete;
+    }
+
+    public void setIsDelete(Byte isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName == null ? null : userName.trim();
+    }
+
+    public String getEventType() {
+        return eventType;
+    }
+
+    public void setEventType(String eventType) {
+        this.eventType = eventType == null ? null : eventType.trim();
+    }
+
+    public String getCheckType() {
+        return checkType;
+    }
+
+    public void setCheckType(String checkType) {
+        this.checkType = checkType == null ? null : checkType.trim();
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status == null ? null : status.trim();
+    }
+
+    public String getSerialNum() {
+        return serialNum;
+    }
+
+    public void setSerialNum(String serialNum) {
+        this.serialNum = serialNum == null ? null : serialNum.trim();
+    }
+}

+ 864 - 0
src/main/java/com/greentech/gateservice/entity/GateOplogImpl.java

@@ -0,0 +1,864 @@
+package com.greentech.gateservice.entity;
+
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class GateOplogImpl {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public GateOplogImpl() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    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 andProjectIdIsNull() {
+            addCriterion("project_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdIsNotNull() {
+            addCriterion("project_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdEqualTo(Integer value) {
+            addCriterion("project_id =", value, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdNotEqualTo(Integer value) {
+            addCriterion("project_id <>", value, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdGreaterThan(Integer value) {
+            addCriterion("project_id >", value, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("project_id >=", value, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdLessThan(Integer value) {
+            addCriterion("project_id <", value, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdLessThanOrEqualTo(Integer value) {
+            addCriterion("project_id <=", value, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdIn(List<Integer> values) {
+            addCriterion("project_id in", values, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdNotIn(List<Integer> values) {
+            addCriterion("project_id not in", values, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdBetween(Integer value1, Integer value2) {
+            addCriterion("project_id between", value1, value2, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andProjectIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("project_id not between", value1, value2, "projectId");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameIsNull() {
+            addCriterion("gate_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameIsNotNull() {
+            addCriterion("gate_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameEqualTo(String value) {
+            addCriterion("gate_name =", value, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameNotEqualTo(String value) {
+            addCriterion("gate_name <>", value, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameGreaterThan(String value) {
+            addCriterion("gate_name >", value, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameGreaterThanOrEqualTo(String value) {
+            addCriterion("gate_name >=", value, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameLessThan(String value) {
+            addCriterion("gate_name <", value, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameLessThanOrEqualTo(String value) {
+            addCriterion("gate_name <=", value, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameLike(String value) {
+            addCriterion("gate_name like", value, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameNotLike(String value) {
+            addCriterion("gate_name not like", value, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameIn(List<String> values) {
+            addCriterion("gate_name in", values, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameNotIn(List<String> values) {
+            addCriterion("gate_name not in", values, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameBetween(String value1, String value2) {
+            addCriterion("gate_name between", value1, value2, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andGateNameNotBetween(String value1, String value2) {
+            addCriterion("gate_name not between", value1, value2, "gateName");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeIsNull() {
+            addCriterion("created_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeIsNotNull() {
+            addCriterion("created_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeEqualTo(Date value) {
+            addCriterion("created_time =", value, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeNotEqualTo(Date value) {
+            addCriterion("created_time <>", value, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeGreaterThan(Date value) {
+            addCriterion("created_time >", value, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("created_time >=", value, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeLessThan(Date value) {
+            addCriterion("created_time <", value, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeLessThanOrEqualTo(Date value) {
+            addCriterion("created_time <=", value, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeIn(List<Date> values) {
+            addCriterion("created_time in", values, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeNotIn(List<Date> values) {
+            addCriterion("created_time not in", values, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeBetween(Date value1, Date value2) {
+            addCriterion("created_time between", value1, value2, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatedTimeNotBetween(Date value1, Date value2) {
+            addCriterion("created_time not between", value1, value2, "createdTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNull() {
+            addCriterion("is_delete is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNotNull() {
+            addCriterion("is_delete is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteEqualTo(Byte value) {
+            addCriterion("is_delete =", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotEqualTo(Byte value) {
+            addCriterion("is_delete <>", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThan(Byte value) {
+            addCriterion("is_delete >", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThanOrEqualTo(Byte value) {
+            addCriterion("is_delete >=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThan(Byte value) {
+            addCriterion("is_delete <", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThanOrEqualTo(Byte value) {
+            addCriterion("is_delete <=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIn(List<Byte> values) {
+            addCriterion("is_delete in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotIn(List<Byte> values) {
+            addCriterion("is_delete not in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteBetween(Byte value1, Byte value2) {
+            addCriterion("is_delete between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotBetween(Byte value1, Byte value2) {
+            addCriterion("is_delete not between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameIsNull() {
+            addCriterion("user_name is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameIsNotNull() {
+            addCriterion("user_name is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameEqualTo(String value) {
+            addCriterion("user_name =", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameNotEqualTo(String value) {
+            addCriterion("user_name <>", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameGreaterThan(String value) {
+            addCriterion("user_name >", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameGreaterThanOrEqualTo(String value) {
+            addCriterion("user_name >=", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameLessThan(String value) {
+            addCriterion("user_name <", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameLessThanOrEqualTo(String value) {
+            addCriterion("user_name <=", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameLike(String value) {
+            addCriterion("user_name like", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameNotLike(String value) {
+            addCriterion("user_name not like", value, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameIn(List<String> values) {
+            addCriterion("user_name in", values, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameNotIn(List<String> values) {
+            addCriterion("user_name not in", values, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameBetween(String value1, String value2) {
+            addCriterion("user_name between", value1, value2, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andUserNameNotBetween(String value1, String value2) {
+            addCriterion("user_name not between", value1, value2, "userName");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeIsNull() {
+            addCriterion("event_type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeIsNotNull() {
+            addCriterion("event_type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeEqualTo(String value) {
+            addCriterion("event_type =", value, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeNotEqualTo(String value) {
+            addCriterion("event_type <>", value, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeGreaterThan(String value) {
+            addCriterion("event_type >", value, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeGreaterThanOrEqualTo(String value) {
+            addCriterion("event_type >=", value, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeLessThan(String value) {
+            addCriterion("event_type <", value, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeLessThanOrEqualTo(String value) {
+            addCriterion("event_type <=", value, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeLike(String value) {
+            addCriterion("event_type like", value, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeNotLike(String value) {
+            addCriterion("event_type not like", value, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeIn(List<String> values) {
+            addCriterion("event_type in", values, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeNotIn(List<String> values) {
+            addCriterion("event_type not in", values, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeBetween(String value1, String value2) {
+            addCriterion("event_type between", value1, value2, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andEventTypeNotBetween(String value1, String value2) {
+            addCriterion("event_type not between", value1, value2, "eventType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeIsNull() {
+            addCriterion("check_type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeIsNotNull() {
+            addCriterion("check_type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeEqualTo(String value) {
+            addCriterion("check_type =", value, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeNotEqualTo(String value) {
+            addCriterion("check_type <>", value, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeGreaterThan(String value) {
+            addCriterion("check_type >", value, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeGreaterThanOrEqualTo(String value) {
+            addCriterion("check_type >=", value, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeLessThan(String value) {
+            addCriterion("check_type <", value, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeLessThanOrEqualTo(String value) {
+            addCriterion("check_type <=", value, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeLike(String value) {
+            addCriterion("check_type like", value, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeNotLike(String value) {
+            addCriterion("check_type not like", value, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeIn(List<String> values) {
+            addCriterion("check_type in", values, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeNotIn(List<String> values) {
+            addCriterion("check_type not in", values, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeBetween(String value1, String value2) {
+            addCriterion("check_type between", value1, value2, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckTypeNotBetween(String value1, String value2) {
+            addCriterion("check_type not between", value1, value2, "checkType");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNull() {
+            addCriterion("status is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("status is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(String value) {
+            addCriterion("status =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(String value) {
+            addCriterion("status <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(String value) {
+            addCriterion("status >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(String value) {
+            addCriterion("status >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(String value) {
+            addCriterion("status <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(String value) {
+            addCriterion("status <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLike(String value) {
+            addCriterion("status like", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotLike(String value) {
+            addCriterion("status not like", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<String> values) {
+            addCriterion("status in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<String> values) {
+            addCriterion("status not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(String value1, String value2) {
+            addCriterion("status between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(String value1, String value2) {
+            addCriterion("status not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumIsNull() {
+            addCriterion("serial_num is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumIsNotNull() {
+            addCriterion("serial_num is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumEqualTo(String value) {
+            addCriterion("serial_num =", value, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumNotEqualTo(String value) {
+            addCriterion("serial_num <>", value, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumGreaterThan(String value) {
+            addCriterion("serial_num >", value, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumGreaterThanOrEqualTo(String value) {
+            addCriterion("serial_num >=", value, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumLessThan(String value) {
+            addCriterion("serial_num <", value, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumLessThanOrEqualTo(String value) {
+            addCriterion("serial_num <=", value, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumLike(String value) {
+            addCriterion("serial_num like", value, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumNotLike(String value) {
+            addCriterion("serial_num not like", value, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumIn(List<String> values) {
+            addCriterion("serial_num in", values, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumNotIn(List<String> values) {
+            addCriterion("serial_num not in", values, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumBetween(String value1, String value2) {
+            addCriterion("serial_num between", value1, value2, "serialNum");
+            return (Criteria) this;
+        }
+
+        public Criteria andSerialNumNotBetween(String value1, String value2) {
+            addCriterion("serial_num not between", value1, value2, "serialNum");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    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);
+        }
+    }
+}

+ 31 - 0
src/main/java/com/greentech/gateservice/mapper/GateOplogMapper.java

@@ -0,0 +1,31 @@
+package com.greentech.gateservice.mapper;
+
+import com.greentech.gateservice.entity.GateOplog;
+import com.greentech.gateservice.entity.GateOplogImpl;
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface GateOplogMapper {
+    int deleteByExample(GateOplogImpl example);
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(GateOplog record);
+
+    int insertSelective(GateOplog record);
+
+    List<GateOplog> selectByExample(GateOplogImpl example);
+
+    GateOplog selectByPrimaryKey(Integer id);
+
+    int updateByExampleSelective(@Param("record") GateOplog record, @Param("example") GateOplogImpl example);
+
+    int updateByExample(@Param("record") GateOplog record, @Param("example") GateOplogImpl example);
+
+    int updateByPrimaryKeySelective(GateOplog record);
+
+    int updateByPrimaryKey(GateOplog record);
+}

+ 286 - 0
src/main/java/com/greentech/gateservice/mapper/GateOplogMapper.xml

@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.greentech.gateservice.mapper.GateOplogMapper">
+  <resultMap id="BaseResultMap" type="com.greentech.gateservice.entity.GateOplog">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="project_id" jdbcType="INTEGER" property="projectId" />
+    <result column="gate_name" jdbcType="VARCHAR" property="gateName" />
+    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
+    <result column="is_delete" jdbcType="TINYINT" property="isDelete" />
+    <result column="user_name" jdbcType="VARCHAR" property="userName" />
+    <result column="event_type" jdbcType="VARCHAR" property="eventType" />
+    <result column="check_type" jdbcType="VARCHAR" property="checkType" />
+    <result column="status" jdbcType="VARCHAR" property="status" />
+    <result column="serial_num" jdbcType="VARCHAR" property="serialNum" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <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">
+    <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">
+    id, project_id, gate_name, created_time, is_delete, user_name, event_type, check_type, 
+    status, serial_num
+  </sql>
+  <select id="selectByExample" parameterType="com.greentech.gateservice.entity.GateOplogImpl" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    'false' as QUERYID,
+    <include refid="Base_Column_List" />
+    from gate_oplog
+    <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">
+    select 
+    <include refid="Base_Column_List" />
+    from gate_oplog
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from gate_oplog
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.greentech.gateservice.entity.GateOplogImpl">
+    delete from gate_oplog
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.greentech.gateservice.entity.GateOplog">
+    insert into gate_oplog (id, project_id, gate_name, 
+      created_time, is_delete, user_name, 
+      event_type, check_type, status, 
+      serial_num)
+    values (#{id,jdbcType=INTEGER}, #{projectId,jdbcType=INTEGER}, #{gateName,jdbcType=VARCHAR}, 
+      #{createdTime,jdbcType=TIMESTAMP}, #{isDelete,jdbcType=TINYINT}, #{userName,jdbcType=VARCHAR}, 
+      #{eventType,jdbcType=VARCHAR}, #{checkType,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, 
+      #{serialNum,jdbcType=VARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.greentech.gateservice.entity.GateOplog">
+    insert into gate_oplog
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="projectId != null">
+        project_id,
+      </if>
+      <if test="gateName != null">
+        gate_name,
+      </if>
+      <if test="createdTime != null">
+        created_time,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="userName != null">
+        user_name,
+      </if>
+      <if test="eventType != null">
+        event_type,
+      </if>
+      <if test="checkType != null">
+        check_type,
+      </if>
+      <if test="status != null">
+        status,
+      </if>
+      <if test="serialNum != null">
+        serial_num,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="projectId != null">
+        #{projectId,jdbcType=INTEGER},
+      </if>
+      <if test="gateName != null">
+        #{gateName,jdbcType=VARCHAR},
+      </if>
+      <if test="createdTime != null">
+        #{createdTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=TINYINT},
+      </if>
+      <if test="userName != null">
+        #{userName,jdbcType=VARCHAR},
+      </if>
+      <if test="eventType != null">
+        #{eventType,jdbcType=VARCHAR},
+      </if>
+      <if test="checkType != null">
+        #{checkType,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=VARCHAR},
+      </if>
+      <if test="serialNum != null">
+        #{serialNum,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByExampleSelective" parameterType="map">
+    update gate_oplog
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.projectId != null">
+        project_id = #{record.projectId,jdbcType=INTEGER},
+      </if>
+      <if test="record.gateName != null">
+        gate_name = #{record.gateName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createdTime != null">
+        created_time = #{record.createdTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=TINYINT},
+      </if>
+      <if test="record.userName != null">
+        user_name = #{record.userName,jdbcType=VARCHAR},
+      </if>
+      <if test="record.eventType != null">
+        event_type = #{record.eventType,jdbcType=VARCHAR},
+      </if>
+      <if test="record.checkType != null">
+        check_type = #{record.checkType,jdbcType=VARCHAR},
+      </if>
+      <if test="record.status != null">
+        status = #{record.status,jdbcType=VARCHAR},
+      </if>
+      <if test="record.serialNum != null">
+        serial_num = #{record.serialNum,jdbcType=VARCHAR},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update gate_oplog
+    set id = #{record.id,jdbcType=INTEGER},
+      project_id = #{record.projectId,jdbcType=INTEGER},
+      gate_name = #{record.gateName,jdbcType=VARCHAR},
+      created_time = #{record.createdTime,jdbcType=TIMESTAMP},
+      is_delete = #{record.isDelete,jdbcType=TINYINT},
+      user_name = #{record.userName,jdbcType=VARCHAR},
+      event_type = #{record.eventType,jdbcType=VARCHAR},
+      check_type = #{record.checkType,jdbcType=VARCHAR},
+      status = #{record.status,jdbcType=VARCHAR},
+      serial_num = #{record.serialNum,jdbcType=VARCHAR}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.greentech.gateservice.entity.GateOplog">
+    update gate_oplog
+    <set>
+      <if test="projectId != null">
+        project_id = #{projectId,jdbcType=INTEGER},
+      </if>
+      <if test="gateName != null">
+        gate_name = #{gateName,jdbcType=VARCHAR},
+      </if>
+      <if test="createdTime != null">
+        created_time = #{createdTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=TINYINT},
+      </if>
+      <if test="userName != null">
+        user_name = #{userName,jdbcType=VARCHAR},
+      </if>
+      <if test="eventType != null">
+        event_type = #{eventType,jdbcType=VARCHAR},
+      </if>
+      <if test="checkType != null">
+        check_type = #{checkType,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        status = #{status,jdbcType=VARCHAR},
+      </if>
+      <if test="serialNum != null">
+        serial_num = #{serialNum,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.greentech.gateservice.entity.GateOplog">
+    update gate_oplog
+    set project_id = #{projectId,jdbcType=INTEGER},
+      gate_name = #{gateName,jdbcType=VARCHAR},
+      created_time = #{createdTime,jdbcType=TIMESTAMP},
+      is_delete = #{isDelete,jdbcType=TINYINT},
+      user_name = #{userName,jdbcType=VARCHAR},
+      event_type = #{eventType,jdbcType=VARCHAR},
+      check_type = #{checkType,jdbcType=VARCHAR},
+      status = #{status,jdbcType=VARCHAR},
+      serial_num = #{serialNum,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 77 - 1
src/main/java/com/greentech/gateservice/task/GateLogService.java

@@ -1,12 +1,88 @@
 package com.greentech.gateservice.task;
 package com.greentech.gateservice.task;
 
 
+import com.greentech.gateservice.util.LoginModule;
+import com.netsdk.common.Res;
+import com.netsdk.lib.NetSDKLib;
+import com.netsdk.lib.ToolKits;
+import com.sun.jna.Memory;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import java.time.LocalDateTime;
+import java.util.Calendar;
+
 @Service
 @Service
 public class GateLogService {
 public class GateLogService {
     @Scheduled(cron = "0 * * * * *")
     @Scheduled(cron = "0 * * * * *")
     public void syncLog() {
     public void syncLog() {
-        System.out.println("hello");
+        System.out.println("--开始执行日志查询同步任务--");
+        //获取前一小时
+        LocalDateTime now = LocalDateTime.now();
+        LocalDateTime startTime = now.minusHours(1);
+        NetSDKLib.NET_TIME s = new NetSDKLib.NET_TIME();
+        s.setTime(startTime.getYear(),startTime.getMonthValue(),startTime.getDayOfMonth(),0,0,0);
+        NetSDKLib.NET_TIME e = new NetSDKLib.NET_TIME();
+        e.setTime(startTime.getYear(),startTime.getMonthValue(),startTime.getDayOfMonth(),23,59,59);
+
+        synchronized(LoginModule.lock){
+            for (NetSDKLib.LLong key : LoginModule.m_stDeviceInfo.keySet()) {
+                //获取handle句柄和设备信息
+                NetSDKLib.NET_DEVICEINFO_Ex value = LoginModule.m_stDeviceInfo.get(key);
+                System.out.println("Key: " + key + ", Value: " + value);
+
+                //查询逻辑
+                NetSDKLib.NET_IN_FIND_RECORD_PARAM inParam = new NetSDKLib.NET_IN_FIND_RECORD_PARAM();
+                inParam.emType = NetSDKLib.EM_NET_RECORD_TYPE.NET_RECORD_ACCESSCTLCARDREC_EX;
+                //查询条件
+                NetSDKLib.FIND_RECORD_ACCESSCTLCARDREC_CONDITION_EX condition = new NetSDKLib.FIND_RECORD_ACCESSCTLCARDREC_CONDITION_EX();
+                condition.bTimeEnable = 1;
+                condition.stStartTime = s;
+                condition.stEndTime = e;
+                inParam.pQueryCondition = new Memory(condition.size());
+                ToolKits.SetStructDataToPointer(condition, inParam.pQueryCondition, 0);
+                NetSDKLib.NET_OUT_FIND_RECORD_PARAM outParam = new NetSDKLib.NET_OUT_FIND_RECORD_PARAM();
+                boolean f = LoginModule.netsdk.CLIENT_FindRecord(key,inParam,outParam,5000);
+                if (!f) {
+                    System.err.println("查询日志失败1!");
+                    return;
+                }
+                System.out.println("CLIENT_FindRecord success!");
+
+                int max = 100;
+                NetSDKLib.NET_IN_FIND_NEXT_RECORD_PARAM inNextParam = new NetSDKLib.NET_IN_FIND_NEXT_RECORD_PARAM();
+                inNextParam.lFindeHandle = outParam.lFindeHandle;
+                inNextParam.nFileCount = max;
+
+                NetSDKLib.NET_OUT_FIND_NEXT_RECORD_PARAM outNextParam = new NetSDKLib.NET_OUT_FIND_NEXT_RECORD_PARAM();
+                outNextParam.nMaxRecordNum = max;
+
+                NetSDKLib.NET_RECORDSET_ACCESS_CTL_CARDREC[] rets = new NetSDKLib.NET_RECORDSET_ACCESS_CTL_CARDREC[max];
+                for (int i = 0; i < max; i++) {
+                    rets[i] = new NetSDKLib.NET_RECORDSET_ACCESS_CTL_CARDREC();
+                }
+                outNextParam.pRecordList = new Memory(rets[0].size() * max);
+                ToolKits.SetStructArrToPointerData(rets, outNextParam.pRecordList);
+                boolean f2 = LoginModule.netsdk.CLIENT_FindNextRecord(inNextParam, outNextParam, 5000);
+                if (!f2) {
+                    System.err.println("查询日志失败2!");
+                    return;
+                }
+                System.out.println("CLIENT_FindNextRecord success!");
+                ToolKits.GetPointerDataToStructArr(outNextParam.pRecordList, rets);
+
+                System.out.println("查询到的结果数量:"+outNextParam.nRetRecordNum+"最大数量:"+outNextParam.nMaxRecordNum);
+                for (int i = 0; i < outNextParam.nRetRecordNum; i++) {
+                    String szCardName = new String(rets[i].szCardName);
+                    String openMethod = Res.string().getOpenMethods(rets[i].emMethod);
+                    System.out.println("人名:" + szCardName + "时间:" + rets[i].stuTime.toStringTime() + "开门方式" + openMethod);
+                    System.out.println("开门方向:"+rets[i].emDirection);
+                    //bStatus 开门结果
+                }
+
+                LoginModule.netsdk.CLIENT_FindRecordClose(outParam.lFindeHandle);
+                System.out.println("查询结束");
+            }
+        }
+        System.out.println("--结束执行日志查询同步任务--");
     }
     }
 }
 }

+ 2 - 0
src/main/java/com/greentech/gateservice/util/LoginModule.java

@@ -20,6 +20,8 @@ public class LoginModule {
     //登录句柄 设备 map k:登录句柄 v:设备信息
     //登录句柄 设备 map k:登录句柄 v:设备信息
     public static HashMap<LLong, NetSDKLib.NET_DEVICEINFO_Ex> m_stDeviceInfo = new HashMap<>();
     public static HashMap<LLong, NetSDKLib.NET_DEVICEINFO_Ex> m_stDeviceInfo = new HashMap<>();
 
 
+    public static final Object lock = new Object();
+
     private static boolean bInit    = false;
     private static boolean bInit    = false;
     private static boolean bLogopen = false;
     private static boolean bLogopen = false;
 
 

+ 1 - 1
src/main/resources/jdbc.properties

@@ -6,6 +6,6 @@ spring.datasource.password=PXDN93VRKU221107
 
 
 
 
 
 
-tableName=gate_info
+tableName=gate_oplog
 entityPackage=com.greentech.gateservice.entity
 entityPackage=com.greentech.gateservice.entity
 mapperPackage=com.greentech.gateservice.mapper
 mapperPackage=com.greentech.gateservice.mapper