LiveLotteryRegistrationMapper.xml 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.fs.live.mapper.LiveLotteryRegistrationMapper">
  6. <resultMap type="LiveLotteryRegistration" id="LiveLotteryRegistrationResult">
  7. <result property="registrationId" column="registration_id" />
  8. <result property="liveId" column="live_id" />
  9. <result property="userId" column="user_id" />
  10. <result property="isWin" column="is_win" />
  11. <result property="rizeLevel" column="rize_level" />
  12. <result property="createTime" column="create_time" />
  13. <result property="updateTime" column="update_time" />
  14. <result property="createBy" column="create_by" />
  15. <result property="updateBy" column="update_by" />
  16. </resultMap>
  17. <sql id="selectLiveLotteryRegistrationVo">
  18. select registration_id, live_id, user_id, is_win, rize_level, create_time, update_time, create_by, update_by from live_lottery_registration
  19. </sql>
  20. <select id="selectLiveLotteryRegistrationList" parameterType="LiveLotteryRegistration" resultMap="LiveLotteryRegistrationResult">
  21. <include refid="selectLiveLotteryRegistrationVo"/>
  22. <where>
  23. </where>
  24. </select>
  25. <select id="selectLiveLotteryRegistrationByRegistrationId" parameterType="Long" resultMap="LiveLotteryRegistrationResult">
  26. <include refid="selectLiveLotteryRegistrationVo"/>
  27. where registration_id = #{registrationId}
  28. </select>
  29. <insert id="insertLiveLotteryRegistration" parameterType="LiveLotteryRegistration" useGeneratedKeys="true" keyProperty="registrationId">
  30. insert into live_lottery_registration
  31. <trim prefix="(" suffix=")" suffixOverrides=",">
  32. <if test="liveId != null">live_id,</if>
  33. <if test="userId != null">user_id,</if>
  34. <if test="isWin != null">is_win,</if>
  35. <if test="rizeLevel != null">rize_level,</if>
  36. <if test="createTime != null">create_time,</if>
  37. <if test="updateTime != null">update_time,</if>
  38. <if test="createBy != null">create_by,</if>
  39. <if test="updateBy != null">update_by,</if>
  40. </trim>
  41. <trim prefix="values (" suffix=")" suffixOverrides=",">
  42. <if test="liveId != null">#{liveId},</if>
  43. <if test="userId != null">#{userId},</if>
  44. <if test="isWin != null">#{isWin},</if>
  45. <if test="rizeLevel != null">#{rizeLevel},</if>
  46. <if test="createTime != null">#{createTime},</if>
  47. <if test="updateTime != null">#{updateTime},</if>
  48. <if test="createBy != null">#{createBy},</if>
  49. <if test="updateBy != null">#{updateBy},</if>
  50. </trim>
  51. </insert>
  52. <update id="updateLiveLotteryRegistration" parameterType="LiveLotteryRegistration">
  53. update live_lottery_registration
  54. <trim prefix="SET" suffixOverrides=",">
  55. <if test="liveId != null">live_id = #{liveId},</if>
  56. <if test="userId != null">user_id = #{userId},</if>
  57. <if test="isWin != null">is_win = #{isWin},</if>
  58. <if test="rizeLevel != null">rize_level = #{rizeLevel},</if>
  59. <if test="createTime != null">create_time = #{createTime},</if>
  60. <if test="updateTime != null">update_time = #{updateTime},</if>
  61. <if test="createBy != null">create_by = #{createBy},</if>
  62. <if test="updateBy != null">update_by = #{updateBy},</if>
  63. </trim>
  64. where registration_id = #{registrationId}
  65. </update>
  66. <delete id="deleteLiveLotteryRegistrationByRegistrationId" parameterType="Long">
  67. delete from live_lottery_registration where registration_id = #{registrationId}
  68. </delete>
  69. <delete id="deleteLiveLotteryRegistrationByRegistrationIds" parameterType="String">
  70. delete from live_lottery_registration where registration_id in
  71. <foreach item="registrationId" collection="array" open="(" separator="," close=")">
  72. #{registrationId}
  73. </foreach>
  74. </delete>
  75. </mapper>