<?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.WProfitsenddtlMapper" >
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WProfitsenddtl" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    <id column="EShopOrderID" property="eshoporderid" jdbcType="INTEGER" />
    <id column="POSSalesID" property="possalesid" jdbcType="VARCHAR" />
    <id column="GoodsID" property="goodsid" jdbcType="VARCHAR" />
    <result column="TotalSale" property="totalsale" jdbcType="DECIMAL" />
    <result column="DepartmentID" property="departmentid" jdbcType="VARCHAR" />
    <result column="ProfitRate" property="profitrate" jdbcType="DECIMAL" />
    <result column="Profit" property="profit" jdbcType="DECIMAL" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" 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 Sun Feb 08 16:50:10 CST 2015.
    -->
    EShopOrderID, POSSalesID, GoodsID, TotalSale, DepartmentID, ProfitRate, Profit
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.WProfitsenddtlExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_ProfitSendDtl
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.WProfitsenddtlKey" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    select 
    <include refid="Base_Column_List" />
    from W_ProfitSendDtl
    where EShopOrderID = #{eshoporderid,jdbcType=INTEGER}
      and POSSalesID = #{possalesid,jdbcType=VARCHAR}
      and GoodsID = #{goodsid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WProfitsenddtlKey" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    delete from W_ProfitSendDtl
    where EShopOrderID = #{eshoporderid,jdbcType=INTEGER}
      and POSSalesID = #{possalesid,jdbcType=VARCHAR}
      and GoodsID = #{goodsid,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WProfitsenddtl" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    insert into W_ProfitSendDtl (EShopOrderID, POSSalesID, GoodsID, 
      TotalSale, DepartmentID, ProfitRate, 
      Profit)
    values (#{eshoporderid,jdbcType=INTEGER}, #{possalesid,jdbcType=VARCHAR}, #{goodsid,jdbcType=VARCHAR}, 
      #{totalsale,jdbcType=DECIMAL}, #{departmentid,jdbcType=VARCHAR}, #{profitrate,jdbcType=DECIMAL}, 
      #{profit,jdbcType=DECIMAL})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WProfitsenddtl" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    insert into W_ProfitSendDtl
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="eshoporderid != null" >
        EShopOrderID,
      </if>
      <if test="possalesid != null" >
        POSSalesID,
      </if>
      <if test="goodsid != null" >
        GoodsID,
      </if>
      <if test="totalsale != null" >
        TotalSale,
      </if>
      <if test="departmentid != null" >
        DepartmentID,
      </if>
      <if test="profitrate != null" >
        ProfitRate,
      </if>
      <if test="profit != null" >
        Profit,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="eshoporderid != null" >
        #{eshoporderid,jdbcType=INTEGER},
      </if>
      <if test="possalesid != null" >
        #{possalesid,jdbcType=VARCHAR},
      </if>
      <if test="goodsid != null" >
        #{goodsid,jdbcType=VARCHAR},
      </if>
      <if test="totalsale != null" >
        #{totalsale,jdbcType=DECIMAL},
      </if>
      <if test="departmentid != null" >
        #{departmentid,jdbcType=VARCHAR},
      </if>
      <if test="profitrate != null" >
        #{profitrate,jdbcType=DECIMAL},
      </if>
      <if test="profit != null" >
        #{profit,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WProfitsenddtlExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    select count(*) from W_ProfitSendDtl
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WProfitsenddtl" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    update W_ProfitSendDtl
    <set >
      <if test="totalsale != null" >
        TotalSale = #{totalsale,jdbcType=DECIMAL},
      </if>
      <if test="departmentid != null" >
        DepartmentID = #{departmentid,jdbcType=VARCHAR},
      </if>
      <if test="profitrate != null" >
        ProfitRate = #{profitrate,jdbcType=DECIMAL},
      </if>
      <if test="profit != null" >
        Profit = #{profit,jdbcType=DECIMAL},
      </if>
    </set>
    where EShopOrderID = #{eshoporderid,jdbcType=INTEGER}
      and POSSalesID = #{possalesid,jdbcType=VARCHAR}
      and GoodsID = #{goodsid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WProfitsenddtl" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Sun Feb 08 16:50:10 CST 2015.
    -->
    update W_ProfitSendDtl
    set TotalSale = #{totalsale,jdbcType=DECIMAL},
      DepartmentID = #{departmentid,jdbcType=VARCHAR},
      ProfitRate = #{profitrate,jdbcType=DECIMAL},
      Profit = #{profit,jdbcType=DECIMAL}
    where EShopOrderID = #{eshoporderid,jdbcType=INTEGER}
      and POSSalesID = #{possalesid,jdbcType=VARCHAR}
      and GoodsID = #{goodsid,jdbcType=VARCHAR}
  </update>
</mapper>