<?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.JayMonitorUrlMapper">
  <resultMap id="BaseResultMap" type="com.jay.monitor.data.server.models.entity.JayMonitorUrl">
    <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="url" jdbcType="VARCHAR" property="url" />
    <result column="user_id" jdbcType="VARCHAR" property="userId" />
    <result column="client_ip" jdbcType="VARCHAR" property="clientIp" />
    <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="status" jdbcType="INTEGER" property="status" />
    <result column="log_id" jdbcType="VARCHAR" property="logId" />
    <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, url, user_id, client_ip, data_group_name, data_group_key, 
    data_id, `status`, log_id, request_time, created_time
  </sql>
  <select id="selectByExample" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorUrlExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from jay_monitor_url
    <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_url
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from jay_monitor_url
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorUrlExample">
    delete from jay_monitor_url
    <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.JayMonitorUrl" useGeneratedKeys="true">
    insert into jay_monitor_url (application_name, application_ip, url, 
      user_id, client_ip, data_group_name, 
      data_group_key, data_id, `status`, 
      log_id, request_time, created_time
      )
    values (#{applicationName,jdbcType=VARCHAR}, #{applicationIp,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, 
      #{userId,jdbcType=VARCHAR}, #{clientIp,jdbcType=VARCHAR}, #{dataGroupName,jdbcType=VARCHAR}, 
      #{dataGroupKey,jdbcType=VARCHAR}, #{dataId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
      #{logId,jdbcType=VARCHAR}, #{requestTime,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorUrl" useGeneratedKeys="true">
    insert into jay_monitor_url
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="applicationName != null">
        application_name,
      </if>
      <if test="applicationIp != null">
        application_ip,
      </if>
      <if test="url != null">
        url,
      </if>
      <if test="userId != null">
        user_id,
      </if>
      <if test="clientIp != null">
        client_ip,
      </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="status != null">
        `status`,
      </if>
      <if test="logId != null">
        log_id,
      </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="url != null">
        #{url,jdbcType=VARCHAR},
      </if>
      <if test="userId != null">
        #{userId,jdbcType=VARCHAR},
      </if>
      <if test="clientIp != null">
        #{clientIp,jdbcType=VARCHAR},
      </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="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="logId != null">
        #{logId,jdbcType=VARCHAR},
      </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.JayMonitorUrlExample" resultType="java.lang.Long">
    select count(*) from jay_monitor_url
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update jay_monitor_url
    <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.url != null">
        url = #{record.url,jdbcType=VARCHAR},
      </if>
      <if test="record.userId != null">
        user_id = #{record.userId,jdbcType=VARCHAR},
      </if>
      <if test="record.clientIp != null">
        client_ip = #{record.clientIp,jdbcType=VARCHAR},
      </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.status != null">
        `status` = #{record.status,jdbcType=INTEGER},
      </if>
      <if test="record.logId != null">
        log_id = #{record.logId,jdbcType=VARCHAR},
      </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_url
    set id = #{record.id,jdbcType=INTEGER},
      application_name = #{record.applicationName,jdbcType=VARCHAR},
      application_ip = #{record.applicationIp,jdbcType=VARCHAR},
      url = #{record.url,jdbcType=VARCHAR},
      user_id = #{record.userId,jdbcType=VARCHAR},
      client_ip = #{record.clientIp,jdbcType=VARCHAR},
      data_group_name = #{record.dataGroupName,jdbcType=VARCHAR},
      data_group_key = #{record.dataGroupKey,jdbcType=VARCHAR},
      data_id = #{record.dataId,jdbcType=VARCHAR},
      `status` = #{record.status,jdbcType=INTEGER},
      log_id = #{record.logId,jdbcType=VARCHAR},
      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.JayMonitorUrl">
    update jay_monitor_url
    <set>
      <if test="applicationName != null">
        application_name = #{applicationName,jdbcType=VARCHAR},
      </if>
      <if test="applicationIp != null">
        application_ip = #{applicationIp,jdbcType=VARCHAR},
      </if>
      <if test="url != null">
        url = #{url,jdbcType=VARCHAR},
      </if>
      <if test="userId != null">
        user_id = #{userId,jdbcType=VARCHAR},
      </if>
      <if test="clientIp != null">
        client_ip = #{clientIp,jdbcType=VARCHAR},
      </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="status != null">
        `status` = #{status,jdbcType=INTEGER},
      </if>
      <if test="logId != null">
        log_id = #{logId,jdbcType=VARCHAR},
      </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.JayMonitorUrl">
    update jay_monitor_url
    set application_name = #{applicationName,jdbcType=VARCHAR},
      application_ip = #{applicationIp,jdbcType=VARCHAR},
      url = #{url,jdbcType=VARCHAR},
      user_id = #{userId,jdbcType=VARCHAR},
      client_ip = #{clientIp,jdbcType=VARCHAR},
      data_group_name = #{dataGroupName,jdbcType=VARCHAR},
      data_group_key = #{dataGroupKey,jdbcType=VARCHAR},
      data_id = #{dataId,jdbcType=VARCHAR},
      `status` = #{status,jdbcType=INTEGER},
      log_id = #{logId,jdbcType=VARCHAR},
      request_time = #{requestTime,jdbcType=INTEGER},
      created_time = #{createdTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>