AppUsersChargeMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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.AppUsersChargeMapper">
  6. <resultMap type="com.game.business.domain.AppUsersCharge" id="AppUsersChargeResult">
  7. <result property="id" column="id" />
  8. <result property="addtime" column="addtime" />
  9. <result property="updateTime" column="update_time" />
  10. <result property="afterCoin" column="after_coin" />
  11. <result property="agentId" column="agent_id" />
  12. <result property="ambient" column="ambient" />
  13. <result property="coin" column="coin" />
  14. <result property="coinType" column="coin_type" />
  15. <result property="coinGive" column="coin_give" />
  16. <result property="platformService" column="platform_service" />
  17. <result property="platformServiceRate" column="platform_service_rate" />
  18. <result property="isAgent" column="is_agent" />
  19. <result property="isDelete" column="is_delete" />
  20. <result property="isWater" column="is_water" />
  21. <result property="money" column="money" />
  22. <result property="optType" column="opt_type" />
  23. <result property="optUser" column="opt_user" />
  24. <result property="orderno" column="orderno" />
  25. <result property="pid" column="pid" />
  26. <result property="pidLevel1" column="pid_level1" />
  27. <result property="pidLevel2" column="pid_level2" />
  28. <result property="pidLevel3" column="pid_level3" />
  29. <result property="pidLevel4" column="pid_level4" />
  30. <result property="remarks" column="remarks" />
  31. <result property="ruleId" column="rule_id" />
  32. <result property="status" column="status" />
  33. <result property="touid" column="touid" />
  34. <result property="tradeNo" column="trade_no" />
  35. <result property="type" column="type" />
  36. <result property="uid" column="uid" />
  37. <result property="channelId" column="channel_id" />
  38. </resultMap>
  39. <sql id="selectAppUsersChargeVo">
  40. select id, addtime,update_time, after_coin, agent_id, ambient, coin, coin_type, coin_give,platform_service_rate,platform_service, is_agent, is_delete, is_water, money, opt_type, opt_user, orderno, pid, pid_level1, pid_level2, pid_level3, pid_level4, remarks, rule_id, status, touid, trade_no, type, uid,channel_id from app_users_charge
  41. </sql>
  42. <select id="selectAppUsersChargeList" parameterType="com.game.business.domain.AppUsersCharge" resultMap="AppUsersChargeResult">
  43. <include refid="selectAppUsersChargeVo"/>
  44. <where>
  45. <if test="addtime != null "> and addtime = #{addtime}</if>
  46. <if test="updateTime != null "> and update_time = #{updateTime}</if>
  47. <if test="afterCoin != null "> and after_coin = #{afterCoin}</if>
  48. <if test="agentId != null "> and agent_id = #{agentId}</if>
  49. <if test="ambient != null "> and ambient = #{ambient}</if>
  50. <if test="coin != null "> and coin = #{coin}</if>
  51. <if test="coinType != null "> and coin_type = #{coinType}</if>
  52. <if test="coinGive != null "> and coin_give = #{coinGive}</if>
  53. <if test="platform_service_rate != null "> and platform_service = #{platformService}</if>
  54. <if test="platform_service != null "> and platform_service_rate = #{platformServiceRate}</if>
  55. <if test="isAgent != null "> and is_agent = #{isAgent}</if>
  56. <if test="isDelete != null "> and is_delete = #{isDelete}</if>
  57. <if test="isWater != null "> and is_water = #{isWater}</if>
  58. <if test="money != null "> and money = #{money}</if>
  59. <if test="optType != null "> and opt_type = #{optType}</if>
  60. <if test="optUser != null and optUser != ''"> and opt_user = #{optUser}</if>
  61. <if test="orderno != null and orderno != ''"> and orderno = #{orderno}</if>
  62. <if test="pid != null "> and pid = #{pid}</if>
  63. <if test="pidLevel1 != null "> and pid_level1 = #{pidLevel1}</if>
  64. <if test="pidLevel2 != null "> and pid_level2 = #{pidLevel2}</if>
  65. <if test="pidLevel3 != null "> and pid_level3 = #{pidLevel3}</if>
  66. <if test="pidLevel4 != null "> and pid_level4 = #{pidLevel4}</if>
  67. <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
  68. <if test="ruleId != null "> and rule_id = #{ruleId}</if>
  69. <if test="status != null "> and status = #{status}</if>
  70. <if test="touid != null "> and touid = #{touid}</if>
  71. <if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo}</if>
  72. <if test="type != null "> and type = #{type}</if>
  73. <if test="uid != null "> and uid = #{uid}</if>
  74. <if test="channelId != null "> and channel_id = #{channelId}</if>
  75. </where>
  76. </select>
  77. <select id="selectAppUsersChargeById" parameterType="Long" resultMap="AppUsersChargeResult">
  78. <include refid="selectAppUsersChargeVo"/>
  79. where id = #{id}
  80. </select>
  81. <insert id="insertAppUsersCharge" parameterType="com.game.business.domain.AppUsersCharge">
  82. insert into app_users_charge
  83. <trim prefix="(" suffix=")" suffixOverrides=",">
  84. <if test="id != null">id,</if>
  85. <if test="addtime != null">addtime,</if>
  86. <if test="updateTime != null">update_time,</if>
  87. <if test="afterCoin != null">after_coin,</if>
  88. <if test="agentId != null">agent_id,</if>
  89. <if test="ambient != null">ambient,</if>
  90. <if test="coin != null">coin,</if>
  91. <if test="coinType != null">coin_type,</if>
  92. <if test="coinGive != null">coin_give,</if>
  93. <if test="platformService != null">platform_service,</if>
  94. <if test="platformServiceRate != null">platform_service_rate,</if>
  95. <if test="isAgent != null">is_agent,</if>
  96. <if test="isDelete != null">is_delete,</if>
  97. <if test="isWater != null">is_water,</if>
  98. <if test="money != null">money,</if>
  99. <if test="optType != null">opt_type,</if>
  100. <if test="optUser != null">opt_user,</if>
  101. <if test="orderno != null">orderno,</if>
  102. <if test="pid != null">pid,</if>
  103. <if test="pidLevel1 != null">pid_level1,</if>
  104. <if test="pidLevel2 != null">pid_level2,</if>
  105. <if test="pidLevel3 != null">pid_level3,</if>
  106. <if test="pidLevel4 != null">pid_level4,</if>
  107. <if test="remarks != null">remarks,</if>
  108. <if test="ruleId != null">rule_id,</if>
  109. <if test="status != null">status,</if>
  110. <if test="touid != null">touid,</if>
  111. <if test="tradeNo != null">trade_no,</if>
  112. <if test="type != null">type,</if>
  113. <if test="uid != null">uid,</if>
  114. <if test="channelId != null">channel_id,</if>
  115. </trim>
  116. <trim prefix="values (" suffix=")" suffixOverrides=",">
  117. <if test="id != null">#{id},</if>
  118. <if test="addtime != null">#{addtime},</if>
  119. <if test="updateTime != null">#{updateTime},</if>
  120. <if test="afterCoin != null">#{afterCoin},</if>
  121. <if test="agentId != null">#{agentId},</if>
  122. <if test="ambient != null">#{ambient},</if>
  123. <if test="coin != null">#{coin},</if>
  124. <if test="coinType != null">#{coinType},</if>
  125. <if test="coinGive != null">#{coinGive},</if>
  126. <if test="platformService != null">#{platformService},</if>
  127. <if test="platformServiceRate != null">#{platformServiceRate},</if>
  128. <if test="isAgent != null">#{isAgent},</if>
  129. <if test="isDelete != null">#{isDelete},</if>
  130. <if test="isWater != null">#{isWater},</if>
  131. <if test="money != null">#{money},</if>
  132. <if test="optType != null">#{optType},</if>
  133. <if test="optUser != null">#{optUser},</if>
  134. <if test="orderno != null">#{orderno},</if>
  135. <if test="pid != null">#{pid},</if>
  136. <if test="pidLevel1 != null">#{pidLevel1},</if>
  137. <if test="pidLevel2 != null">#{pidLevel2},</if>
  138. <if test="pidLevel3 != null">#{pidLevel3},</if>
  139. <if test="pidLevel4 != null">#{pidLevel4},</if>
  140. <if test="remarks != null">#{remarks},</if>
  141. <if test="ruleId != null">#{ruleId},</if>
  142. <if test="status != null">#{status},</if>
  143. <if test="touid != null">#{touid},</if>
  144. <if test="tradeNo != null">#{tradeNo},</if>
  145. <if test="type != null">#{type},</if>
  146. <if test="uid != null">#{uid},</if>
  147. <if test="channelId != null">#{channelId},</if>
  148. </trim>
  149. </insert>
  150. <update id="updateAppUsersCharge" parameterType="com.game.business.domain.AppUsersCharge">
  151. update app_users_charge
  152. <trim prefix="SET" suffixOverrides=",">
  153. <if test="addtime != null">addtime = #{addtime},</if>
  154. <if test="updateTime != null">update_time = #{updateTime},</if>
  155. <if test="afterCoin != null">after_coin = #{afterCoin},</if>
  156. <if test="agentId != null">agent_id = #{agentId},</if>
  157. <if test="ambient != null">ambient = #{ambient},</if>
  158. <if test="coin != null">coin = #{coin},</if>
  159. <if test="coinType != null">coin_type = #{coinType},</if>
  160. <if test="coinGive != null">coin_give = #{coinGive},</if>
  161. <if test="platformService != null">platform_service = #{platformService},</if>
  162. <if test="platformServiceRate != null">platform_service_rate = #{platformServiceRate},</if>
  163. <if test="isAgent != null">is_agent = #{isAgent},</if>
  164. <if test="isDelete != null">is_delete = #{isDelete},</if>
  165. <if test="isWater != null">is_water = #{isWater},</if>
  166. <if test="money != null">money = #{money},</if>
  167. <if test="optType != null">opt_type = #{optType},</if>
  168. <if test="optUser != null">opt_user = #{optUser},</if>
  169. <if test="orderno != null">orderno = #{orderno},</if>
  170. <if test="pid != null">pid = #{pid},</if>
  171. <if test="pidLevel1 != null">pid_level1 = #{pidLevel1},</if>
  172. <if test="pidLevel2 != null">pid_level2 = #{pidLevel2},</if>
  173. <if test="pidLevel3 != null">pid_level3 = #{pidLevel3},</if>
  174. <if test="pidLevel4 != null">pid_level4 = #{pidLevel4},</if>
  175. <if test="remarks != null">remarks = #{remarks},</if>
  176. <if test="ruleId != null">rule_id = #{ruleId},</if>
  177. <if test="status != null">status = #{status},</if>
  178. <if test="touid != null">touid = #{touid},</if>
  179. <if test="tradeNo != null">trade_no = #{tradeNo},</if>
  180. <if test="type != null">type = #{type},</if>
  181. <if test="uid != null">uid = #{uid},</if>
  182. <if test="channelId != null">channel_id = #{channelId},</if>
  183. </trim>
  184. where id = #{id}
  185. </update>
  186. <delete id="deleteAppUsersChargeById" parameterType="Long">
  187. delete from app_users_charge where id = #{id}
  188. </delete>
  189. <delete id="deleteAppUsersChargeByIds" parameterType="String">
  190. delete from app_users_charge where id in
  191. <foreach item="id" collection="array" open="(" separator="," close=")">
  192. #{id}
  193. </foreach>
  194. </delete>
  195. <update id="getNewId">
  196. update sys_sequence set next_val = next_val + 2 where sequence_name = 'app_users_charge'
  197. <!-- 返回更新后的数量 -->
  198. <selectKey keyProperty="next_val" resultType="int" order="AFTER">
  199. SELECT next_val FROM sys_sequence WHERE sequence_name = 'app_users_charge'
  200. </selectKey>
  201. </update>
  202. </mapper>