DailyReportMapper.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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.juxiao.xchat.module.xbd.mapper.marketing.DailyReportMapper">
  6. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.marketing.DailyReport" >
  7. <id column="report_id" property="reportId" jdbcType="INTEGER" />
  8. <result column="str1" property="str1" jdbcType="VARCHAR" />
  9. <result column="str2" property="str2" jdbcType="VARCHAR" />
  10. <result column="str3" property="str3" jdbcType="VARCHAR" />
  11. <result column="str4" property="str4" jdbcType="VARCHAR" />
  12. <result column="str5" property="str5" jdbcType="VARCHAR" />
  13. <result column="str6" property="str6" jdbcType="VARCHAR" />
  14. <result column="str7" property="str7" jdbcType="VARCHAR" />
  15. <result column="str8" property="str8" jdbcType="VARCHAR" />
  16. <result column="str9" property="str9" jdbcType="VARCHAR" />
  17. <result column="str10" property="str10" jdbcType="VARCHAR" />
  18. <result column="str11" property="str11" jdbcType="VARCHAR" />
  19. <result column="str12" property="str12" jdbcType="VARCHAR" />
  20. <result column="str13" property="str13" jdbcType="VARCHAR" />
  21. <result column="str14" property="str14" jdbcType="VARCHAR" />
  22. <result column="str15" property="str15" jdbcType="VARCHAR" />
  23. <result column="str16" property="str16" jdbcType="VARCHAR" />
  24. <result column="str17" property="str17" jdbcType="VARCHAR" />
  25. <result column="str18" property="str18" jdbcType="VARCHAR" />
  26. <result column="str19" property="str19" jdbcType="VARCHAR" />
  27. <result column="str20" property="str20" jdbcType="VARCHAR" />
  28. <result column="str21" property="str21" jdbcType="VARCHAR" />
  29. <result column="str22" property="str22" jdbcType="VARCHAR" />
  30. <result column="str23" property="str23" jdbcType="VARCHAR" />
  31. <result column="str24" property="str24" jdbcType="VARCHAR" />
  32. <result column="str25" property="str25" jdbcType="VARCHAR" />
  33. <result column="str26" property="str26" jdbcType="VARCHAR" />
  34. <result column="str27" property="str27" jdbcType="VARCHAR" />
  35. <result column="str28" property="str28" jdbcType="VARCHAR" />
  36. <result column="str29" property="str29" jdbcType="VARCHAR" />
  37. <result column="str30" property="str30" jdbcType="VARCHAR" />
  38. <result column="str31" property="str31" jdbcType="VARCHAR" />
  39. <result column="str32" property="str32" jdbcType="VARCHAR" />
  40. <result column="str33" property="str33" jdbcType="VARCHAR" />
  41. <result column="str34" property="str34" jdbcType="VARCHAR" />
  42. <result column="str35" property="str35" jdbcType="VARCHAR" />
  43. <result column="str36" property="str36" jdbcType="VARCHAR" />
  44. <result column="str37" property="str37" jdbcType="VARCHAR" />
  45. <result column="str38" property="str38" jdbcType="VARCHAR" />
  46. <result column="str39" property="str39" jdbcType="VARCHAR" />
  47. <result column="str40" property="str40" jdbcType="VARCHAR" />
  48. <result column="str41" property="str41" jdbcType="VARCHAR" />
  49. <result column="str42" property="str42" jdbcType="VARCHAR" />
  50. <result column="str43" property="str43" jdbcType="VARCHAR" />
  51. <result column="str44" property="str44" jdbcType="VARCHAR" />
  52. <result column="str45" property="str45" jdbcType="VARCHAR" />
  53. <result column="str46" property="str46" jdbcType="VARCHAR" />
  54. <result column="str47" property="str47" jdbcType="VARCHAR" />
  55. <result column="str48" property="str48" jdbcType="VARCHAR" />
  56. <result column="str49" property="str49" jdbcType="VARCHAR" />
  57. <result column="str50" property="str50" jdbcType="VARCHAR" />
  58. <result column="str51" property="str51" jdbcType="VARCHAR" />
  59. <result column="str52" property="str52" jdbcType="VARCHAR" />
  60. <result column="str53" property="str53" jdbcType="VARCHAR" />
  61. <result column="str54" property="str54" jdbcType="VARCHAR" />
  62. <result column="str55" property="str55" jdbcType="VARCHAR" />
  63. <result column="str56" property="str56" jdbcType="VARCHAR" />
  64. <result column="str57" property="str57" jdbcType="VARCHAR" />
  65. <result column="str58" property="str58" jdbcType="VARCHAR" />
  66. <result column="str59" property="str59" jdbcType="VARCHAR" />
  67. <result column="str60" property="str60" jdbcType="VARCHAR" />
  68. <result column="str61" property="str61" jdbcType="VARCHAR" />
  69. <result column="str62" property="str62" jdbcType="VARCHAR" />
  70. <result column="str63" property="str63" jdbcType="VARCHAR" />
  71. <result column="str64" property="str64" jdbcType="VARCHAR" />
  72. <result column="str65" property="str65" jdbcType="VARCHAR" />
  73. </resultMap>
  74. <sql id="Base_Column_List" >
  75. report_id, str1, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12,
  76. str13, str14, str15, str16, str17, str18, str19, str20, str21, str22, str23, str24,
  77. str25, str26, str27, str28, str29, str30, str31, str32, str33, str34, str35, str36,
  78. str37, str38, str39, str40, str41, str42, str43, str44, str45, str46, str47, str48,
  79. str49, str50, str51, str52, str53, str54, str55, str56, str57, str58, str59, str60,
  80. str61, str62, str63, str64, str65
  81. </sql>
  82. <sql id="Base_Daily_Column_List" >
  83. report_id, str1, str2, str3, str4, str5, str6, str7, str8, str9, str10, str11, str12,
  84. str13, str14, str15, str16, str17, str18, str19, str20, str21, str22, str23, str24,
  85. str25, str26, str27, str28, str29, str30, str31, str32, str33, str34, str35, str36,
  86. str37, str38, str39, str40, str41, str42, str43, str44, str45, str46, str47, str48,
  87. str49, str50
  88. </sql>
  89. <select id="selectDailyReportByList" resultMap="BaseResultMap">
  90. select
  91. <if test="distinct" >
  92. distinct
  93. </if>
  94. 'true' as QUERYID,
  95. <include refid="Base_Column_List" />
  96. from daily_report
  97. order by report_id desc
  98. </select>
  99. <select id="selectDailyReport" resultMap="BaseResultMap">
  100. select
  101. <include refid="Base_Daily_Column_List" />
  102. from daily_report
  103. where 1 = 1
  104. <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
  105. and str1 between #{beginTime} and #{endTime}
  106. </if>
  107. order by report_id desc
  108. </select>
  109. <resultMap id="DailyUserPurseResultMap" type="com.juxiao.xchat.module.xbd.domain.report.DailyUserPurse" >
  110. <result column="create_date" property="createDate" jdbcType="VARCHAR" />
  111. <result column="gold_sum" property="goldSum" jdbcType="BIGINT" />
  112. <result column="diamond_sum" property="diamondSum" jdbcType="BIGINT" />
  113. <result column="gift_nomal_diamond_sum" property="giftNomalDiamondSum" jdbcType="BIGINT" />
  114. <result column="gift_draw_diamond_sum" property="giftDrawDiamondSum" jdbcType="BIGINT" />
  115. </resultMap>
  116. <select id="selectDailyUserPurse" resultMap="DailyUserPurseResultMap">
  117. SELECT DATE_FORMAT(create_date,'%Y-%m-%d') as create_date,gold_sum,diamond_sum,gift_nomal_diamond_sum,gift_draw_diamond_sum
  118. FROM stat_daily_user_purse
  119. <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''" >
  120. WHERE create_date BETWEEN #{beginTime} AND #{endTime}
  121. </if>
  122. ORDER BY create_date DESC
  123. </select>
  124. </mapper>