<?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.DeductsalespointMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.Deductsalespoint">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    <id column="DeductSalesPointID" jdbcType="INTEGER" property="deductsalespointid" />
    <result column="VIPID" jdbcType="VARCHAR" property="vipid" />
    <result column="DeductSalesPoint" jdbcType="DECIMAL" property="deductsalespoint" />
    <result column="DeductReason" jdbcType="VARCHAR" property="deductreason" />
    <result column="DeductDate" jdbcType="TIMESTAMP" property="deductdate" />
    <result column="Editor" jdbcType="VARCHAR" property="editor" />
    <result column="POSSalesID" jdbcType="VARCHAR" property="possalesid" />
    <result column="POSSalesNo" jdbcType="VARCHAR" property="possalesno" />
    <result column="DepartmentID" jdbcType="VARCHAR" property="departmentid" />
    <result column="Style" jdbcType="TINYINT" property="style" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    <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 Fri Dec 23 11:31:14 CST 2016.
    -->
    DeductSalesPointID, VIPID, DeductSalesPoint, DeductReason, DeductDate, Editor, POSSalesID, 
    POSSalesNo, DepartmentID, Style
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.DeductsalespointExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from DeductSalesPoint
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    select 
    <include refid="Base_Column_List" />
    from DeductSalesPoint
    where DeductSalesPointID = #{deductsalespointid,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    delete from DeductSalesPoint
    where DeductSalesPointID = #{deductsalespointid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.Deductsalespoint">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    insert into DeductSalesPoint (DeductSalesPointID, VIPID, DeductSalesPoint, 
      DeductReason, DeductDate, Editor, 
      POSSalesID, POSSalesNo, DepartmentID, 
      Style)
    values (#{deductsalespointid,jdbcType=INTEGER}, #{vipid,jdbcType=VARCHAR}, #{deductsalespoint,jdbcType=DECIMAL}, 
      #{deductreason,jdbcType=VARCHAR}, #{deductdate,jdbcType=TIMESTAMP}, #{editor,jdbcType=VARCHAR}, 
      #{possalesid,jdbcType=VARCHAR}, #{possalesno,jdbcType=VARCHAR}, #{departmentid,jdbcType=VARCHAR}, 
      #{style,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.Deductsalespoint">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    insert into DeductSalesPoint
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="deductsalespointid != null">
        DeductSalesPointID,
      </if>
      <if test="vipid != null">
        VIPID,
      </if>
      <if test="deductsalespoint != null">
        DeductSalesPoint,
      </if>
      <if test="deductreason != null">
        DeductReason,
      </if>
      <if test="deductdate != null">
        DeductDate,
      </if>
      <if test="editor != null">
        Editor,
      </if>
      <if test="possalesid != null">
        POSSalesID,
      </if>
      <if test="possalesno != null">
        POSSalesNo,
      </if>
      <if test="departmentid != null">
        DepartmentID,
      </if>
      <if test="style != null">
        Style,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="deductsalespointid != null">
        #{deductsalespointid,jdbcType=INTEGER},
      </if>
      <if test="vipid != null">
        #{vipid,jdbcType=VARCHAR},
      </if>
      <if test="deductsalespoint != null">
        #{deductsalespoint,jdbcType=DECIMAL},
      </if>
      <if test="deductreason != null">
        #{deductreason,jdbcType=VARCHAR},
      </if>
      <if test="deductdate != null">
        #{deductdate,jdbcType=TIMESTAMP},
      </if>
      <if test="editor != null">
        #{editor,jdbcType=VARCHAR},
      </if>
      <if test="possalesid != null">
        #{possalesid,jdbcType=VARCHAR},
      </if>
      <if test="possalesno != null">
        #{possalesno,jdbcType=VARCHAR},
      </if>
      <if test="departmentid != null">
        #{departmentid,jdbcType=VARCHAR},
      </if>
      <if test="style != null">
        #{style,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.DeductsalespointExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    select count(*) from DeductSalesPoint
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.Deductsalespoint">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    update DeductSalesPoint
    <set>
      <if test="vipid != null">
        VIPID = #{vipid,jdbcType=VARCHAR},
      </if>
      <if test="deductsalespoint != null">
        DeductSalesPoint = #{deductsalespoint,jdbcType=DECIMAL},
      </if>
      <if test="deductreason != null">
        DeductReason = #{deductreason,jdbcType=VARCHAR},
      </if>
      <if test="deductdate != null">
        DeductDate = #{deductdate,jdbcType=TIMESTAMP},
      </if>
      <if test="editor != null">
        Editor = #{editor,jdbcType=VARCHAR},
      </if>
      <if test="possalesid != null">
        POSSalesID = #{possalesid,jdbcType=VARCHAR},
      </if>
      <if test="possalesno != null">
        POSSalesNo = #{possalesno,jdbcType=VARCHAR},
      </if>
      <if test="departmentid != null">
        DepartmentID = #{departmentid,jdbcType=VARCHAR},
      </if>
      <if test="style != null">
        Style = #{style,jdbcType=TINYINT},
      </if>
    </set>
    where DeductSalesPointID = #{deductsalespointid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.Deductsalespoint">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Dec 23 11:31:14 CST 2016.
    -->
    update DeductSalesPoint
    set VIPID = #{vipid,jdbcType=VARCHAR},
      DeductSalesPoint = #{deductsalespoint,jdbcType=DECIMAL},
      DeductReason = #{deductreason,jdbcType=VARCHAR},
      DeductDate = #{deductdate,jdbcType=TIMESTAMP},
      Editor = #{editor,jdbcType=VARCHAR},
      POSSalesID = #{possalesid,jdbcType=VARCHAR},
      POSSalesNo = #{possalesno,jdbcType=VARCHAR},
      DepartmentID = #{departmentid,jdbcType=VARCHAR},
      Style = #{style,jdbcType=TINYINT}
    where DeductSalesPointID = #{deductsalespointid,jdbcType=INTEGER}
  </update>
</mapper>