<?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.JayMonitorUrlLogMapper">
  <resultMap id="BaseResultMap" type="com.jay.monitor.data.server.models.entity.JayMonitorUrlLog">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="monitor_id" jdbcType="INTEGER" property="monitorId" />
    <result column="log_id" jdbcType="VARCHAR" property="logId" />
    <result column="monitor_type" jdbcType="VARCHAR" property="monitorType" />
    <result column="log_text" jdbcType="VARCHAR" property="logText" />
    <result column="create_date" jdbcType="DATE" property="createDate" />
  </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, monitor_id, log_id, monitor_type, log_text, create_date
  </sql>
  <select id="selectByExample" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorUrlLogExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from jay_monitor_url_log
    <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_log
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from jay_monitor_url_log
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorUrlLogExample">
    delete from jay_monitor_url_log
    <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.JayMonitorUrlLog" useGeneratedKeys="true">
    insert into jay_monitor_url_log (monitor_id, log_id, monitor_type, 
      log_text, create_date)
    values (#{monitorId,jdbcType=INTEGER}, #{logId,jdbcType=VARCHAR}, #{monitorType,jdbcType=VARCHAR}, 
      #{logText,jdbcType=VARCHAR}, #{createDate,jdbcType=DATE})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorUrlLog" useGeneratedKeys="true">
    insert into jay_monitor_url_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="monitorId != null">
        monitor_id,
      </if>
      <if test="logId != null">
        log_id,
      </if>
      <if test="monitorType != null">
        monitor_type,
      </if>
      <if test="logText != null">
        log_text,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="monitorId != null">
        #{monitorId,jdbcType=INTEGER},
      </if>
      <if test="logId != null">
        #{logId,jdbcType=VARCHAR},
      </if>
      <if test="monitorType != null">
        #{monitorType,jdbcType=VARCHAR},
      </if>
      <if test="logText != null">
        #{logText,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=DATE},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorUrlLogExample" resultType="java.lang.Long">
    select count(*) from jay_monitor_url_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update jay_monitor_url_log
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.monitorId != null">
        monitor_id = #{record.monitorId,jdbcType=INTEGER},
      </if>
      <if test="record.logId != null">
        log_id = #{record.logId,jdbcType=VARCHAR},
      </if>
      <if test="record.monitorType != null">
        monitor_type = #{record.monitorType,jdbcType=VARCHAR},
      </if>
      <if test="record.logText != null">
        log_text = #{record.logText,jdbcType=VARCHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=DATE},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update jay_monitor_url_log
    set id = #{record.id,jdbcType=INTEGER},
      monitor_id = #{record.monitorId,jdbcType=INTEGER},
      log_id = #{record.logId,jdbcType=VARCHAR},
      monitor_type = #{record.monitorType,jdbcType=VARCHAR},
      log_text = #{record.logText,jdbcType=VARCHAR},
      create_date = #{record.createDate,jdbcType=DATE}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorUrlLog">
    update jay_monitor_url_log
    <set>
      <if test="monitorId != null">
        monitor_id = #{monitorId,jdbcType=INTEGER},
      </if>
      <if test="logId != null">
        log_id = #{logId,jdbcType=VARCHAR},
      </if>
      <if test="monitorType != null">
        monitor_type = #{monitorType,jdbcType=VARCHAR},
      </if>
      <if test="logText != null">
        log_text = #{logText,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=DATE},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.jay.monitor.data.server.models.entity.JayMonitorUrlLog">
    update jay_monitor_url_log
    set monitor_id = #{monitorId,jdbcType=INTEGER},
      log_id = #{logId,jdbcType=VARCHAR},
      monitor_type = #{monitorType,jdbcType=VARCHAR},
      log_text = #{logText,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=DATE}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>