ImageRepertoryMapper.xml 8.71 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.yoho.search.dal.ImageRepertoryMapper">

    <resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ImageRepertory">
        <id column="id" property="id" jdbcType="INTEGER"/>
        <result column="item_id" property="itemId" jdbcType="INTEGER"/>
        <result column="channel" property="channel" jdbcType="INTEGER"/>
        <result column="season" property="season" jdbcType="INTEGER"/>
        <result column="image_url" property="imageUrl" jdbcType="VARCHAR"/>
        <result column="image_size" property="imageSize" jdbcType="VARCHAR"/>
        <result column="image_name" property="imageName" jdbcType="VARCHAR"/>
        <result column="image_type" property="imageType" jdbcType="INTEGER"/>
        <result column="item_type" property="itemType" jdbcType="INTEGER"/>
        <result column="remarks" property="remarks" jdbcType="VARCHAR"/>
        <result column="port" property="port" jdbcType="INTEGER"/>
        <result column="menu" property="menu" jdbcType="VARCHAR"/>
        <result column="menu_name" property="menuName" jdbcType="VARCHAR"/>
        <result column="create_time" property="createTime" jdbcType="INTEGER"/>
        <result column="update_time" property="updateTime" jdbcType="INTEGER"/>
    </resultMap>

    <sql id="Base_Column_List">
    id, item_id, channel, season, image_url, image_size, image_name, image_type, item_type, 
    remarks, port, menu, menu_name, create_time, update_time
   </sql>

    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
        select
        <include refid="Base_Column_List"/>
        from image_repertory
        where id = #{id,jdbcType=INTEGER}
    </select>

    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from image_repertory
    where id = #{id,jdbcType=INTEGER}
    </delete>

    <insert id="insert" parameterType="com.yoho.search.dal.model.ImageRepertory">
    insert into image_repertory (id, item_id, channel, 
      season, image_url, image_size, 
      image_name, image_type, item_type, 
      remarks, port, menu, 
      menu_name, create_time, update_time
      )
    values (#{id,jdbcType=INTEGER}, #{itemId,jdbcType=INTEGER}, #{channel,jdbcType=INTEGER}, 
      #{season,jdbcType=INTEGER}, #{imageUrl,jdbcType=VARCHAR}, #{imageSize,jdbcType=VARCHAR}, 
      #{imageName,jdbcType=VARCHAR}, #{imageType,jdbcType=INTEGER}, #{itemType,jdbcType=INTEGER}, 
      #{remarks,jdbcType=VARCHAR}, #{port,jdbcType=INTEGER}, #{menu,jdbcType=VARCHAR}, 
      #{menuName,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}
      )
   </insert>

    <insert id="insertSelective" parameterType="com.yoho.search.dal.model.ImageRepertory">
        insert into image_repertory
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">
                id,
            </if>
            <if test="itemId != null">
                item_id,
            </if>
            <if test="channel != null">
                channel,
            </if>
            <if test="season != null">
                season,
            </if>
            <if test="imageUrl != null">
                image_url,
            </if>
            <if test="imageSize != null">
                image_size,
            </if>
            <if test="imageName != null">
                image_name,
            </if>
            <if test="imageType != null">
                image_type,
            </if>
            <if test="itemType != null">
                item_type,
            </if>
            <if test="remarks != null">
                remarks,
            </if>
            <if test="port != null">
                port,
            </if>
            <if test="menu != null">
                menu,
            </if>
            <if test="menuName != null">
                menu_name,
            </if>
            <if test="createTime != null">
                create_time,
            </if>
            <if test="updateTime != null">
                update_time,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">
                #{id,jdbcType=INTEGER},
            </if>
            <if test="itemId != null">
                #{itemId,jdbcType=INTEGER},
            </if>
            <if test="channel != null">
                #{channel,jdbcType=INTEGER},
            </if>
            <if test="season != null">
                #{season,jdbcType=INTEGER},
            </if>
            <if test="imageUrl != null">
                #{imageUrl,jdbcType=VARCHAR},
            </if>
            <if test="imageSize != null">
                #{imageSize,jdbcType=VARCHAR},
            </if>
            <if test="imageName != null">
                #{imageName,jdbcType=VARCHAR},
            </if>
            <if test="imageType != null">
                #{imageType,jdbcType=INTEGER},
            </if>
            <if test="itemType != null">
                #{itemType,jdbcType=INTEGER},
            </if>
            <if test="remarks != null">
                #{remarks,jdbcType=VARCHAR},
            </if>
            <if test="port != null">
                #{port,jdbcType=INTEGER},
            </if>
            <if test="menu != null">
                #{menu,jdbcType=VARCHAR},
            </if>
            <if test="menuName != null">
                #{menuName,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">
                #{createTime,jdbcType=INTEGER},
            </if>
            <if test="updateTime != null">
                #{updateTime,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective" parameterType="com.yoho.search.dal.model.ImageRepertory">
        update image_repertory
        <set>
            <if test="itemId != null">
                item_id = #{itemId,jdbcType=INTEGER},
            </if>
            <if test="channel != null">
                channel = #{channel,jdbcType=INTEGER},
            </if>
            <if test="season != null">
                season = #{season,jdbcType=INTEGER},
            </if>
            <if test="imageUrl != null">
                image_url = #{imageUrl,jdbcType=VARCHAR},
            </if>
            <if test="imageSize != null">
                image_size = #{imageSize,jdbcType=VARCHAR},
            </if>
            <if test="imageName != null">
                image_name = #{imageName,jdbcType=VARCHAR},
            </if>
            <if test="imageType != null">
                image_type = #{imageType,jdbcType=INTEGER},
            </if>
            <if test="itemType != null">
                item_type = #{itemType,jdbcType=INTEGER},
            </if>
            <if test="remarks != null">
                remarks = #{remarks,jdbcType=VARCHAR},
            </if>
            <if test="port != null">
                port = #{port,jdbcType=INTEGER},
            </if>
            <if test="menu != null">
                menu = #{menu,jdbcType=VARCHAR},
            </if>
            <if test="menuName != null">
                menu_name = #{menuName,jdbcType=VARCHAR},
            </if>
            <if test="createTime != null">
                create_time = #{createTime,jdbcType=INTEGER},
            </if>
            <if test="updateTime != null">
                update_time = #{updateTime,jdbcType=INTEGER},
            </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>

    <update id="updateByPrimaryKey" parameterType="com.yoho.search.dal.model.ImageRepertory">
    update image_repertory
    set item_id = #{itemId,jdbcType=INTEGER},
      channel = #{channel,jdbcType=INTEGER},
      season = #{season,jdbcType=INTEGER},
      image_url = #{imageUrl,jdbcType=VARCHAR},
      image_size = #{imageSize,jdbcType=VARCHAR},
      image_name = #{imageName,jdbcType=VARCHAR},
      image_type = #{imageType,jdbcType=INTEGER},
      item_type = #{itemType,jdbcType=INTEGER},
      remarks = #{remarks,jdbcType=VARCHAR},
      port = #{port,jdbcType=INTEGER},
      menu = #{menu,jdbcType=VARCHAR},
      menu_name = #{menuName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=INTEGER},
      update_time = #{updateTime,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>

    <select id="selectCount" resultType="java.lang.Integer" timeout="20000">
        SELECT count(id) FROM image_repertory
    </select>

    <select id="selectPageLists" resultMap="BaseResultMap" timeout="20000">
        select
        <include refid="Base_Column_List"/>
        from image_repertory limit #{offset},#{pageSize}
    </select>
</mapper>