ProductInfoMapper.xml 6.4 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.product.dal.ProductInfoMapper" >
  <resultMap id="BaseResultMap" type="com.yoho.product.model.ProductInfo" >
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="product_url" property="productUrl" jdbcType="VARCHAR" />
    <result column="color" property="color" jdbcType="VARCHAR" />
    <result column="size" property="size" jdbcType="VARCHAR" />
    <result column="goods_no" property="goodsNo" jdbcType="VARCHAR" />
    <result column="source" property="source" jdbcType="VARCHAR" />
    <result column="owner" property="owner" jdbcType="VARCHAR" />
    <result column="transaction_time" property="transactionTime" jdbcType="VARCHAR" />
    <result column="tagid" property="tagid" jdbcType="VARCHAR" />
    <result column="sign" property="sign" jdbcType="VARCHAR" />
    <result column="isupload" property="isupload" jdbcType="INTEGER" />
    <result column="auth_time" property="authTime" jdbcType="VARCHAR" />
    <result column="last_transaction_id" property="lastTransactionId" jdbcType="VARCHAR" />
    <result column="from_platform" property="fromPlatform" jdbcType="TINYINT" />
    <result column="nfcid" property="nfcid" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, product_url, color, size, goods_no, source, owner, transaction_time, tagid, sign, 
    isupload, auth_time, last_transaction_id, from_platform, nfcid
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from product_info
    where id = #{id,jdbcType=BIGINT}
  </select>

  <select id="selectIsuploadIsZero" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
      from product_info
      where isupload = 0 limit 200
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from product_info
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insertProductInfo" parameterType="com.yoho.product.model.ProductInfo" >
    insert into product_info (id, product_url, color, 
      size, goods_no, source, 
      owner, transaction_time, tagid, 
      sign, isupload, auth_time, 
      last_transaction_id, from_platform, nfcid
      )
    values (#{id,jdbcType=BIGINT}, #{productUrl,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, 
      #{size,jdbcType=VARCHAR}, #{goodsNo,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, 
      #{owner,jdbcType=VARCHAR}, #{transactionTime,jdbcType=VARCHAR}, #{tagid,jdbcType=VARCHAR}, 
      #{sign,jdbcType=VARCHAR}, #{isupload,jdbcType=INTEGER}, #{authTime,jdbcType=VARCHAR}, 
      #{lastTransactionId,jdbcType=VARCHAR}, #{fromPlatform,jdbcType=TINYINT}, #{nfcid,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.yoho.product.model.ProductInfo" >
    insert into product_info
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="productUrl != null" >
        product_url,
      </if>
      <if test="color != null" >
        color,
      </if>
      <if test="size != null" >
        size,
      </if>
      <if test="goodsNo != null" >
        goods_no,
      </if>
      <if test="source != null" >
        source,
      </if>
      <if test="owner != null" >
        owner,
      </if>
      <if test="transactionTime != null" >
        transaction_time,
      </if>
      <if test="tagid != null" >
        tagid,
      </if>
      <if test="sign != null" >
        sign,
      </if>
      <if test="isupload != null" >
        isupload,
      </if>
      <if test="authTime != null" >
        auth_time,
      </if>
      <if test="lastTransactionId != null" >
        last_transaction_id,
      </if>
      <if test="fromPlatform != null" >
        from_platform,
      </if>
      <if test="nfcid != null" >
        nfcid,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="productUrl != null" >
        #{productUrl,jdbcType=VARCHAR},
      </if>
      <if test="color != null" >
        #{color,jdbcType=VARCHAR},
      </if>
      <if test="size != null" >
        #{size,jdbcType=VARCHAR},
      </if>
      <if test="goodsNo != null" >
        #{goodsNo,jdbcType=VARCHAR},
      </if>
      <if test="source != null" >
        #{source,jdbcType=VARCHAR},
      </if>
      <if test="owner != null" >
        #{owner,jdbcType=VARCHAR},
      </if>
      <if test="transactionTime != null" >
        #{transactionTime,jdbcType=VARCHAR},
      </if>
      <if test="tagid != null" >
        #{tagid,jdbcType=VARCHAR},
      </if>
      <if test="sign != null" >
        #{sign,jdbcType=VARCHAR},
      </if>
      <if test="isupload != null" >
        #{isupload,jdbcType=INTEGER},
      </if>
      <if test="authTime != null" >
        #{authTime,jdbcType=VARCHAR},
      </if>
      <if test="lastTransactionId != null" >
        #{lastTransactionId,jdbcType=VARCHAR},
      </if>
      <if test="fromPlatform != null" >
        #{fromPlatform,jdbcType=TINYINT},
      </if>
      <if test="nfcid != null" >
        #{nfcid,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateIsupload" parameterType="com.yoho.product.model.ProductInfo" >
    update product_info
    <set >
      <if test="isupload != null" >
        isupload = #{isupload,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yoho.product.model.ProductInfo" >
    update product_info
    set product_url = #{productUrl,jdbcType=VARCHAR},
      color = #{color,jdbcType=VARCHAR},
      size = #{size,jdbcType=VARCHAR},
      goods_no = #{goodsNo,jdbcType=VARCHAR},
      source = #{source,jdbcType=VARCHAR},
      owner = #{owner,jdbcType=VARCHAR},
      transaction_time = #{transactionTime,jdbcType=VARCHAR},
      tagid = #{tagid,jdbcType=VARCHAR},
      sign = #{sign,jdbcType=VARCHAR},
      isupload = #{isupload,jdbcType=INTEGER},
      auth_time = #{authTime,jdbcType=VARCHAR},
      last_transaction_id = #{lastTransactionId,jdbcType=VARCHAR},
      from_platform = #{fromPlatform,jdbcType=TINYINT},
      nfcid = #{nfcid,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>