You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

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