<?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.ColorMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.Color">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 CST 2016.
    -->
    <id column="ColorID" jdbcType="VARCHAR" property="colorid" />
    <result column="No" jdbcType="VARCHAR" property="no" />
    <result column="Color" jdbcType="VARCHAR" property="color" />
    <result column="UseFlag" jdbcType="BIT" property="useflag" />
    <result column="Memo" jdbcType="VARCHAR" property="memo" />
    <result column="StopFlag" jdbcType="BIT" property="stopflag" />
    <result column="Color_EShop" jdbcType="VARCHAR" property="colorEshop" />
    <result column="HelpCode" jdbcType="VARCHAR" property="helpcode" />
    <result column="SupplierID" jdbcType="INTEGER" property="supplierid" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 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 Tue Dec 06 17:32:33 CST 2016.
    -->
    ColorID, No, Color, UseFlag, Memo, StopFlag, Color_EShop, HelpCode, SupplierID
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.ColorExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 CST 2016.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from Color
    <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.String" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 CST 2016.
    -->
    select 
    <include refid="Base_Column_List" />
    from Color
    where ColorID = #{colorid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 CST 2016.
    -->
    delete from Color
    where ColorID = #{colorid,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.Color">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 CST 2016.
    -->
    insert into Color (ColorID, No, Color, 
      UseFlag, Memo, StopFlag, Color_EShop, 
      HelpCode, SupplierID)
    values (#{colorid,jdbcType=VARCHAR}, #{no,jdbcType=VARCHAR}, #{color,jdbcType=VARCHAR}, 
      #{useflag,jdbcType=BIT}, #{memo,jdbcType=VARCHAR}, #{stopflag,jdbcType=BIT}, #{colorEshop,jdbcType=VARCHAR}, 
      #{helpcode,jdbcType=VARCHAR}, #{supplierid,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.Color">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 CST 2016.
    -->
    insert into Color
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="colorid != null">
        ColorID,
      </if>
      <if test="no != null">
        No,
      </if>
      <if test="color != null">
        Color,
      </if>
      <if test="useflag != null">
        UseFlag,
      </if>
      <if test="memo != null">
        Memo,
      </if>
      <if test="stopflag != null">
        StopFlag,
      </if>
      <if test="colorEshop != null">
        Color_EShop,
      </if>
      <if test="helpcode != null">
        HelpCode,
      </if>
      <if test="supplierid != null">
        SupplierID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="colorid != null">
        #{colorid,jdbcType=VARCHAR},
      </if>
      <if test="no != null">
        #{no,jdbcType=VARCHAR},
      </if>
      <if test="color != null">
        #{color,jdbcType=VARCHAR},
      </if>
      <if test="useflag != null">
        #{useflag,jdbcType=BIT},
      </if>
      <if test="memo != null">
        #{memo,jdbcType=VARCHAR},
      </if>
      <if test="stopflag != null">
        #{stopflag,jdbcType=BIT},
      </if>
      <if test="colorEshop != null">
        #{colorEshop,jdbcType=VARCHAR},
      </if>
      <if test="helpcode != null">
        #{helpcode,jdbcType=VARCHAR},
      </if>
      <if test="supplierid != null">
        #{supplierid,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.ColorExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 CST 2016.
    -->
    select count(*) from Color
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.Color">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 CST 2016.
    -->
    update Color
    <set>
      <if test="no != null">
        No = #{no,jdbcType=VARCHAR},
      </if>
      <if test="color != null">
        Color = #{color,jdbcType=VARCHAR},
      </if>
      <if test="useflag != null">
        UseFlag = #{useflag,jdbcType=BIT},
      </if>
      <if test="memo != null">
        Memo = #{memo,jdbcType=VARCHAR},
      </if>
      <if test="stopflag != null">
        StopFlag = #{stopflag,jdbcType=BIT},
      </if>
      <if test="colorEshop != null">
        Color_EShop = #{colorEshop,jdbcType=VARCHAR},
      </if>
      <if test="helpcode != null">
        HelpCode = #{helpcode,jdbcType=VARCHAR},
      </if>
      <if test="supplierid != null">
        SupplierID = #{supplierid,jdbcType=INTEGER},
      </if>
    </set>
    where ColorID = #{colorid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.Color">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Dec 06 17:32:33 CST 2016.
    -->
    update Color
    set No = #{no,jdbcType=VARCHAR},
      Color = #{color,jdbcType=VARCHAR},
      UseFlag = #{useflag,jdbcType=BIT},
      Memo = #{memo,jdbcType=VARCHAR},
      StopFlag = #{stopflag,jdbcType=BIT},
      Color_EShop = #{colorEshop,jdbcType=VARCHAR},
      HelpCode = #{helpcode,jdbcType=VARCHAR},
      SupplierID = #{supplierid,jdbcType=INTEGER}
    where ColorID = #{colorid,jdbcType=VARCHAR}
  </update>
  
  <!-- 颜色列表 -->
  <select id="colorlist" resultType="java.util.LinkedHashMap">
		select
		   ColorID, 
		   No,
		   Color  
		from Color 
        <if test="conditions != null and conditions != ''">
			where
			${conditions}
		</if>
		order by No,Color
	</select>
  
  <!-- 尺码列表 -->
  <select id="sizelist" resultType="java.util.LinkedHashMap">
		select
		   SizeID, 
		   No,
		   Size  
		from Size 
        <if test="conditions != null and conditions != ''">
			where
			${conditions}
		</if>
		order by No,Size
	</select>
</mapper>