AppGameMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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="logoUrl" column="logo_url" />
  14. <result property="gamePath" column="game_path" />
  15. <result property="status" column="status" />
  16. <result property="createTime" column="create_time" />
  17. <result property="orderno" column="orderno" />
  18. <result property="gameExpand1" column="game_expand1" />
  19. <result property="gameExpand2" column="game_expand2" />
  20. <result property="gameExpand3" column="game_expand3" />
  21. <result property="gameExpand4" column="game_expand4" />
  22. </resultMap>
  23. <sql id="selectAppGameVo">
  24. select id, name, code, classify_id, game_date, game_time, logo_url, game_path, status, create_time, orderno, game_expand1, game_expand2, game_expand3, game_expand4 from app_game
  25. </sql>
  26. <select id="selectAppGameList" parameterType="com.game.business.domain.AppGame" resultMap="AppGameResult">
  27. <include refid="selectAppGameVo"/>
  28. <where>
  29. <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
  30. <if test="code != null and code != ''"> and code like concat('%', #{code}, '%')</if>
  31. <if test="gameDate != null and gameDate != ''"> and game_date like concat('%', #{gameDate}, '%')</if>
  32. <if test="classifyId != null "> and classify_id = #{classifyId}</if>
  33. <if test="logoUrl != null and logoUrl != ''"> and logo_url = #{logoUrl}</if>
  34. <if test="gamePath != null and gamePath != ''"> and game_path = #{gamePath}</if>
  35. <if test="status != null "> and status = #{status}</if>
  36. <if test="orderno != null "> and orderno = #{orderno}</if>
  37. <if test="gameExpand1 != null and gameExpand1 != ''"> and game_expand1 = #{gameExpand1}</if>
  38. <if test="gameExpand2 != null and gameExpand2 != ''"> and game_expand2 = #{gameExpand2}</if>
  39. <if test="gameExpand3 != null and gameExpand3 != ''"> and game_expand3 = #{gameExpand3}</if>
  40. <if test="gameExpand4 != null and gameExpand4 != ''"> and game_expand4 = #{gameExpand4}</if>
  41. </where>
  42. </select>
  43. <select id="selectAppGameById" parameterType="Long" resultMap="AppGameResult">
  44. <include refid="selectAppGameVo"/>
  45. where id = #{id}
  46. </select>
  47. <insert id="insertAppGame" parameterType="com.game.business.domain.AppGame">
  48. insert into app_game
  49. <trim prefix="(" suffix=")" suffixOverrides=",">
  50. <if test="id != null">id,</if>
  51. <if test="name != null">name,</if>
  52. <if test="code != null">code,</if>
  53. <if test="classifyId != null">classify_id,</if>
  54. <if test="logoUrl != null">logo_url,</if>
  55. <if test="gamePath != null">game_path,</if>
  56. <if test="status != null">status,</if>
  57. <if test="createTime != null">create_time,</if>
  58. <if test="orderno != null">orderno,</if>
  59. <if test="gameExpand1 != null">game_expand1,</if>
  60. <if test="gameExpand2 != null">game_expand2,</if>
  61. <if test="gameExpand3 != null">game_expand3,</if>
  62. <if test="gameExpand4 != null">game_expand4,</if>
  63. </trim>
  64. <trim prefix="values (" suffix=")" suffixOverrides=",">
  65. <if test="id != null">#{id},</if>
  66. <if test="name != null">#{name},</if>
  67. <if test="code != null">#{code},</if>
  68. <if test="classifyId != null">#{classifyId},</if>
  69. <if test="logoUrl != null">#{logoUrl},</if>
  70. <if test="gamePath != null">#{gamePath},</if>
  71. <if test="status != null">#{status},</if>
  72. <if test="createTime != null">#{createTime},</if>
  73. <if test="orderno != null">#{orderno},</if>
  74. <if test="gameExpand1 != null">#{gameExpand1},</if>
  75. <if test="gameExpand2 != null">#{gameExpand2},</if>
  76. <if test="gameExpand3 != null">#{gameExpand3},</if>
  77. <if test="gameExpand4 != null">#{gameExpand4},</if>
  78. </trim>
  79. </insert>
  80. <update id="updateAppGame" parameterType="com.game.business.domain.AppGame">
  81. update app_game
  82. <trim prefix="SET" suffixOverrides=",">
  83. <if test="name != null">name = #{name},</if>
  84. <if test="code != null">code = #{code},</if>
  85. <if test="classifyId != null">classify_id = #{classifyId},</if>
  86. <if test="gameDate != null">game_date = #{gameDate},</if>
  87. <if test="gameTime != null">game_time = #{gameTime},</if>
  88. <if test="logoUrl != null">logo_url = #{logoUrl},</if>
  89. <if test="gamePath != null">game_path = #{gamePath},</if>
  90. <if test="status != null">status = #{status},</if>
  91. <if test="createTime != null">create_time = #{createTime},</if>
  92. <if test="orderno != null">orderno = #{orderno},</if>
  93. <if test="gameExpand1 != null">game_expand1 = #{gameExpand1},</if>
  94. <if test="gameExpand2 != null">game_expand2 = #{gameExpand2},</if>
  95. <if test="gameExpand3 != null">game_expand3 = #{gameExpand3},</if>
  96. <if test="gameExpand4 != null">game_expand4 = #{gameExpand4},</if>
  97. </trim>
  98. where id = #{id}
  99. </update>
  100. <delete id="deleteAppGameById" parameterType="Long">
  101. delete from app_game where id = #{id}
  102. </delete>
  103. <delete id="deleteAppGameByIds" parameterType="String">
  104. delete from app_game where id in
  105. <foreach item="id" collection="array" open="(" separator="," close=")">
  106. #{id}
  107. </foreach>
  108. </delete>
  109. </mapper>