TKzyInformationMapper.xml 12.5 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.server.web.common.mapper.TKzyInformationMapper">
  <resultMap id="BaseResultMap" type="com.server.web.common.model.TKzyInformation">
    <constructor>
      <idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
      <arg column="title" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="author" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="icon_url" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="is_delete" javaType="java.lang.Integer" jdbcType="INTEGER" />
      <arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
      <arg column="update_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
    </constructor>
  </resultMap>
  <resultMap id="ResultMapWithBLOBs" type="com.server.web.common.model.TKzyInformation">
    <constructor>
      <idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
      <arg column="title" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="author" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="icon_url" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="is_delete" javaType="java.lang.Integer" jdbcType="INTEGER" />
      <arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
      <arg column="update_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
      <arg column="content" javaType="_byte[]" jdbcType="LONGVARBINARY" />
    </constructor>
  </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, title, author, pic_url, icon_url, is_delete, create_dt, update_dt
  </sql>
  <sql id="Blob_Column_List">
    content
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.server.web.common.model.TKzyInformationExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from t_kzy_information
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.server.web.common.model.TKzyInformationExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_kzy_information
    <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.Long" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from t_kzy_information
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_kzy_information
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.server.web.common.model.TKzyInformationExample">
    delete from t_kzy_information
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.server.web.common.model.TKzyInformation">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_kzy_information (title, author, pic_url, 
      icon_url, is_delete, create_dt, 
      update_dt, content)
    values (#{title,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR}, 
      #{iconUrl,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createDt,jdbcType=TIMESTAMP}, 
      #{updateDt,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARBINARY})
  </insert>
  <insert id="insertSelective" parameterType="com.server.web.common.model.TKzyInformation">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_kzy_information
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="title != null">
        title,
      </if>
      <if test="author != null">
        author,
      </if>
      <if test="picUrl != null">
        pic_url,
      </if>
      <if test="iconUrl != null">
        icon_url,
      </if>
      <if test="isDelete != null">
        is_delete,
      </if>
      <if test="createDt != null">
        create_dt,
      </if>
      <if test="updateDt != null">
        update_dt,
      </if>
      <if test="content != null">
        content,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="author != null">
        #{author,jdbcType=VARCHAR},
      </if>
      <if test="picUrl != null">
        #{picUrl,jdbcType=VARCHAR},
      </if>
      <if test="iconUrl != null">
        #{iconUrl,jdbcType=VARCHAR},
      </if>
      <if test="isDelete != null">
        #{isDelete,jdbcType=INTEGER},
      </if>
      <if test="createDt != null">
        #{createDt,jdbcType=TIMESTAMP},
      </if>
      <if test="updateDt != null">
        #{updateDt,jdbcType=TIMESTAMP},
      </if>
      <if test="content != null">
        #{content,jdbcType=LONGVARBINARY},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.server.web.common.model.TKzyInformationExample" resultType="java.lang.Long">
    select count(*) from t_kzy_information
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update t_kzy_information
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.title != null">
        title = #{record.title,jdbcType=VARCHAR},
      </if>
      <if test="record.author != null">
        author = #{record.author,jdbcType=VARCHAR},
      </if>
      <if test="record.picUrl != null">
        pic_url = #{record.picUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.iconUrl != null">
        icon_url = #{record.iconUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.isDelete != null">
        is_delete = #{record.isDelete,jdbcType=INTEGER},
      </if>
      <if test="record.createDt != null">
        create_dt = #{record.createDt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateDt != null">
        update_dt = #{record.updateDt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.content != null">
        content = #{record.content,jdbcType=LONGVARBINARY},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update t_kzy_information
    set id = #{record.id,jdbcType=BIGINT},
      title = #{record.title,jdbcType=VARCHAR},
      author = #{record.author,jdbcType=VARCHAR},
      pic_url = #{record.picUrl,jdbcType=VARCHAR},
      icon_url = #{record.iconUrl,jdbcType=VARCHAR},
      is_delete = #{record.isDelete,jdbcType=INTEGER},
      create_dt = #{record.createDt,jdbcType=TIMESTAMP},
      update_dt = #{record.updateDt,jdbcType=TIMESTAMP},
      content = #{record.content,jdbcType=LONGVARBINARY}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update t_kzy_information
    set id = #{record.id,jdbcType=BIGINT},
      title = #{record.title,jdbcType=VARCHAR},
      author = #{record.author,jdbcType=VARCHAR},
      pic_url = #{record.picUrl,jdbcType=VARCHAR},
      icon_url = #{record.iconUrl,jdbcType=VARCHAR},
      is_delete = #{record.isDelete,jdbcType=INTEGER},
      create_dt = #{record.createDt,jdbcType=TIMESTAMP},
      update_dt = #{record.updateDt,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TKzyInformation">
    update t_kzy_information
    <set>
      <if test="title != null">
        title = #{title,jdbcType=VARCHAR},
      </if>
      <if test="author != null">
        author = #{author,jdbcType=VARCHAR},
      </if>
      <if test="picUrl != null">
        pic_url = #{picUrl,jdbcType=VARCHAR},
      </if>
      <if test="iconUrl != null">
        icon_url = #{iconUrl,jdbcType=VARCHAR},
      </if>
      <if test="isDelete != null">
        is_delete = #{isDelete,jdbcType=INTEGER},
      </if>
      <if test="createDt != null">
        create_dt = #{createDt,jdbcType=TIMESTAMP},
      </if>
      <if test="updateDt != null">
        update_dt = #{updateDt,jdbcType=TIMESTAMP},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=LONGVARBINARY},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.server.web.common.model.TKzyInformation">
    update t_kzy_information
    set title = #{title,jdbcType=VARCHAR},
      author = #{author,jdbcType=VARCHAR},
      pic_url = #{picUrl,jdbcType=VARCHAR},
      icon_url = #{iconUrl,jdbcType=VARCHAR},
      is_delete = #{isDelete,jdbcType=INTEGER},
      create_dt = #{createDt,jdbcType=TIMESTAMP},
      update_dt = #{updateDt,jdbcType=TIMESTAMP},
      content = #{content,jdbcType=LONGVARBINARY}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TKzyInformation">
    update t_kzy_information
    set title = #{title,jdbcType=VARCHAR},
      author = #{author,jdbcType=VARCHAR},
      pic_url = #{picUrl,jdbcType=VARCHAR},
      icon_url = #{iconUrl,jdbcType=VARCHAR},
      is_delete = #{isDelete,jdbcType=INTEGER},
      create_dt = #{createDt,jdbcType=TIMESTAMP},
      update_dt = #{updateDt,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>