UnionShareOrdersActivityPagePreMapper.xml 3.8 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.unions.dal.UnionShareOrdersActivityPagePreMapper" >
  <resultMap id="BaseResultMap" type="com.yoho.unions.dal.model.UnionShareOrdersActivityPagePre" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="uid" property="uid" jdbcType="INTEGER" />
    <result column="activity_id" property="activityId" jdbcType="INTEGER" />
    <result column="page_id" property="pageId" jdbcType="INTEGER" />
    <result column="create_time" property="createTime" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, uid, activity_id, page_id, create_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from union_share_orders_activity_page_pre
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectByUidAndPageId" resultMap="BaseResultMap"  >
    select
    <include refid="Base_Column_List" />
    from union_share_orders_activity_page_pre
    where page_id = #{pageId,jdbcType=INTEGER} and uid = #{uid,jdbcType=INTEGER}
    limit 1
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from union_share_orders_activity_page_pre
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.yoho.unions.dal.model.UnionShareOrdersActivityPagePre" >
    insert into union_share_orders_activity_page_pre (id, uid, activity_id, 
      page_id, create_time)
    values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, 
      #{pageId,jdbcType=INTEGER}, #{createTime,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.yoho.unions.dal.model.UnionShareOrdersActivityPagePre" >
    insert into union_share_orders_activity_page_pre
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="uid != null" >
        uid,
      </if>
      <if test="activityId != null" >
        activity_id,
      </if>
      <if test="pageId != null" >
        page_id,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="uid != null" >
        #{uid,jdbcType=INTEGER},
      </if>
      <if test="activityId != null" >
        #{activityId,jdbcType=INTEGER},
      </if>
      <if test="pageId != null" >
        #{pageId,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yoho.unions.dal.model.UnionShareOrdersActivityPagePre" >
    update union_share_orders_activity_page_pre
    <set >
      <if test="uid != null" >
        uid = #{uid,jdbcType=INTEGER},
      </if>
      <if test="activityId != null" >
        activity_id = #{activityId,jdbcType=INTEGER},
      </if>
      <if test="pageId != null" >
        page_id = #{pageId,jdbcType=INTEGER},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.UnionShareOrdersActivityPagePre" >
    update union_share_orders_activity_page_pre
    set uid = #{uid,jdbcType=INTEGER},
      activity_id = #{activityId,jdbcType=INTEGER},
      page_id = #{pageId,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>