| 
					
				 | 
			
			
				@@ -10,12 +10,13 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="reward_type_" property="rewardType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="memo_" property="memo" jdbcType="VARCHAR" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="group_id_" property="groupId" jdbcType="INTEGER" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		<result column="is_default_" property="isDefault" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="create_on_" property="createOn" jdbcType="TIMESTAMP" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<result column="modify_on_" property="modifyOn" jdbcType="TIMESTAMP" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</resultMap> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<sql id="Base_Column_List"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		id_, name_, chances_, stock_, enabled_, reward_type_, memo_, group_id_, create_on_, modify_on_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		id_, name_, chances_, stock_, enabled_, reward_type_, memo_, group_id_, is_default_, create_on_, modify_on_ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</sql> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<sql id="queryCondition"> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -57,24 +58,24 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.LuckDrawPrize" useGeneratedKeys="true" keyColumn="id" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             keyProperty="id"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		insert into luck_draw_prize (id_, name_, chances_, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		stock_, enabled_, reward_type_, memo_, group_id_, create_on_, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		stock_, enabled_, reward_type_, memo_, group_id_, is_default_, create_on_, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		modify_on_) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		#{chances,jdbcType=DOUBLE}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		#{stock,jdbcType=INTEGER}, #{enabled,jdbcType=BIT},#{rewardType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{memo,jdbcType=VARCHAR}, #{groupId,jdbcType=INTEGER}, #{createOn,jdbcType=TIMESTAMP}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		#{stock,jdbcType=INTEGER}, #{enabled,jdbcType=BIT},#{rewardType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{memo,jdbcType=VARCHAR}, #{groupId,jdbcType=INTEGER}, #(isDefault), #{createOn,jdbcType=TIMESTAMP}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		#{modifyOn,jdbcType=TIMESTAMP}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</insert> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyColumn="id" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             keyProperty="id"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		insert into luck_draw_prize (id_, name_, chances_, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		stock_, enabled_, reward_type_, memo_, group_id_, create_on_, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		stock_, enabled_, reward_type_, memo_, group_id_, is_default_, create_on_, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		modify_on_) values  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		<foreach collection="list" item="item" separator=","> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		(#{item.id,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		#{item.chances,jdbcType=DOUBLE}, #{item.stock,jdbcType=INTEGER},  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		#{item.enabled,jdbcType=BIT},#{item.rewardType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		#{item.memo,jdbcType=VARCHAR}, #{item.groupId,jdbcType=INTEGER}, now(), now()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		#{item.memo,jdbcType=VARCHAR}, #{item.groupId,jdbcType=INTEGER}, #{item.isDefault}, now(), now()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		</foreach> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</insert> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -102,6 +103,9 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<if test="groupId != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				group_id_ = #{groupId,jdbcType=INTEGER}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			<if test="isDefault != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				is_default_ = #{isDefault}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			</if> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			<if test="createOn != null"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				create_on_ = #{createOn,jdbcType=TIMESTAMP}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			</if> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -130,4 +134,11 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		from luck_draw_prize 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		where enabled_ = 1 and group_id_ = #{group} order by id_ asc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	<select id="queryDefaultPrize" resultMap="BaseResultMap" parameterType="int"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		select 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		<include refid="Base_Column_List" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		from luck_draw_prize 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		where enabled_ = 1 and group_id_ = #{group} and is_default_ = 1 order by id_ asc 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	</select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </mapper> 
			 |