Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 

77 строки
2.8 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.WxGameUserCountMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxGameUserCount">
  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="user_phone" jdbcType="VARCHAR" property="userPhone" />
  11. <result column="user_name" jdbcType="VARCHAR" property="userName" />
  12. <result column="user_nick_name" jdbcType="VARCHAR" property="userNickName" />
  13. <result column="add_count" jdbcType="INTEGER" property="addCount" />
  14. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  15. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  16. </resultMap>
  17. <sql id="allColumns">
  18. `id`,`tenant_id`,`parent_tenant_id`,`game_id`,`user_id`,`user_phone`,`user_name`,`user_nick_name`,`add_count`,`create_time`,`update_time`
  19. </sql>
  20. <sql id="dynamicWhereConditions">
  21. where 1 = 1
  22. <if test=" null != id ">
  23. and `id` = #{id}
  24. </if>
  25. <if test=" null != tenantId and '' != tenantId">
  26. and `tenant_id` = #{tenantId}
  27. </if>
  28. <if test=" null != parentTenantId and '' != parentTenantId">
  29. and `parent_tenant_id` = #{parentTenantId}
  30. </if>
  31. <if test=" null != gameId ">
  32. and `game_id` = #{gameId}
  33. </if>
  34. <if test=" null != userId ">
  35. and `user_id` = #{userId}
  36. </if>
  37. <if test=" null != userPhone and '' != userPhone">
  38. and `user_phone` like concat('%', #{userPhone},'%')
  39. </if>
  40. <if test=" null != userName and '' != userName">
  41. and `user_name` like concat('%', #{userName},'%')
  42. </if>
  43. <if test=" null != userNickName and '' != userNickName">
  44. and `user_nick_name` like concat('%', #{userNickName},'%')
  45. </if>
  46. <if test=" null != ids ">
  47. and id in
  48. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  49. #{idItem}
  50. </foreach>
  51. </if>
  52. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  53. </sql>
  54. <select id="findList" parameterType="com.iformall.domain.po.WxGameUserCount" resultMap="BaseResultMap">
  55. select
  56. <include refid="allColumns"/>
  57. from wx_game_user_count
  58. <include refid="dynamicWhereConditions" />
  59. </select>
  60. <select id="sumUserCount" parameterType="com.iformall.domain.po.WxGameUserCount" resultType="Integer">
  61. select sum(add_count)
  62. from wx_game_user_count where `tenant_id` = #{tenantId} and `game_id` = #{gameId} and `user_id` = #{userId}
  63. </select>
  64. </mapper>