Commit 6dfde5af516b39c01d4e1d54e4f4c55cb44f52e9

Authored by pengcheng
1 parent f4f00389

错误日志

src/main/java/com/huaheng/pc/monitor/errorlog/domain/ErrorLog.java
1 1 package com.huaheng.pc.monitor.errorlog.domain;
2 2  
  3 +import com.baomidou.mybatisplus.annotation.IdType;
3 4 import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableId;
4 6 import com.baomidou.mybatisplus.annotation.TableName;
5 7 import com.huaheng.framework.web.domain.BaseEntity;
6 8 import org.apache.commons.lang3.builder.ToStringBuilder;
... ... @@ -19,7 +21,7 @@ public class ErrorLog extends BaseEntity {
19 21  
20 22 private static final long serialVersionUID = 1L;
21 23 //错误编号
22   - @TableField(value = "event_id")
  24 + @TableId(value = "event_id", type = IdType.AUTO)
23 25 private Integer event_id;
24 26 //时间戳
25 27 @TableField(value = "timestmp")
... ...
src/main/resources/mybatis/monitor/ErrorLogMapper.xml
... ... @@ -3,10 +3,26 @@
3 3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5 <mapper namespace="com.huaheng.pc.monitor.errorlog.mapper.ErrorLogMapper">
  6 + <resultMap type="com.huaheng.pc.monitor.errorlog.domain.ErrorLog" id="ErrorLogResult">
  7 + <id property="event_id" column="event_id" />
  8 + <result property="timestmp" column="timestmp" />
  9 + <result property="formatted_message" column="formatted_message" />
  10 + <result property="logger_name" column="logger_name" />
  11 + <result property="level_string" column="level_string" />
  12 + <result property="thread_name" column="thread_name" />
  13 + <result property="reference_flag" column="reference_flag" />
  14 + <result property="arg0" column="arg0" />
  15 + <result property="arg1" column="arg1" />
  16 + <result property="arg3" column="arg3" />
  17 + <result property="caller_filename" column="caller_filename" />
  18 + <result property="caller_class" column="caller_class" />
  19 + <result property="caller_method" column="caller_method" />
  20 + <result property="caller_line" column="caller_line" />
  21 + <result property="creatTime" column="creatTime" />
  22 + </resultMap>
6 23  
7 24 <select id="selectListEntity" parameterType="com.huaheng.pc.monitor.errorlog.domain.ErrorLog" resultType="com.huaheng.pc.monitor.errorlog.domain.ErrorLog">
8   - select event_id, timestmp, formatted_message, logger_name, level_string, thread_name, reference_flag, arg0,arg1,arg2,arg3,caller_filename,caller_class,caller_method,caller_line,creatTime
9   - from logging_event
  25 + select * from logging_event
10 26 <where>
11 27 AND level_string = 'ERROR'
12 28 <if test="caller_method != null and caller_method != ''">
... ...