<?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.GoodscolorMapper">
	<resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.Goodscolor">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		<id column="GoodsID" property="goodsid" jdbcType="VARCHAR" />
		<id column="ColorID" property="colorid" jdbcType="VARCHAR" />
		<result column="Model1" property="model1" jdbcType="VARCHAR" />
		<result column="Model2" property="model2" jdbcType="VARCHAR" />
		<result column="Model3" property="model3" jdbcType="VARCHAR" />
		<result column="Model4" property="model4" jdbcType="VARCHAR" />
		<result column="Model5" property="model5" jdbcType="VARCHAR" />
		<result column="Model6" property="model6" jdbcType="VARCHAR" />
		<result column="Model7" property="model7" jdbcType="VARCHAR" />
		<result column="Model8" property="model8" jdbcType="VARCHAR" />
		<result column="Model9" property="model9" jdbcType="VARCHAR" />
		<result column="PurchasePrice" property="purchaseprice"
			jdbcType="DECIMAL" />
		<result column="StopFlag" property="stopflag" jdbcType="BIT" />
		<result column="Editor" property="editor" jdbcType="VARCHAR" />
		<result column="ModifyDate" property="modifydate" jdbcType="TIMESTAMP" />
	</resultMap>
	<sql id="Example_Where_Clause">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		<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 Mon Dec 08 
			12:34:44 CST 2014. -->
		GoodsID, ColorID, Model1, Model2, Model3, Model4, Model5, Model6,
		Model7, Model8,
		Model9, PurchasePrice, StopFlag, Editor, ModifyDate
	</sql>
	<select id="selectByExample" resultMap="BaseResultMap"
		parameterType="com.fuxi.ws.data.entity.GoodscolorExample">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		select
		<if test="distinct">
			distinct
		</if>
		'false' as QUERYID,
		<include refid="Base_Column_List" />
		from GoodsColor
		<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.GoodscolorKey">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		select
		<include refid="Base_Column_List" />
		from GoodsColor
		where GoodsID = #{goodsid,jdbcType=VARCHAR}
		and ColorID
		= #{colorid,jdbcType=VARCHAR}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="com.fuxi.ws.data.entity.GoodscolorKey">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		delete from GoodsColor
		where GoodsID = #{goodsid,jdbcType=VARCHAR}
		and
		ColorID = #{colorid,jdbcType=VARCHAR}
	</delete>
	<insert id="insert" parameterType="com.fuxi.ws.data.entity.Goodscolor">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		insert into GoodsColor (GoodsID, ColorID, Model1,
		Model2, Model3,
		Model4,
		Model5, Model6, Model7,
		Model8, Model9, PurchasePrice,
		StopFlag,
		Editor, ModifyDate
		)
		values (#{goodsid,jdbcType=VARCHAR},
		#{colorid,jdbcType=VARCHAR},
		#{model1,jdbcType=VARCHAR},
		#{model2,jdbcType=VARCHAR}, #{model3,jdbcType=VARCHAR},
		#{model4,jdbcType=VARCHAR},
		#{model5,jdbcType=VARCHAR},
		#{model6,jdbcType=VARCHAR},
		#{model7,jdbcType=VARCHAR},
		#{model8,jdbcType=VARCHAR}, #{model9,jdbcType=VARCHAR},
		#{purchaseprice,jdbcType=DECIMAL},
		#{stopflag,jdbcType=BIT},
		#{editor,jdbcType=VARCHAR},
		#{modifydate,jdbcType=TIMESTAMP}
		)
	</insert>
	<insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.Goodscolor">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		insert into GoodsColor
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="goodsid != null">
				GoodsID,
			</if>
			<if test="colorid != null">
				ColorID,
			</if>
			<if test="model1 != null">
				Model1,
			</if>
			<if test="model2 != null">
				Model2,
			</if>
			<if test="model3 != null">
				Model3,
			</if>
			<if test="model4 != null">
				Model4,
			</if>
			<if test="model5 != null">
				Model5,
			</if>
			<if test="model6 != null">
				Model6,
			</if>
			<if test="model7 != null">
				Model7,
			</if>
			<if test="model8 != null">
				Model8,
			</if>
			<if test="model9 != null">
				Model9,
			</if>
			<if test="purchaseprice != null">
				PurchasePrice,
			</if>
			<if test="stopflag != null">
				StopFlag,
			</if>
			<if test="editor != null">
				Editor,
			</if>
			<if test="modifydate != null">
				ModifyDate,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="goodsid != null">
				#{goodsid,jdbcType=VARCHAR},
			</if>
			<if test="colorid != null">
				#{colorid,jdbcType=VARCHAR},
			</if>
			<if test="model1 != null">
				#{model1,jdbcType=VARCHAR},
			</if>
			<if test="model2 != null">
				#{model2,jdbcType=VARCHAR},
			</if>
			<if test="model3 != null">
				#{model3,jdbcType=VARCHAR},
			</if>
			<if test="model4 != null">
				#{model4,jdbcType=VARCHAR},
			</if>
			<if test="model5 != null">
				#{model5,jdbcType=VARCHAR},
			</if>
			<if test="model6 != null">
				#{model6,jdbcType=VARCHAR},
			</if>
			<if test="model7 != null">
				#{model7,jdbcType=VARCHAR},
			</if>
			<if test="model8 != null">
				#{model8,jdbcType=VARCHAR},
			</if>
			<if test="model9 != null">
				#{model9,jdbcType=VARCHAR},
			</if>
			<if test="purchaseprice != null">
				#{purchaseprice,jdbcType=DECIMAL},
			</if>
			<if test="stopflag != null">
				#{stopflag,jdbcType=BIT},
			</if>
			<if test="editor != null">
				#{editor,jdbcType=VARCHAR},
			</if>
			<if test="modifydate != null">
				#{modifydate,jdbcType=TIMESTAMP},
			</if>
		</trim>
	</insert>
	<select id="countByExample" parameterType="com.fuxi.ws.data.entity.GoodscolorExample"
		resultType="java.lang.Integer">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		select count(*) from GoodsColor
		<if test="_parameter != null">
			<include refid="Example_Where_Clause" />
		</if>
	</select>
	<update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.Goodscolor">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		update GoodsColor
		<set>
			<if test="model1 != null">
				Model1 = #{model1,jdbcType=VARCHAR},
			</if>
			<if test="model2 != null">
				Model2 = #{model2,jdbcType=VARCHAR},
			</if>
			<if test="model3 != null">
				Model3 = #{model3,jdbcType=VARCHAR},
			</if>
			<if test="model4 != null">
				Model4 = #{model4,jdbcType=VARCHAR},
			</if>
			<if test="model5 != null">
				Model5 = #{model5,jdbcType=VARCHAR},
			</if>
			<if test="model6 != null">
				Model6 = #{model6,jdbcType=VARCHAR},
			</if>
			<if test="model7 != null">
				Model7 = #{model7,jdbcType=VARCHAR},
			</if>
			<if test="model8 != null">
				Model8 = #{model8,jdbcType=VARCHAR},
			</if>
			<if test="model9 != null">
				Model9 = #{model9,jdbcType=VARCHAR},
			</if>
			<if test="purchaseprice != null">
				PurchasePrice = #{purchaseprice,jdbcType=DECIMAL},
			</if>
			<if test="stopflag != null">
				StopFlag = #{stopflag,jdbcType=BIT},
			</if>
			<if test="editor != null">
				Editor = #{editor,jdbcType=VARCHAR},
			</if>
			<if test="modifydate != null">
				ModifyDate = #{modifydate,jdbcType=TIMESTAMP},
			</if>
		</set>
		where GoodsID = #{goodsid,jdbcType=VARCHAR}
		and ColorID =
		#{colorid,jdbcType=VARCHAR}
	</update>
	<update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.Goodscolor">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Mon Dec 08 
			12:34:44 CST 2014. -->
		update GoodsColor
		set Model1 = #{model1,jdbcType=VARCHAR},
		Model2 =
		#{model2,jdbcType=VARCHAR},
		Model3 = #{model3,jdbcType=VARCHAR},
		Model4
		= #{model4,jdbcType=VARCHAR},
		Model5 = #{model5,jdbcType=VARCHAR},
		Model6 = #{model6,jdbcType=VARCHAR},
		Model7 =
		#{model7,jdbcType=VARCHAR},
		Model8 = #{model8,jdbcType=VARCHAR},
		Model9
		= #{model9,jdbcType=VARCHAR},
		PurchasePrice =
		#{purchaseprice,jdbcType=DECIMAL},
		StopFlag = #{stopflag,jdbcType=BIT},
		Editor = #{editor,jdbcType=VARCHAR},
		ModifyDate =
		#{modifydate,jdbcType=TIMESTAMP}
		where GoodsID =
		#{goodsid,jdbcType=VARCHAR}
		and ColorID = #{colorid,jdbcType=VARCHAR}
	</update>

	<!-- 商品颜色 -->
	<select id="colorList" resultType="java.util.LinkedHashMap">
		select b.* from GoodsColor a
		join Color b on
		a.ColorID=b.ColorID
		where a.GoodsID=#{ goodsid }
	</select>
</mapper>