|
@@ -0,0 +1,347 @@
|
|
|
+<?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.jay.monitor.data.server.daos.JayMonitorSqlMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.jay.monitor.data.server.models.entity.JayMonitorSql">
|
|
|
+ <id column="id" jdbcType="INTEGER" property="id" />
|
|
|
+ <result column="application_name" jdbcType="VARCHAR" property="applicationName" />
|
|
|
+ <result column="application_ip" jdbcType="VARCHAR" property="applicationIp" />
|
|
|
+ <result column="sql_id" jdbcType="VARCHAR" property="sqlId" />
|
|
|
+ <result column="table_name" jdbcType="VARCHAR" property="tableName" />
|
|
|
+ <result column="invoke_type" jdbcType="VARCHAR" property="invokeType" />
|
|
|
+ <result column="affected_rows" jdbcType="INTEGER" property="affectedRows" />
|
|
|
+ <result column="data_group_name" jdbcType="VARCHAR" property="dataGroupName" />
|
|
|
+ <result column="data_group_key" jdbcType="VARCHAR" property="dataGroupKey" />
|
|
|
+ <result column="data_id" jdbcType="VARCHAR" property="dataId" />
|
|
|
+ <result column="log_id" jdbcType="VARCHAR" property="logId" />
|
|
|
+ <result column="status" jdbcType="INTEGER" property="status" />
|
|
|
+ <result column="request_time" jdbcType="INTEGER" property="requestTime" />
|
|
|
+ <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
|
|
|
+ </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, application_name, application_ip, sql_id, `table_name`, invoke_type, affected_rows,
|
|
|
+ data_group_name, data_group_key, data_id, log_id, `status`, request_time, created_time
|
|
|
+ </sql>
|
|
|
+ <select id="selectByExample" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorSqlExample" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <if test="distinct">
|
|
|
+ distinct
|
|
|
+ </if>
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from jay_monitor_sql
|
|
|
+ <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 jay_monitor_sql
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ delete from jay_monitor_sql
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteByExample" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorSqlExample">
|
|
|
+ delete from jay_monitor_sql
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorSql" useGeneratedKeys="true">
|
|
|
+ insert into jay_monitor_sql (application_name, application_ip, sql_id,
|
|
|
+ `table_name`, invoke_type, affected_rows,
|
|
|
+ data_group_name, data_group_key, data_id,
|
|
|
+ log_id, `status`, request_time,
|
|
|
+ created_time)
|
|
|
+ values (#{applicationName,jdbcType=VARCHAR}, #{applicationIp,jdbcType=VARCHAR}, #{sqlId,jdbcType=VARCHAR},
|
|
|
+ #{tableName,jdbcType=VARCHAR}, #{invokeType,jdbcType=VARCHAR}, #{affectedRows,jdbcType=INTEGER},
|
|
|
+ #{dataGroupName,jdbcType=VARCHAR}, #{dataGroupKey,jdbcType=VARCHAR}, #{dataId,jdbcType=VARCHAR},
|
|
|
+ #{logId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{requestTime,jdbcType=INTEGER},
|
|
|
+ #{createdTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorSql" useGeneratedKeys="true">
|
|
|
+ insert into jay_monitor_sql
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="applicationName != null">
|
|
|
+ application_name,
|
|
|
+ </if>
|
|
|
+ <if test="applicationIp != null">
|
|
|
+ application_ip,
|
|
|
+ </if>
|
|
|
+ <if test="sqlId != null">
|
|
|
+ sql_id,
|
|
|
+ </if>
|
|
|
+ <if test="tableName != null">
|
|
|
+ `table_name`,
|
|
|
+ </if>
|
|
|
+ <if test="invokeType != null">
|
|
|
+ invoke_type,
|
|
|
+ </if>
|
|
|
+ <if test="affectedRows != null">
|
|
|
+ affected_rows,
|
|
|
+ </if>
|
|
|
+ <if test="dataGroupName != null">
|
|
|
+ data_group_name,
|
|
|
+ </if>
|
|
|
+ <if test="dataGroupKey != null">
|
|
|
+ data_group_key,
|
|
|
+ </if>
|
|
|
+ <if test="dataId != null">
|
|
|
+ data_id,
|
|
|
+ </if>
|
|
|
+ <if test="logId != null">
|
|
|
+ log_id,
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status`,
|
|
|
+ </if>
|
|
|
+ <if test="requestTime != null">
|
|
|
+ request_time,
|
|
|
+ </if>
|
|
|
+ <if test="createdTime != null">
|
|
|
+ created_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="applicationName != null">
|
|
|
+ #{applicationName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="applicationIp != null">
|
|
|
+ #{applicationIp,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="sqlId != null">
|
|
|
+ #{sqlId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="tableName != null">
|
|
|
+ #{tableName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="invokeType != null">
|
|
|
+ #{invokeType,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="affectedRows != null">
|
|
|
+ #{affectedRows,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="dataGroupName != null">
|
|
|
+ #{dataGroupName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="dataGroupKey != null">
|
|
|
+ #{dataGroupKey,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="dataId != null">
|
|
|
+ #{dataId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="logId != null">
|
|
|
+ #{logId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="requestTime != null">
|
|
|
+ #{requestTime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createdTime != null">
|
|
|
+ #{createdTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <select id="countByExample" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorSqlExample" resultType="java.lang.Long">
|
|
|
+ select count(*) from jay_monitor_sql
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <update id="updateByExampleSelective" parameterType="map">
|
|
|
+ update jay_monitor_sql
|
|
|
+ <set>
|
|
|
+ <if test="record.id != null">
|
|
|
+ id = #{record.id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.applicationName != null">
|
|
|
+ application_name = #{record.applicationName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.applicationIp != null">
|
|
|
+ application_ip = #{record.applicationIp,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.sqlId != null">
|
|
|
+ sql_id = #{record.sqlId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.tableName != null">
|
|
|
+ `table_name` = #{record.tableName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.invokeType != null">
|
|
|
+ invoke_type = #{record.invokeType,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.affectedRows != null">
|
|
|
+ affected_rows = #{record.affectedRows,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.dataGroupName != null">
|
|
|
+ data_group_name = #{record.dataGroupName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.dataGroupKey != null">
|
|
|
+ data_group_key = #{record.dataGroupKey,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.dataId != null">
|
|
|
+ data_id = #{record.dataId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.logId != null">
|
|
|
+ log_id = #{record.logId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.status != null">
|
|
|
+ `status` = #{record.status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.requestTime != null">
|
|
|
+ request_time = #{record.requestTime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.createdTime != null">
|
|
|
+ created_time = #{record.createdTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByExample" parameterType="map">
|
|
|
+ update jay_monitor_sql
|
|
|
+ set id = #{record.id,jdbcType=INTEGER},
|
|
|
+ application_name = #{record.applicationName,jdbcType=VARCHAR},
|
|
|
+ application_ip = #{record.applicationIp,jdbcType=VARCHAR},
|
|
|
+ sql_id = #{record.sqlId,jdbcType=VARCHAR},
|
|
|
+ `table_name` = #{record.tableName,jdbcType=VARCHAR},
|
|
|
+ invoke_type = #{record.invokeType,jdbcType=VARCHAR},
|
|
|
+ affected_rows = #{record.affectedRows,jdbcType=INTEGER},
|
|
|
+ data_group_name = #{record.dataGroupName,jdbcType=VARCHAR},
|
|
|
+ data_group_key = #{record.dataGroupKey,jdbcType=VARCHAR},
|
|
|
+ data_id = #{record.dataId,jdbcType=VARCHAR},
|
|
|
+ log_id = #{record.logId,jdbcType=VARCHAR},
|
|
|
+ `status` = #{record.status,jdbcType=INTEGER},
|
|
|
+ request_time = #{record.requestTime,jdbcType=INTEGER},
|
|
|
+ created_time = #{record.createdTime,jdbcType=TIMESTAMP}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorSql">
|
|
|
+ update jay_monitor_sql
|
|
|
+ <set>
|
|
|
+ <if test="applicationName != null">
|
|
|
+ application_name = #{applicationName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="applicationIp != null">
|
|
|
+ application_ip = #{applicationIp,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="sqlId != null">
|
|
|
+ sql_id = #{sqlId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="tableName != null">
|
|
|
+ `table_name` = #{tableName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="invokeType != null">
|
|
|
+ invoke_type = #{invokeType,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="affectedRows != null">
|
|
|
+ affected_rows = #{affectedRows,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="dataGroupName != null">
|
|
|
+ data_group_name = #{dataGroupName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="dataGroupKey != null">
|
|
|
+ data_group_key = #{dataGroupKey,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="dataId != null">
|
|
|
+ data_id = #{dataId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="logId != null">
|
|
|
+ log_id = #{logId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status` = #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="requestTime != null">
|
|
|
+ request_time = #{requestTime,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createdTime != null">
|
|
|
+ created_time = #{createdTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorSql">
|
|
|
+ update jay_monitor_sql
|
|
|
+ set application_name = #{applicationName,jdbcType=VARCHAR},
|
|
|
+ application_ip = #{applicationIp,jdbcType=VARCHAR},
|
|
|
+ sql_id = #{sqlId,jdbcType=VARCHAR},
|
|
|
+ `table_name` = #{tableName,jdbcType=VARCHAR},
|
|
|
+ invoke_type = #{invokeType,jdbcType=VARCHAR},
|
|
|
+ affected_rows = #{affectedRows,jdbcType=INTEGER},
|
|
|
+ data_group_name = #{dataGroupName,jdbcType=VARCHAR},
|
|
|
+ data_group_key = #{dataGroupKey,jdbcType=VARCHAR},
|
|
|
+ data_id = #{dataId,jdbcType=VARCHAR},
|
|
|
+ log_id = #{logId,jdbcType=VARCHAR},
|
|
|
+ `status` = #{status,jdbcType=INTEGER},
|
|
|
+ request_time = #{requestTime,jdbcType=INTEGER},
|
|
|
+ created_time = #{createdTime,jdbcType=TIMESTAMP}
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+</mapper>
|