IconZipMapper.xml 3.57 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.yohobuy.platform.dal.cms.IIconZipDao" >
  <resultMap id="BaseResultMap" type="com.yohobuy.platform.dal.cms.model.IconZip" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="zip" property="zip" jdbcType="VARCHAR" />
    <result column="platform" property="platform" jdbcType="VARCHAR" />
    <result column="status" property="status" jdbcType="TINYINT" />
    <result column="create_time" property="createTime" jdbcType="INTEGER" />
    <result column="update_time" property="updateTime" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, zip, platform, status, create_time, update_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from icon_zip
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from icon_zip
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.yohobuy.platform.dal.cms.model.IconZip" useGeneratedKeys="true" keyProperty="id">
    insert into icon_zip (id, zip, platform, status, create_time)
    values (#{id,jdbcType=INTEGER}, #{zip,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR},
      #{status,jdbcType=TINYINT}, UNIX_TIMESTAMP())
  </insert>
  <insert id="insertSelective" parameterType="com.yohobuy.platform.dal.cms.model.IconZip"  useGeneratedKeys="true" keyProperty="id">
    insert into icon_zip
    <trim prefix="(" suffix=")" suffixOverrides="," >
      id,
      <if test="zip != null" >
        zip,
      </if>
      <if test="platform != null" >
        platform,
      </if>
      <if test="status != null" >
        status,
      </if>
        create_time
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      #{id,jdbcType=INTEGER},
      <if test="zip != null" >
        #{zip,jdbcType=VARCHAR},
      </if>
      <if test="platform != null" >
        #{platform,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=TINYINT},
      </if>
        UNIX_TIMESTAMP()
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.cms.model.IconZip" >
    update icon_zip
    <set >
      <if test="zip != null" >
        zip = #{zip,jdbcType=VARCHAR},
      </if>
      <if test="platform != null" >
        platform = #{platform,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=TINYINT},
      </if>
        update_time = UNIX_TIMESTAMP()
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yohobuy.platform.dal.cms.model.IconZip" >
    update icon_zip
    set zip = #{zip,jdbcType=VARCHAR},
      platform = #{platform,jdbcType=VARCHAR},
      status = #{status,jdbcType=TINYINT},
      update_time = UNIX_TIMESTAMP()
    where id = #{id,jdbcType=INTEGER}
  </update>

  <select id="selectSelective" resultMap="BaseResultMap" parameterType="com.yohobuy.platform.dal.cms.model.IconZip" >
    select
    <include refid="Base_Column_List" />
    from icon_zip
    <trim prefix="where" prefixOverrides="and | or">
      <if test="platform != null" >
        and platform = #{platform}
      </if>
      <if test="status != null and (status == 1 || status == 0)" >
        and status = #{status}
      </if>
    </trim>
  </select>

</mapper>