SearchAwsCompareQqMapper.xml 5.94 KB
<?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.monitor.mysql.mapper.SearchAwsCompareQqMapper" >
  <resultMap id="BaseResultMap" type="com.model.SearchAwsCompareQq" >
    <id column="line" property="line" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="BIGINT" />
    <result column="opt_time" property="optTime" jdbcType="BIGINT" />
    <result column="different_percentage" property="differentPercentage" jdbcType="INTEGER" />
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.model.SearchAwsCompareQqWithBLOBs" extends="BaseResultMap" >
    <result column="query" property="query" jdbcType="LONGVARCHAR" />
    <result column="aws_skn" property="awsSkn" jdbcType="LONGVARCHAR" />
    <result column="qq_skn" property="qqSkn" jdbcType="LONGVARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    line, create_time,opt_time,different_percentage
  </sql>
  <sql id="Blob_Column_List" >
    query, aws_skn, qq_skn
  </sql>
  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from search_aws_compare_qq
    where line = #{line,jdbcType=INTEGER}
  </select>
  <select id="selectList" resultMap="ResultMapWithBLOBs" parameterType="com.monitor.model.domain.PageBean">
    select
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from search_aws_compare_qq
    order by different_percentage desc
    limit ${startIndex},${startIndex+pageSize}
  </select>
  <select id="selectCount" resultType="java.lang.Integer">
    select
    count(line)
    from search_aws_compare_qq
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from search_aws_compare_qq
    where line = #{line,jdbcType=INTEGER}
  </delete>
  <delete id="deleteAll">
    delete from search_aws_compare_qq
  </delete>
  <delete id="deleteSize">
    delete from search_aws_compare_qq
    limit 1000
  </delete>
  <delete id="deleteLessThanLine">
    delete from search_aws_compare_qq
    where line  <![CDATA[<]]> #{line,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.model.SearchAwsCompareQqWithBLOBs" >
    insert into search_aws_compare_qq (line, create_time,opt_time,different_percentage, query, 
      aws_skn, qq_skn)
    values (#{line,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT},#{optTime,jdbcType=BIGINT},#{differentPercentage,jdbcType=INTEGER}, #{query,jdbcType=LONGVARCHAR}, 
      #{awsSkn,jdbcType=LONGVARCHAR}, #{qqSkn,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertBatch" parameterType="java.util.List">
    insert into search_aws_compare_qq (line,create_time,opt_time,different_percentage,query,aws_skn,qq_skn) 
    values  
    <foreach collection="list" item="item" index="index" separator="," >  
        (#{item.line},#{item.createTime},#{item.optTime},#{item.differentPercentage},#{item.query},#{item.awsSkn},#{item.qqSkn})  
    </foreach>  
  </insert>
  <insert id="insertSelective" parameterType="com.model.SearchAwsCompareQqWithBLOBs" >
    insert into search_aws_compare_qq
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="line != null" >
        line,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="optTime != null" >
        opt_time,
      </if>
      <if test="differentPercentage != null" >
        different_percentage,
      </if>
      <if test="query != null" >
        query,
      </if>
      <if test="awsSkn != null" >
        aws_skn,
      </if>
      <if test="qqSkn != null" >
        qq_skn,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="line != null" >
        #{line,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=BIGINT},
      </if>
      <if test="optTime != null" >
        #{optTime,jdbcType=BIGINT},
      </if>
      <if test="differentPercentage != null" >
        #{differentPercentage,jdbcType=INTEGER},
      </if>
      <if test="query != null" >
        #{query,jdbcType=LONGVARCHAR},
      </if>
      <if test="awsSkn != null" >
        #{awsSkn,jdbcType=LONGVARCHAR},
      </if>
      <if test="qqSkn != null" >
        #{qqSkn,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.model.SearchAwsCompareQqWithBLOBs" >
    update search_aws_compare_qq
    <set >
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=BIGINT},
      </if>
      <if test="optTime != null" >
        opt_time = #{optTime,jdbcType=BIGINT},
      </if>
      <if test="differentPercentage != null" >
        different_percentage = #{differentPercentage,jdbcType=BIGINT},
      </if>
      <if test="query != null" >
        query = #{query,jdbcType=LONGVARCHAR},
      </if>
      <if test="awsSkn != null" >
        aws_skn = #{awsSkn,jdbcType=LONGVARCHAR},
      </if>
      <if test="qqSkn != null" >
        qq_skn = #{qqSkn,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where line = #{line,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.model.SearchAwsCompareQqWithBLOBs" >
    update search_aws_compare_qq
    set create_time = #{createTime,jdbcType=BIGINT},
      opt_time = #{optTime,jdbcType=BIGINT},
      different_percentage = #{differentPercentage,jdbcType=INTEGER},
      query = #{query,jdbcType=LONGVARCHAR},
      aws_skn = #{awsSkn,jdbcType=LONGVARCHAR},
      qq_skn = #{qqSkn,jdbcType=LONGVARCHAR}
    where line = #{line,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.model.SearchAwsCompareQq" >
    update search_aws_compare_qq
    set create_time = #{createTime,jdbcType=BIGINT}
    where line = #{line,jdbcType=INTEGER}
  </update>
</mapper>