|
@@ -24,10 +24,10 @@
|
|
|
and id_ = #{id}
|
|
|
</if>
|
|
|
<if test="name != null">
|
|
|
- and name_ like '%' #{name} '%'
|
|
|
+ and name_ like concat('%',#{name},'%')
|
|
|
</if>
|
|
|
<if test="rewardType != null">
|
|
|
- and reward_type_ like '%' #{rewardType} '%'
|
|
|
+ and reward_type_ like concat('%',#{rewardType},'%')
|
|
|
</if>
|
|
|
<if test="groupId != null">
|
|
|
and group_id_ = #{groupId}
|
|
@@ -54,7 +54,8 @@
|
|
|
where id_ = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
|
|
|
- <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.LuckDrawPrize">
|
|
|
+ <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_,
|
|
|
modify_on_)
|
|
@@ -64,6 +65,19 @@
|
|
|
#{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_,
|
|
|
+ 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())
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
<update id="update" parameterType="com.ym.mec.biz.dal.entity.LuckDrawPrize">
|
|
|
update luck_draw_prize
|
|
|
<set>
|