RoomGameConfigMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.juxiao.xchat.module.xbd.mapper.room.RoomGameConfigMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="uid" property="uid" jdbcType="BIGINT" />
  7. <result column="start" property="start" jdbcType="VARCHAR" />
  8. <result column="end" property="end" jdbcType="VARCHAR" />
  9. <result column="status" property="status" jdbcType="INTEGER" />
  10. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  11. <result column="admin_id" property="adminId" jdbcType="INTEGER" />
  12. </resultMap>
  13. <sql id="Base_Column_List" >
  14. id, uid, start, end, status, create_time, admin_id
  15. </sql>
  16. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  17. select
  18. <include refid="Base_Column_List" />
  19. from room_game_config
  20. where id = #{id,jdbcType=INTEGER}
  21. </select>
  22. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  23. insert into room_game_config (id, uid, start,
  24. end, status, create_time,
  25. admin_id)
  26. values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=BIGINT}, #{start,jdbcType=VARCHAR},
  27. #{end,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
  28. #{adminId,jdbcType=INTEGER})
  29. </insert>
  30. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  31. insert into room_game_config
  32. <trim prefix="(" suffix=")" suffixOverrides="," >
  33. <if test="id != null" >
  34. id,
  35. </if>
  36. <if test="uid != null" >
  37. uid,
  38. </if>
  39. <if test="start != null" >
  40. start,
  41. </if>
  42. <if test="end != null" >
  43. end,
  44. </if>
  45. <if test="status != null" >
  46. status,
  47. </if>
  48. <if test="createTime != null" >
  49. create_time,
  50. </if>
  51. <if test="adminId != null" >
  52. admin_id,
  53. </if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides="," >
  56. <if test="id != null" >
  57. #{id,jdbcType=INTEGER},
  58. </if>
  59. <if test="uid != null" >
  60. #{uid,jdbcType=BIGINT},
  61. </if>
  62. <if test="start != null" >
  63. #{start,jdbcType=VARCHAR},
  64. </if>
  65. <if test="end != null" >
  66. #{end,jdbcType=VARCHAR},
  67. </if>
  68. <if test="status != null" >
  69. #{status,jdbcType=INTEGER},
  70. </if>
  71. <if test="createTime != null" >
  72. #{createTime,jdbcType=TIMESTAMP},
  73. </if>
  74. <if test="adminId != null" >
  75. #{adminId,jdbcType=INTEGER},
  76. </if>
  77. </trim>
  78. </insert>
  79. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" >
  80. update room_game_config
  81. <set >
  82. <if test="uid != null" >
  83. uid = #{uid,jdbcType=BIGINT},
  84. </if>
  85. <if test="start != null" >
  86. start = #{start,jdbcType=VARCHAR},
  87. </if>
  88. <if test="end != null" >
  89. end = #{end,jdbcType=VARCHAR},
  90. </if>
  91. <if test="status != null" >
  92. status = #{status,jdbcType=INTEGER},
  93. </if>
  94. <if test="createTime != null" >
  95. create_time = #{createTime,jdbcType=TIMESTAMP},
  96. </if>
  97. <if test="adminId != null" >
  98. admin_id = #{adminId,jdbcType=INTEGER},
  99. </if>
  100. </set>
  101. where id = #{id,jdbcType=INTEGER}
  102. </update>
  103. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" >
  104. update room_game_config
  105. set uid = #{uid,jdbcType=BIGINT},
  106. start = #{start,jdbcType=VARCHAR},
  107. end = #{end,jdbcType=VARCHAR},
  108. status = #{status,jdbcType=INTEGER},
  109. create_time = #{createTime,jdbcType=TIMESTAMP},
  110. admin_id = #{adminId,jdbcType=INTEGER}
  111. where id = #{id,jdbcType=INTEGER}
  112. </update>
  113. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  114. delete from room_game_config
  115. where id = #{id,jdbcType=INTEGER}
  116. </delete>
  117. <select id="selectByRoomGameConfigs" resultType="com.juxiao.xchat.module.xbd.vo.RoomGameConfigVO">
  118. select rgc.id,rgc.uid,rgc.start,rgc.end,rgc.status,rgc.create_time as createTime,u.erban_no as erbanNo, u.nick,rgc.admin_id as adminId
  119. from room_game_config rgc
  120. inner join users u on rgc.uid = u.uid
  121. where 1 =1
  122. <if test="erBanNo != null">
  123. and u.erban_no = #{erBanNo}
  124. </if>
  125. ORDER BY rgc.status asc , rgc.create_time DESC
  126. </select>
  127. </mapper>