AppYearMemberBillMapper.xml 5.87 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.activity.dal.AppYearMemberBillMapper" >
  <resultMap id="BaseResultMap" type="com.yoho.activity.dal.model.AppYearMemberBill" >
    <id column="uid" property="uid" jdbcType="INTEGER" />
    <result column="order_num" property="orderNum" jdbcType="INTEGER" />
    <result column="buy_num" property="buyNum" jdbcType="INTEGER" />
    <result column="order_amount" property="orderAmount" jdbcType="INTEGER" />
    <result column="kilo" property="kilo" jdbcType="INTEGER" />
    <result column="score" property="score" jdbcType="INTEGER" />
    <result column="beat" property="beat" jdbcType="INTEGER" />
    <result column="nickname" property="nickname" jdbcType="VARCHAR" />
    <result column="phone" property="phone" jdbcType="VARCHAR" />
    <result column="year" property="year" jdbcType="VARCHAR" />
    <result column="email" property="email" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    uid, order_num, buy_num, order_amount, kilo, score, beat, nickname, phone, year,email
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from app_year_member_bill
    where uid = #{uid,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from app_year_member_bill
    where uid = #{uid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.yoho.activity.dal.model.AppYearMemberBill" >
    insert into app_year_member_bill (uid, order_num, buy_num, 
      order_amount, kilo, score, 
      beat, nickname, phone, 
      year,email)
    values (#{uid,jdbcType=INTEGER}, #{orderNum,jdbcType=INTEGER}, #{buyNum,jdbcType=INTEGER}, 
      #{orderAmount,jdbcType=INTEGER}, #{kilo,jdbcType=INTEGER}, #{score,jdbcType=INTEGER}, 
      #{beat,jdbcType=INTEGER}, #{nickname,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, 
      #{year,jdbcType=VARCHAR},#{email,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.yoho.activity.dal.model.AppYearMemberBill" >
    insert into app_year_member_bill
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="uid != null" >
        uid,
      </if>
      <if test="orderNum != null" >
        order_num,
      </if>
      <if test="buyNum != null" >
        buy_num,
      </if>
      <if test="orderAmount != null" >
        order_amount,
      </if>
      <if test="kilo != null" >
        kilo,
      </if>
      <if test="score != null" >
        score,
      </if>
      <if test="beat != null" >
        beat,
      </if>
      <if test="nickname != null" >
        nickname,
      </if>
      <if test="phone != null" >
        phone,
      </if>
      <if test="year != null" >
        year,
      </if>
      <if test="email != null" >
        email,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="uid != null" >
        #{uid,jdbcType=INTEGER},
      </if>
      <if test="orderNum != null" >
        #{orderNum,jdbcType=INTEGER},
      </if>
      <if test="buyNum != null" >
        #{buyNum,jdbcType=INTEGER},
      </if>
      <if test="orderAmount != null" >
        #{orderAmount,jdbcType=INTEGER},
      </if>
      <if test="kilo != null" >
        #{kilo,jdbcType=INTEGER},
      </if>
      <if test="score != null" >
        #{score,jdbcType=INTEGER},
      </if>
      <if test="beat != null" >
        #{beat,jdbcType=INTEGER},
      </if>
      <if test="nickname != null" >
        #{nickname,jdbcType=VARCHAR},
      </if>
      <if test="phone != null" >
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="year != null" >
        #{year,jdbcType=VARCHAR},
      </if>
      <if test="email != null" >
        #{email,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yoho.activity.dal.model.AppYearMemberBill" >
    update app_year_member_bill
    <set >
      <if test="orderNum != null" >
        order_num = #{orderNum,jdbcType=INTEGER},
      </if>
      <if test="buyNum != null" >
        buy_num = #{buyNum,jdbcType=INTEGER},
      </if>
      <if test="orderAmount != null" >
        order_amount = #{orderAmount,jdbcType=INTEGER},
      </if>
      <if test="kilo != null" >
        kilo = #{kilo,jdbcType=INTEGER},
      </if>
      <if test="score != null" >
        score = #{score,jdbcType=INTEGER},
      </if>
      <if test="beat != null" >
        beat = #{beat,jdbcType=INTEGER},
      </if>
      <if test="nickname != null" >
        nickname = #{nickname,jdbcType=VARCHAR},
      </if>
      <if test="phone != null" >
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="year != null" >
        year = #{year,jdbcType=VARCHAR},
      </if>
      <if test="email != null" >
        email = #{email,jdbcType=VARCHAR},
      </if>
    </set>
    where uid = #{uid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yoho.activity.dal.model.AppYearMemberBill" >
    update app_year_member_bill
    set order_num = #{orderNum,jdbcType=INTEGER},
      buy_num = #{buyNum,jdbcType=INTEGER},
      order_amount = #{orderAmount,jdbcType=INTEGER},
      kilo = #{kilo,jdbcType=INTEGER},
      score = #{score,jdbcType=INTEGER},
      beat = #{beat,jdbcType=INTEGER},
      nickname = #{nickname,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      year = #{year,jdbcType=VARCHAR},
      email = #{email,jdbcType=VARCHAR}
    where uid = #{uid,jdbcType=INTEGER}
  </update>
  <select id="selectByUidAndYear" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from app_year_member_bill
    where uid = #{uid,jdbcType=INTEGER} and year = #{year,jdbcType=VARCHAR} limit 1
  </select>

</mapper>