<?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.WdOrdersdtlMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WdOrdersdtl">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 CST 2016.
    -->
    <id column="OrderID" jdbcType="BIGINT" property="orderid" />
    <id column="GoodsID" jdbcType="VARCHAR" property="goodsid" />
    <id column="ColorID" jdbcType="VARCHAR" property="colorid" />
    <id column="SizeID" jdbcType="VARCHAR" property="sizeid" />
    <result column="EmployeeID" jdbcType="VARCHAR" property="employeeid" />
    <result column="EmpName" jdbcType="VARCHAR" property="empname" />
    <result column="GoodsType" jdbcType="NVARCHAR" property="goodstype" />
    <result column="Code" jdbcType="VARCHAR" property="code" />
    <result column="GoodName" jdbcType="NVARCHAR" property="goodname" />
    <result column="Color" jdbcType="VARCHAR" property="color" />
    <result column="Size" jdbcType="VARCHAR" property="size" />
    <result column="ImgPath" jdbcType="NVARCHAR" property="imgpath" />
    <result column="Quantity" jdbcType="INTEGER" property="quantity" />
    <result column="Price" jdbcType="DECIMAL" property="price" />
    <result column="Amount" jdbcType="DECIMAL" property="amount" />
    <result column="AllotSales" jdbcType="DECIMAL" property="allotsales" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 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 Thu Aug 18 16:01:55 CST 2016.
    -->
    OrderID, GoodsID, ColorID, SizeID, EmployeeID, EmpName, GoodsType, Code, GoodName, 
    Color, Size, ImgPath, Quantity, Price, Amount, AllotSales
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.WdOrdersdtlExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 CST 2016.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from WD_Ordersdtl
    <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.WdOrdersdtlKey" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 CST 2016.
    -->
    select 
    <include refid="Base_Column_List" />
    from WD_Ordersdtl
    where OrderID = #{orderid,jdbcType=BIGINT}
      and GoodsID = #{goodsid,jdbcType=VARCHAR}
      and ColorID = #{colorid,jdbcType=VARCHAR}
      and SizeID = #{sizeid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WdOrdersdtlKey">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 CST 2016.
    -->
    delete from WD_Ordersdtl
    where OrderID = #{orderid,jdbcType=BIGINT}
      and GoodsID = #{goodsid,jdbcType=VARCHAR}
      and ColorID = #{colorid,jdbcType=VARCHAR}
      and SizeID = #{sizeid,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WdOrdersdtl">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 CST 2016.
    -->
    insert into WD_Ordersdtl (OrderID, GoodsID, ColorID, 
      SizeID, EmployeeID, EmpName, 
      GoodsType, Code, GoodName, 
      Color, Size, ImgPath, 
      Quantity, Price, Amount, 
      AllotSales)
    values (#{orderid,jdbcType=BIGINT}, #{goodsid,jdbcType=VARCHAR}, #{colorid,jdbcType=VARCHAR}, 
      #{sizeid,jdbcType=VARCHAR}, #{employeeid,jdbcType=VARCHAR}, #{empname,jdbcType=VARCHAR}, 
      #{goodstype,jdbcType=NVARCHAR}, #{code,jdbcType=VARCHAR}, #{goodname,jdbcType=NVARCHAR}, 
      #{color,jdbcType=VARCHAR}, #{size,jdbcType=VARCHAR}, #{imgpath,jdbcType=NVARCHAR}, 
      #{quantity,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{amount,jdbcType=DECIMAL}, 
      #{allotsales,jdbcType=DECIMAL})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WdOrdersdtl">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 CST 2016.
    -->
    insert into WD_Ordersdtl
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="orderid != null">
        OrderID,
      </if>
      <if test="goodsid != null">
        GoodsID,
      </if>
      <if test="colorid != null">
        ColorID,
      </if>
      <if test="sizeid != null">
        SizeID,
      </if>
      <if test="employeeid != null">
        EmployeeID,
      </if>
      <if test="empname != null">
        EmpName,
      </if>
      <if test="goodstype != null">
        GoodsType,
      </if>
      <if test="code != null">
        Code,
      </if>
      <if test="goodname != null">
        GoodName,
      </if>
      <if test="color != null">
        Color,
      </if>
      <if test="size != null">
        Size,
      </if>
      <if test="imgpath != null">
        ImgPath,
      </if>
      <if test="quantity != null">
        Quantity,
      </if>
      <if test="price != null">
        Price,
      </if>
      <if test="amount != null">
        Amount,
      </if>
      <if test="allotsales != null">
        AllotSales,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="orderid != null">
        #{orderid,jdbcType=BIGINT},
      </if>
      <if test="goodsid != null">
        #{goodsid,jdbcType=VARCHAR},
      </if>
      <if test="colorid != null">
        #{colorid,jdbcType=VARCHAR},
      </if>
      <if test="sizeid != null">
        #{sizeid,jdbcType=VARCHAR},
      </if>
      <if test="employeeid != null">
        #{employeeid,jdbcType=VARCHAR},
      </if>
      <if test="empname != null">
        #{empname,jdbcType=VARCHAR},
      </if>
      <if test="goodstype != null">
        #{goodstype,jdbcType=NVARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="goodname != null">
        #{goodname,jdbcType=NVARCHAR},
      </if>
      <if test="color != null">
        #{color,jdbcType=VARCHAR},
      </if>
      <if test="size != null">
        #{size,jdbcType=VARCHAR},
      </if>
      <if test="imgpath != null">
        #{imgpath,jdbcType=NVARCHAR},
      </if>
      <if test="quantity != null">
        #{quantity,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        #{price,jdbcType=DECIMAL},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DECIMAL},
      </if>
      <if test="allotsales != null">
        #{allotsales,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WdOrdersdtlExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 CST 2016.
    -->
    select count(*) from WD_Ordersdtl
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WdOrdersdtl">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 CST 2016.
    -->
    update WD_Ordersdtl
    <set>
      <if test="employeeid != null">
        EmployeeID = #{employeeid,jdbcType=VARCHAR},
      </if>
      <if test="empname != null">
        EmpName = #{empname,jdbcType=VARCHAR},
      </if>
      <if test="goodstype != null">
        GoodsType = #{goodstype,jdbcType=NVARCHAR},
      </if>
      <if test="code != null">
        Code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="goodname != null">
        GoodName = #{goodname,jdbcType=NVARCHAR},
      </if>
      <if test="color != null">
        Color = #{color,jdbcType=VARCHAR},
      </if>
      <if test="size != null">
        Size = #{size,jdbcType=VARCHAR},
      </if>
      <if test="imgpath != null">
        ImgPath = #{imgpath,jdbcType=NVARCHAR},
      </if>
      <if test="quantity != null">
        Quantity = #{quantity,jdbcType=INTEGER},
      </if>
      <if test="price != null">
        Price = #{price,jdbcType=DECIMAL},
      </if>
      <if test="amount != null">
        Amount = #{amount,jdbcType=DECIMAL},
      </if>
      <if test="allotsales != null">
        AllotSales = #{allotsales,jdbcType=DECIMAL},
      </if>
    </set>
    where OrderID = #{orderid,jdbcType=BIGINT}
      and GoodsID = #{goodsid,jdbcType=VARCHAR}
      and ColorID = #{colorid,jdbcType=VARCHAR}
      and SizeID = #{sizeid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WdOrdersdtl">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Aug 18 16:01:55 CST 2016.
    -->
    update WD_Ordersdtl
    set EmployeeID = #{employeeid,jdbcType=VARCHAR},
      EmpName = #{empname,jdbcType=VARCHAR},
      GoodsType = #{goodstype,jdbcType=NVARCHAR},
      Code = #{code,jdbcType=VARCHAR},
      GoodName = #{goodname,jdbcType=NVARCHAR},
      Color = #{color,jdbcType=VARCHAR},
      Size = #{size,jdbcType=VARCHAR},
      ImgPath = #{imgpath,jdbcType=NVARCHAR},
      Quantity = #{quantity,jdbcType=INTEGER},
      Price = #{price,jdbcType=DECIMAL},
      Amount = #{amount,jdbcType=DECIMAL},
      AllotSales = #{allotsales,jdbcType=DECIMAL}
    where OrderID = #{orderid,jdbcType=BIGINT}
      and GoodsID = #{goodsid,jdbcType=VARCHAR}
      and ColorID = #{colorid,jdbcType=VARCHAR}
      and SizeID = #{sizeid,jdbcType=VARCHAR}
  </update>
</mapper>