Mybitse-中添加数据返添加数据的ID


<!-- 添加活动信息 返回ID 用于奖项的添加-->
<insert id="addInteractActivity" parameterType="com.wmall.framework.db.model.InteractActivity"
useGeneratedKeys="true" keyProperty="act_id">
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="actid">
SELECT LAST_INSERT_ID()
</selectKey>
INSERT INTO ss_interact_activity(
act_name,game_id,act_brief,act_desc,
start_time,end_time,draw_cnt,drow_plan,need_reply,
reply_info,is_finished,update_time
)
VALUES
(#{actname},#{gameid},
<choose>
<when test="actbrief == null or actbrief ==''">
'',
</when>
<otherwise>
#{actbrief},
</otherwise>
</choose>
<choose>
<when test="actdesc == null or actdesc ==''">
'',
</when>
<otherwise>
#{actdesc},
</otherwise>
</choose>
<choose>
<when test="starttime == null or starttime ==''">
'',
</when>
<otherwise>
#{starttime},
</otherwise>
</choose>
<choose>
<when test="endtime == null or endtime ==''">
'',
</when>
<otherwise>
#{endtime},
</otherwise>
</choose>
<choose>
<when test="drawcnt == null or drawcnt ==''">
'',
</when>
<otherwise>
#{drawcnt},
</otherwise>
</choose>
<choose>
<when test="drowplan == null or drowplan ==''">
'',
</when>
<otherwise>
#{drowplan},
</otherwise>
</choose>
#{needreply},
<choose>
<when test="replyinfo == null or replyinfo ==''">
'',
</when>
<otherwise>
#{replyinfo},
</otherwise>
</choose>
#{isfinished},
#{updatetime}
)
</insert>
<!-- 添加奖项,奖品信息 -->
<insert id="addInteractPrize" parameterType="com.wmall.framework.db.model.InteractPrize"
useGeneratedKeys="true" keyProperty="prize_id">
INSERT INTO ss_interact_prize(
prize_id,act_id,prize_level,prize_name,prize_type,
prize_num,prize_img_url,sort_order,update_time
)
VALUES
(#{prizeid}, #{actid},#{prizelevel},
<choose>
<when test="prizename == null or prizename ==''">
'',
</when>
<otherwise>
#{prizename},
</otherwise>
</choose>
<choose>
<when test="prizetype == null or prizetype ==''">
'',
</when>
<otherwise>
#{prizetype},
</otherwise>
</choose>
#{prizenum},
#{prizeimgurl},
<choose>
<when test="sortorder == null or sortorder ==''">
'0',
</when>
<otherwise>
#{sortorder},
</otherwise>
</choose>
#{updatetime}
)
</insert>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值