<?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.fuxi.ws.data.dao.WPaymentsMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WPayments">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    <id column="PromotionsID" jdbcType="INTEGER" property="promotionsid" />
    <id column="PaymentID" jdbcType="TINYINT" property="paymentid" />
    <result column="Payment" jdbcType="DECIMAL" property="payment" />
    <result column="Discount" jdbcType="DECIMAL" property="discount" />
    <result column="BillID" jdbcType="BIGINT" property="billid" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    PromotionsID, PaymentID, Payment, Discount, BillID
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.WPaymentsExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_Payments
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WPaymentsKey" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    select 
    <include refid="Base_Column_List" />
    from W_Payments
    where PromotionsID = #{promotionsid,jdbcType=INTEGER}
      and PaymentID = #{paymentid,jdbcType=TINYINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WPaymentsKey">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    delete from W_Payments
    where PromotionsID = #{promotionsid,jdbcType=INTEGER}
      and PaymentID = #{paymentid,jdbcType=TINYINT}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WPayments">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    insert into W_Payments (PromotionsID, PaymentID, Payment, 
      Discount, BillID)
    values (#{promotionsid,jdbcType=INTEGER}, #{paymentid,jdbcType=TINYINT}, #{payment,jdbcType=DECIMAL}, 
      #{discount,jdbcType=DECIMAL}, #{billid,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WPayments">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    insert into W_Payments
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="promotionsid != null">
        PromotionsID,
      </if>
      <if test="paymentid != null">
        PaymentID,
      </if>
      <if test="payment != null">
        Payment,
      </if>
      <if test="discount != null">
        Discount,
      </if>
      <if test="billid != null">
        BillID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="promotionsid != null">
        #{promotionsid,jdbcType=INTEGER},
      </if>
      <if test="paymentid != null">
        #{paymentid,jdbcType=TINYINT},
      </if>
      <if test="payment != null">
        #{payment,jdbcType=DECIMAL},
      </if>
      <if test="discount != null">
        #{discount,jdbcType=DECIMAL},
      </if>
      <if test="billid != null">
        #{billid,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WPaymentsExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    select count(*) from W_Payments
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WPayments">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    update W_Payments
    <set>
      <if test="payment != null">
        Payment = #{payment,jdbcType=DECIMAL},
      </if>
      <if test="discount != null">
        Discount = #{discount,jdbcType=DECIMAL},
      </if>
      <if test="billid != null">
        BillID = #{billid,jdbcType=BIGINT},
      </if>
    </set>
    where PromotionsID = #{promotionsid,jdbcType=INTEGER}
      and PaymentID = #{paymentid,jdbcType=TINYINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WPayments">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Sep 13 11:36:12 CST 2017.
    -->
    update W_Payments
    set Payment = #{payment,jdbcType=DECIMAL},
      Discount = #{discount,jdbcType=DECIMAL},
      BillID = #{billid,jdbcType=BIGINT}
    where PromotionsID = #{promotionsid,jdbcType=INTEGER}
      and PaymentID = #{paymentid,jdbcType=TINYINT}
  </update>
</mapper>