新增同步操作日志相关方法

dev2.0
anthonywj 2 years ago
parent bc7237177c
commit 6b0a8cf8cc

@ -81,8 +81,8 @@ public class HdSchemaExecutor implements ApplicationRunner {
} }
public void buildSchemas() { public void buildSchemas() {
schema.add(new SchemaData("v2.1", "schema_v2.1.sql")); // schema.add(new SchemaData("v2.1", "schema_v2.1.sql"));
// schema.add(new SchemaData("v2.2", "schema_v2.2.sql")); schema.add(new SchemaData("v2.2", "schema_v2.2.sql"));
// schema.add(new SchemaData("v2.3", "schema_v2.3.sql")); // schema.add(new SchemaData("v2.3", "schema_v2.3.sql"));
} }
} }

@ -0,0 +1,12 @@
package com.glxp.api.dao.sync;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.sync.SyncEditLogEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SyncEditLogMapper extends BaseMapper<SyncEditLogEntity> {
int insertOrUpdate(SyncEditLogEntity record);
int insertOrUpdateSelective(SyncEditLogEntity record);
}

@ -0,0 +1,12 @@
package com.glxp.api.dao.sync;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.sync.SyncEditTypeEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SyncEditTypeMapper extends BaseMapper<SyncEditTypeEntity> {
int insertOrUpdate(SyncEditTypeEntity record);
int insertOrUpdateSelective(SyncEditTypeEntity record);
}

@ -0,0 +1,92 @@
package com.glxp.api.entity.sync;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
@ApiModel(value="com-glxp-api-entity-sync-SyncEditLog")
@Data
@TableName(value = "sync_edit_log")
public class SyncEditLogEntity implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
@ApiModelProperty(value="")
private Integer id;
/**
*
*/
@TableField(value = "recordCode")
@ApiModelProperty(value="日志记录号")
private String recordCode;
/**
* 1:2:3:4:)
*/
@TableField(value = "operType")
@ApiModelProperty(value="操作类型1:增2:删3:改4:查)")
private Byte operType;
/**
*
*/
@TableField(value = "dataType")
@ApiModelProperty(value="操作数据类型")
private String dataType;
/**
*
*/
@TableField(value = "url")
@ApiModelProperty(value="接口地址")
private String url;
/**
*
*/
@TableField(value = "param")
@ApiModelProperty(value="请求参数")
private String param;
/**
*
*/
@TableField(value = "jsonResult")
@ApiModelProperty(value="请求结果")
private String jsonResult;
/**
* 1:2
*/
@TableField(value = "directType")
@ApiModelProperty(value="1:本地操作2对方操作")
private Byte directType;
/**
*
*/
@TableField(value = "remark")
@ApiModelProperty(value="备注说明")
private String remark;
/**
*
*/
@TableField(value = "operUser")
@ApiModelProperty(value="操作人")
private String operUser;
/**
*
*/
@TableField(value = "updateTime")
@ApiModelProperty(value="更新时间")
private Date updateTime;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,42 @@
package com.glxp.api.entity.sync;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.Data;
@ApiModel(value="com-glxp-api-entity-sync-SyncEditType")
@Data
@TableName(value = "sync_edit_type")
public class SyncEditTypeEntity implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
@ApiModelProperty(value="")
private Integer id;
/**
*
*/
@TableField(value = "code")
@ApiModelProperty(value="操作类型")
private String code;
/**
*
*/
@TableField(value = "`name`")
@ApiModelProperty(value="操作类型名称")
private String name;
/**
*
*/
@TableField(value = "remark")
@ApiModelProperty(value="备注")
private String remark;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,18 @@
package com.glxp.api.service.sync;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.entity.sync.SyncEditLogEntity;
import com.glxp.api.dao.sync.SyncEditLogMapper;
@Service
public class SyncEditLogService extends ServiceImpl<SyncEditLogMapper, SyncEditLogEntity> {
public int insertOrUpdate(SyncEditLogEntity record) {
return baseMapper.insertOrUpdate(record);
}
public int insertOrUpdateSelective(SyncEditLogEntity record) {
return baseMapper.insertOrUpdateSelective(record);
}
}

@ -0,0 +1,18 @@
package com.glxp.api.service.sync;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.sync.SyncEditTypeMapper;
import com.glxp.api.entity.sync.SyncEditTypeEntity;
@Service
public class SyncEditTypeService extends ServiceImpl<SyncEditTypeMapper, SyncEditTypeEntity> {
public int insertOrUpdate(SyncEditTypeEntity record) {
return baseMapper.insertOrUpdate(record);
}
public int insertOrUpdateSelective(SyncEditTypeEntity record) {
return baseMapper.insertOrUpdateSelective(record);
}
}

@ -0,0 +1,186 @@
<?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.glxp.api.dao.sync.SyncEditLogMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.sync.SyncEditLogEntity">
<!--@mbg.generated-->
<!--@Table sync_edit_log-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="recordCode" jdbcType="VARCHAR" property="recordCode" />
<result column="operType" jdbcType="TINYINT" property="operType" />
<result column="dataType" jdbcType="VARCHAR" property="dataType" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="param" jdbcType="VARCHAR" property="param" />
<result column="jsonResult" jdbcType="VARCHAR" property="jsonResult" />
<result column="directType" jdbcType="TINYINT" property="directType" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="operUser" jdbcType="VARCHAR" property="operUser" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, recordCode, operType, dataType, url, param, jsonResult, directType, remark, operUser,
updateTime
</sql>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.sync.SyncEditLogEntity" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into sync_edit_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
recordCode,
operType,
dataType,
url,
param,
jsonResult,
directType,
remark,
operUser,
updateTime,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{recordCode,jdbcType=VARCHAR},
#{operType,jdbcType=TINYINT},
#{dataType,jdbcType=VARCHAR},
#{url,jdbcType=VARCHAR},
#{param,jdbcType=VARCHAR},
#{jsonResult,jdbcType=VARCHAR},
#{directType,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR},
#{operUser,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
recordCode = #{recordCode,jdbcType=VARCHAR},
operType = #{operType,jdbcType=TINYINT},
dataType = #{dataType,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
param = #{param,jdbcType=VARCHAR},
jsonResult = #{jsonResult,jdbcType=VARCHAR},
directType = #{directType,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR},
operUser = #{operUser,jdbcType=VARCHAR},
updateTime = #{updateTime,jdbcType=TIMESTAMP},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.sync.SyncEditLogEntity" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into sync_edit_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="recordCode != null">
recordCode,
</if>
<if test="operType != null">
operType,
</if>
<if test="dataType != null">
dataType,
</if>
<if test="url != null">
url,
</if>
<if test="param != null">
param,
</if>
<if test="jsonResult != null">
jsonResult,
</if>
<if test="directType != null">
directType,
</if>
<if test="remark != null">
remark,
</if>
<if test="operUser != null">
operUser,
</if>
<if test="updateTime != null">
updateTime,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="recordCode != null">
#{recordCode,jdbcType=VARCHAR},
</if>
<if test="operType != null">
#{operType,jdbcType=TINYINT},
</if>
<if test="dataType != null">
#{dataType,jdbcType=VARCHAR},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="param != null">
#{param,jdbcType=VARCHAR},
</if>
<if test="jsonResult != null">
#{jsonResult,jdbcType=VARCHAR},
</if>
<if test="directType != null">
#{directType,jdbcType=TINYINT},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="operUser != null">
#{operUser,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="recordCode != null">
recordCode = #{recordCode,jdbcType=VARCHAR},
</if>
<if test="operType != null">
operType = #{operType,jdbcType=TINYINT},
</if>
<if test="dataType != null">
dataType = #{dataType,jdbcType=VARCHAR},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="param != null">
param = #{param,jdbcType=VARCHAR},
</if>
<if test="jsonResult != null">
jsonResult = #{jsonResult,jdbcType=VARCHAR},
</if>
<if test="directType != null">
directType = #{directType,jdbcType=TINYINT},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="operUser != null">
operUser = #{operUser,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
updateTime = #{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
</mapper>

@ -0,0 +1,94 @@
<?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.glxp.api.dao.sync.SyncEditTypeMapper">
<resultMap id="BaseResultMap" type="com.glxp.api.entity.sync.SyncEditTypeEntity">
<!--@mbg.generated-->
<!--@Table sync_edit_type-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, code, `name`, remark
</sql>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.sync.SyncEditTypeEntity" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into sync_edit_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
code,
`name`,
remark,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{code,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
code = #{code,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.sync.SyncEditTypeEntity" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into sync_edit_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="code != null">
code,
</if>
<if test="name != null">
`name`,
</if>
<if test="remark != null">
remark,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
</mapper>

@ -0,0 +1,34 @@
CREATE TABLE IF NOT EXISTS `sync_edit_log`
(
`id` int NOT NULL AUTO_INCREMENT,
`recordCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '日志记录号',
`operType` tinyint NULL DEFAULT NULL COMMENT '操作类型1:增2:删3:改4:查)',
`dataType` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作数据类型',
`url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '接口地址',
`param` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求参数',
`jsonResult` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '请求结果',
`directType` tinyint NULL DEFAULT NULL COMMENT '1:本地操作2对方操作',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注说明',
`operUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作人',
`updateTime` datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci
ROW_FORMAT = Dynamic;
CREATE TABLE IF NOT EXISTS `sync_edit_type`
(
`id` int NOT NULL AUTO_INCREMENT,
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作类型',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '操作类型名称',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci
ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
Loading…
Cancel
Save