AppGameMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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.game.business.mapper.AppGameMapper">
  6. <resultMap type="com.game.business.domain.AppGame" id="AppGameResult">
  7. <result property="id" column="id" />
  8. <result property="name" column="name" />
  9. <result property="code" column="code" />
  10. <result property="classifyId" column="classify_id" />
  11. <result property="gameDate" column="game_date" />
  12. <result property="gameTime" column="game_time" />
  13. <result property="upItem" column="up_item" />
  14. <result property="logoUrl" column="logo_url" />
  15. <result property="liveImgUrl" column="live_img_url" />
  16. <result property="myImgUrl" column="my_img_url" />
  17. <result property="gamePath" column="game_path" />
  18. <result property="status" column="status" />
  19. <result property="createTime" column="create_time" />
  20. <result property="orderno" column="orderno" />
  21. <result property="enable" column="enable" />
  22. <result property="bettingCount" column="betting_count" />
  23. <result property="gameExpand1" column="game_expand1" />
  24. <result property="gameExpand2" column="game_expand2" />
  25. <result property="gameExpand3" column="game_expand3" />
  26. <result property="gameExpand4" column="game_expand4" />
  27. </resultMap>
  28. <sql id="selectAppGameVo">
  29. select id, name, code, classify_id, game_date, game_time, up_item, logo_url, live_img_url, my_img_url, game_path, status, create_time, orderno, enable, betting_count, game_expand1, game_expand2, game_expand3, game_expand4 from app_game
  30. </sql>
  31. <select id="selectAppGameList" parameterType="com.game.business.domain.AppGame" resultMap="AppGameResult">
  32. <include refid="selectAppGameVo"/>
  33. <where>
  34. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  35. <if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if>
  36. <if test="gameDate != null and gameDate != ''"> and game_date like concat('%', #{gameDate}, '%')</if>
  37. <if test="classifyId != null "> and classify_id = #{classifyId}</if>
  38. <if test="upItem != null and upItem != ''"> and up_item = #{upItem}</if>
  39. <if test="logoUrl != null and logoUrl != ''"> and logo_url = #{logoUrl}</if>
  40. <if test="liveImgUrl != null and liveImgUrl != ''"> and live_img_url = #{liveImgUrl}</if>
  41. <if test="myImgUrl != null and myImgUrl != ''"> and my_img_url = #{myImgUrl}</if>
  42. <if test="gamePath != null and gamePath != ''"> and game_path = #{gamePath}</if>
  43. <if test="status != null "> and status = #{status}</if>
  44. <if test="orderno != null "> and orderno = #{orderno}</if>
  45. <if test="enable != null "> and enable = #{enable}</if>
  46. <if test="bettingCount != null "> and betting_count = #{bettingCount}</if>
  47. <if test="gameExpand1 != null and gameExpand1 != ''"> and game_expand1 = #{gameExpand1}</if>
  48. <if test="gameExpand2 != null and gameExpand2 != ''"> and game_expand2 = #{gameExpand2}</if>
  49. <if test="gameExpand3 != null and gameExpand3 != ''"> and game_expand3 = #{gameExpand3}</if>
  50. <if test="gameExpand4 != null and gameExpand4 != ''"> and game_expand4 = #{gameExpand4}</if>
  51. </where>
  52. </select>
  53. <select id="selectAppGameById" parameterType="Long" resultMap="AppGameResult">
  54. <include refid="selectAppGameVo"/>
  55. where id = #{id}
  56. </select>
  57. <insert id="insertAppGame" parameterType="com.game.business.domain.AppGame">
  58. insert into app_game
  59. <trim prefix="(" suffix=")" suffixOverrides=",">
  60. <if test="id != null">id,</if>
  61. <if test="name != null">name,</if>
  62. <if test="code != null">code,</if>
  63. <if test="classifyId != null">classify_id,</if>
  64. <if test="gameDate != null">game_date,</if>
  65. <if test="gameTime != null">game_time,</if>
  66. <if test="upItem != null">up_item,</if>
  67. <if test="logoUrl != null">logo_url,</if>
  68. <if test="liveImgUrl != null">live_img_url,</if>
  69. <if test="myImgUrl != null">my_img_url,</if>
  70. <if test="gamePath != null">game_path,</if>
  71. <if test="status != null">status,</if>
  72. <if test="createTime != null">create_time,</if>
  73. <if test="orderno != null">orderno,</if>
  74. <if test="enable != null">enable,</if>
  75. <if test="bettingCount != null">betting_count,</if>
  76. <if test="gameExpand1 != null">game_expand1,</if>
  77. <if test="gameExpand2 != null">game_expand2,</if>
  78. <if test="gameExpand3 != null">game_expand3,</if>
  79. <if test="gameExpand4 != null">game_expand4,</if>
  80. </trim>
  81. <trim prefix="values (" suffix=")" suffixOverrides=",">
  82. <if test="id != null">#{id},</if>
  83. <if test="name != null">#{name},</if>
  84. <if test="code != null">#{code},</if>
  85. <if test="classifyId != null">#{classifyId},</if>
  86. <if test="gameDate != null">#{gameDate},</if>
  87. <if test="gameTime != null">#{gameTime},</if>
  88. <if test="upItem != null">#{upItem},</if>
  89. <if test="logoUrl != null">#{logoUrl},</if>
  90. <if test="liveImgUrl != null">#{liveImgUrl},</if>
  91. <if test="myImgUrl != null">#{myImgUrl},</if>
  92. <if test="gamePath != null">#{gamePath},</if>
  93. <if test="status != null">#{status},</if>
  94. <if test="createTime != null">#{createTime},</if>
  95. <if test="orderno != null">#{orderno},</if>
  96. <if test="enable != null">#{enable},</if>
  97. <if test="bettingCount != null">#{bettingCount},</if>
  98. <if test="gameExpand1 != null">#{gameExpand1},</if>
  99. <if test="gameExpand2 != null">#{gameExpand2},</if>
  100. <if test="gameExpand3 != null">#{gameExpand3},</if>
  101. <if test="gameExpand4 != null">#{gameExpand4},</if>
  102. </trim>
  103. </insert>
  104. <update id="updateAppGame" parameterType="com.game.business.domain.AppGame">
  105. update app_game
  106. <trim prefix="SET" suffixOverrides=",">
  107. <if test="name != null">name = #{name},</if>
  108. <if test="code != null">code = #{code},</if>
  109. <if test="classifyId != null">classify_id = #{classifyId},</if>
  110. <if test="gameDate != null">game_date = #{gameDate},</if>
  111. <if test="gameTime != null">game_time = #{gameTime},</if>
  112. <if test="upItem != null">up_item = #{upItem},</if>
  113. <if test="logoUrl != null">logo_url = #{logoUrl},</if>
  114. <if test="liveImgUrl != null">live_img_url = #{liveImgUrl},</if>
  115. <if test="myImgUrl != null">my_img_url = #{myImgUrl},</if>
  116. <if test="gamePath != null">game_path = #{gamePath},</if>
  117. <if test="status != null">status = #{status},</if>
  118. <if test="createTime != null">create_time = #{createTime},</if>
  119. <if test="orderno != null">orderno = #{orderno},</if>
  120. <if test="enable != null">enable = #{enable},</if>
  121. <if test="bettingCount != null">betting_count = #{bettingCount},</if>
  122. <if test="gameExpand1 != null">game_expand1 = #{gameExpand1},</if>
  123. <if test="gameExpand2 != null">game_expand2 = #{gameExpand2},</if>
  124. <if test="gameExpand3 != null">game_expand3 = #{gameExpand3},</if>
  125. <if test="gameExpand4 != null">game_expand4 = #{gameExpand4},</if>
  126. </trim>
  127. where id = #{id}
  128. </update>
  129. <delete id="deleteAppGameById" parameterType="Long">
  130. delete from app_game where id = #{id}
  131. </delete>
  132. <delete id="deleteAppGameByIds" parameterType="String">
  133. delete from app_game where id in
  134. <foreach item="id" collection="array" open="(" separator="," close=")">
  135. #{id}
  136. </foreach>
  137. </delete>
  138. </mapper>