<?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.iamberry.wechat.service.mapper.GiftConditionMapper">
	<resultMap  id="BaseResultMap" type="GiftCondition" >
		<result    column="gift_condition_id"    property="giftConditionId" />
		<result    column="sett_gift_id"    property="settGiftId" />
		<result    column="gift_condition_fill_color_id"    property="giftConditionFillColorId" />
		<result    column="gift_condition_create_time"    property="giftConditionCreateTime" />
	</resultMap>
	<sql    id="Base_List" >
		t.gift_condition_id,
		t.sett_gift_id,
		t.gift_condition_fill_color_id,
		t.gift_condition_create_time
	</sql>
	<select id="getGiftConditionList" resultMap="BaseResultMap" parameterType="GiftCondition" >
		select
		<include refid="Base_List" />
		from tb_iamberry_eo_gift_condition t
		<where>
			<if test="giftConditionId != null ">
				AND t.gift_condition_id = #{giftConditionId}
			</if >
			<if test="settGiftId != null ">
				AND t.sett_gift_id = #{settGiftId}
			</if >
			<if test="giftConditionFillColorId != null ">
				AND t.gift_condition_fill_color_id = #{giftConditionFillColorId}
			</if >
		</where>
	</select>
	<select id="getGiftConditionById" resultMap="BaseResultMap" parameterType="Integer" >
		select
		<include refid="Base_List" />
		from tb_iamberry_eo_gift_condition t
		where t.gift_condition_id= #{giftConditionId}
	</select>
</mapper>