后台服务
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

155 rader
4.0 KiB

  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.iformall.mapper.WxGameActionLogMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxGameActionLog">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="game_id" jdbcType="BIGINT" property="gameId" />
  9. <result column="user_id" jdbcType="BIGINT" property="userId" />
  10. <result column="coupon_order_id" jdbcType="BIGINT" property="couponOrderId" />
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  12. <result column="type" jdbcType="INTEGER" property="type" />
  13. <result column="used_credit" jdbcType="INTEGER" property="usedCredit" />
  14. <result column="add_credit" jdbcType="INTEGER" property="addCredit" />
  15. </resultMap>
  16. <sql id="allColumns">
  17. `id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`coupon_order_id`,`channel_type`,`channel_id`,`create_time`,`type`,`used_credit`,`add_credit`
  18. </sql>
  19. <sql id="dynamicWhereConditions">
  20. where 1 = 1
  21. <if test=" null != id ">
  22. and `id` = #{id}
  23. </if>
  24. <if test=" null != tenantId and '' != tenantId">
  25. and `tenant_id` = #{tenantId}
  26. </if>
  27. <if test=" null != parentTenantId and '' != parentTenantId">
  28. and `parent_tenant_id` = #{parentTenantId}
  29. </if>
  30. <if test=" null != gameId ">
  31. and `game_id` = #{gameId}
  32. </if>
  33. <if test=" null != userId ">
  34. and `user_id` = #{userId}
  35. </if>
  36. <if test=" null != couponOrderId ">
  37. and `coupon_order_id` = #{couponOrderId}
  38. </if>
  39. <if test=" null != createTime ">
  40. and `create_time` = #{createTime}
  41. </if>
  42. <if test=" null != startTime ">
  43. and `start_time` &gt;= #{startTime}
  44. </if>
  45. <if test=" null != endTime ">
  46. and `end_time` &lt;= #{endTime}
  47. </if>
  48. <if test=" null != type ">
  49. and `type` = #{type}
  50. </if>
  51. <if test=" null != ids ">
  52. and id in
  53. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  54. #{idItem}
  55. </foreach>
  56. </if>
  57. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  58. </sql>
  59. <select id="findList" parameterType="com.iformall.domain.po.WxGameActionLog" resultMap="BaseResultMap">
  60. select
  61. <include refid="allColumns"/>
  62. from wx_game_action_log
  63. <include refid="dynamicWhereConditions" />
  64. </select>
  65. <sql id="dynamicCountWhereConditions">
  66. where 1 = 1
  67. <if test=" null != id ">
  68. and `id` = #{id}
  69. </if>
  70. <if test=" null != tenantId and '' != tenantId">
  71. and `tenant_id` = #{tenantId}
  72. </if>
  73. <if test=" null != parentTenantId and '' != parentTenantId">
  74. and `parent_tenant_id` = #{parentTenantId}
  75. </if>
  76. <if test=" null != gameId ">
  77. and `game_id` = #{gameId}
  78. </if>
  79. <if test=" null != userId ">
  80. and `user_id` = #{userId}
  81. </if>
  82. <if test=" null != couponOrderId ">
  83. and `coupon_order_id` = #{couponOrderId}
  84. </if>
  85. <if test=" null != startTime ">
  86. and `create_time` &gt;= #{startTime}
  87. </if>
  88. <if test=" null != endTime ">
  89. and `create_time` &lt;= #{endTime}
  90. </if>
  91. <if test=" null != type ">
  92. and `type` = #{type}
  93. </if>
  94. </sql>
  95. <select id="getPlayCount" resultType="java.lang.Integer" parameterType="com.iformall.domain.po.WxGameActionLog">
  96. select COUNT(*) FROM wx_game_action_log a
  97. <include refid="dynamicCountWhereConditions" />
  98. and `type` = 0
  99. </select>
  100. <select id="getPlayCreditCount" resultType="java.lang.Integer" parameterType="com.iformall.domain.po.WxGameActionLog">
  101. select COUNT(*) FROM wx_game_action_log a
  102. <include refid="dynamicCountWhereConditions" />
  103. and `type` = 1
  104. </select>
  105. <select id="getAwardCount" resultType="java.lang.Integer" parameterType="com.iformall.domain.po.WxGameActionLog">
  106. select COUNT(*) FROM wx_game_action_log a
  107. <include refid="dynamicCountWhereConditions" />
  108. and coupon_order_id != 0
  109. </select>
  110. </mapper>