<?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.GoodssizeMapper" >
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.Goodssize" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Mar 11 16:29:10 CST 2015.
    -->
    <id column="GoodsSizeID" property="goodssizeid" jdbcType="INTEGER" />
    <result column="GoodsID" property="goodsid" jdbcType="VARCHAR" />
    <result column="SizeID" property="sizeid" jdbcType="VARCHAR" />
    <result column="SizeGroupID" property="sizegroupid" jdbcType="VARCHAR" />
  </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 Mar 11 16:29: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 Wed Mar 11 16:29:10 CST 2015.
    -->
    GoodsSizeID, GoodsID, SizeID, SizeGroupID
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.GoodssizeExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Mar 11 16:29:10 CST 2015.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from GoodsSize
    <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="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Mar 11 16:29:10 CST 2015.
    -->
    select 
    <include refid="Base_Column_List" />
    from GoodsSize
    where GoodsSizeID = #{goodssizeid,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 Wed Mar 11 16:29:10 CST 2015.
    -->
    delete from GoodsSize
    where GoodsSizeID = #{goodssizeid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.Goodssize" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Mar 11 16:29:10 CST 2015.
    -->
    insert into GoodsSize (GoodsSizeID, GoodsID, SizeID, 
      SizeGroupID)
    values (#{goodssizeid,jdbcType=INTEGER}, #{goodsid,jdbcType=VARCHAR}, #{sizeid,jdbcType=VARCHAR}, 
      #{sizegroupid,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.Goodssize" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Mar 11 16:29:10 CST 2015.
    -->
    insert into GoodsSize
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="goodssizeid != null" >
        GoodsSizeID,
      </if>
      <if test="goodsid != null" >
        GoodsID,
      </if>
      <if test="sizeid != null" >
        SizeID,
      </if>
      <if test="sizegroupid != null" >
        SizeGroupID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="goodssizeid != null" >
        #{goodssizeid,jdbcType=INTEGER},
      </if>
      <if test="goodsid != null" >
        #{goodsid,jdbcType=VARCHAR},
      </if>
      <if test="sizeid != null" >
        #{sizeid,jdbcType=VARCHAR},
      </if>
      <if test="sizegroupid != null" >
        #{sizegroupid,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.GoodssizeExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Mar 11 16:29:10 CST 2015.
    -->
    select count(*) from GoodsSize
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.Goodssize" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Mar 11 16:29:10 CST 2015.
    -->
    update GoodsSize
    <set >
      <if test="goodsid != null" >
        GoodsID = #{goodsid,jdbcType=VARCHAR},
      </if>
      <if test="sizeid != null" >
        SizeID = #{sizeid,jdbcType=VARCHAR},
      </if>
      <if test="sizegroupid != null" >
        SizeGroupID = #{sizegroupid,jdbcType=VARCHAR},
      </if>
    </set>
    where GoodsSizeID = #{goodssizeid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.Goodssize" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Mar 11 16:29:10 CST 2015.
    -->
    update GoodsSize
    set GoodsID = #{goodsid,jdbcType=VARCHAR},
      SizeID = #{sizeid,jdbcType=VARCHAR},
      SizeGroupID = #{sizegroupid,jdbcType=VARCHAR}
    where GoodsSizeID = #{goodssizeid,jdbcType=INTEGER}
  </update>
  
  <select id="getMaxGoodsSize" resultType="java.lang.Integer" >
   select max(GoodsSizeID) + 1     
    from GoodsSize
  </select>
</mapper>