DailyReportChannelPutInMapper.xml 5.4 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.DailyReportChannelPutInMapper">
  6. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.marketing.DailyReportChannelPutIn" >
  7. <id column="put_in_date" property="putInDate" jdbcType="VARCHAR" />
  8. <id column="channel" property="channel" jdbcType="VARCHAR" />
  9. <id column="app" property="app" jdbcType="VARCHAR" />
  10. <result column="amount_invested" property="amountInvested" jdbcType="INTEGER" />
  11. <result column="total_download" property="totalDownload" jdbcType="INTEGER" />
  12. <result column="purchase_download" property="purchaseDownload" jdbcType="INTEGER" />
  13. </resultMap>
  14. <sql id="Base_Column_List" >
  15. put_in_date, channel, app, amount_invested, total_download, purchase_download
  16. </sql>
  17. <select id="selectByPrimaryKey" resultMap="BaseResultMap">
  18. select
  19. <include refid="Base_Column_List" />
  20. from daily_report_channel_put_in
  21. where put_in_date = #{putInDate,jdbcType=VARCHAR}
  22. and channel = #{channel,jdbcType=VARCHAR}
  23. and app = #{app,jdbcType=VARCHAR}
  24. </select>
  25. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.DailyReportChannelPutIn" >
  26. insert into daily_report_channel_put_in (put_in_date, channel, app,
  27. amount_invested, total_download, purchase_download
  28. )
  29. values (#{putInDate,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, #{app,jdbcType=VARCHAR},
  30. #{amountInvested,jdbcType=INTEGER}, #{totalDownload,jdbcType=INTEGER}, #{purchaseDownload,jdbcType=INTEGER}
  31. )
  32. </insert>
  33. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.DailyReportChannelPutIn" >
  34. insert into daily_report_channel_put_in
  35. <trim prefix="(" suffix=")" suffixOverrides="," >
  36. <if test="putInDate != null" >
  37. put_in_date,
  38. </if>
  39. <if test="channel != null" >
  40. channel,
  41. </if>
  42. <if test="app != null" >
  43. app,
  44. </if>
  45. <if test="amountInvested != null" >
  46. amount_invested,
  47. </if>
  48. <if test="totalDownload != null" >
  49. total_download,
  50. </if>
  51. <if test="purchaseDownload != null" >
  52. purchase_download,
  53. </if>
  54. </trim>
  55. <trim prefix="values (" suffix=")" suffixOverrides="," >
  56. <if test="putInDate != null" >
  57. #{putInDate,jdbcType=VARCHAR},
  58. </if>
  59. <if test="channel != null" >
  60. #{channel,jdbcType=VARCHAR},
  61. </if>
  62. <if test="app != null" >
  63. #{app,jdbcType=VARCHAR},
  64. </if>
  65. <if test="amountInvested != null" >
  66. #{amountInvested,jdbcType=INTEGER},
  67. </if>
  68. <if test="totalDownload != null" >
  69. #{totalDownload,jdbcType=INTEGER},
  70. </if>
  71. <if test="purchaseDownload != null" >
  72. #{purchaseDownload,jdbcType=INTEGER},
  73. </if>
  74. </trim>
  75. </insert>
  76. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.DailyReportChannelPutIn" >
  77. update daily_report_channel_put_in
  78. <set >
  79. <if test="amountInvested != null" >
  80. amount_invested = #{amountInvested,jdbcType=INTEGER},
  81. </if>
  82. <if test="totalDownload != null" >
  83. total_download = #{totalDownload,jdbcType=INTEGER},
  84. </if>
  85. <if test="purchaseDownload != null" >
  86. purchase_download = #{purchaseDownload,jdbcType=INTEGER},
  87. </if>
  88. </set>
  89. where put_in_date = #{putInDate,jdbcType=VARCHAR}
  90. and channel = #{channel,jdbcType=VARCHAR}
  91. and app = #{app,jdbcType=VARCHAR}
  92. </update>
  93. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.marketing.DailyReportChannelPutIn" >
  94. update daily_report_channel_put_in
  95. set amount_invested = #{amountInvested,jdbcType=INTEGER},
  96. total_download = #{totalDownload,jdbcType=INTEGER},
  97. purchase_download = #{purchaseDownload,jdbcType=INTEGER}
  98. where put_in_date = #{putInDate,jdbcType=VARCHAR}
  99. and channel = #{channel,jdbcType=VARCHAR}
  100. and app = #{app,jdbcType=VARCHAR}
  101. </update>
  102. <delete id="deleteByPrimaryKey">
  103. delete from daily_report_channel_put_in
  104. where put_in_date = #{putInDate,jdbcType=VARCHAR}
  105. and channel = #{channel,jdbcType=VARCHAR}
  106. and app = #{app,jdbcType=VARCHAR}
  107. </delete>
  108. <select id="selectDailyReportChannelPutInByList" resultMap="BaseResultMap">
  109. select
  110. <include refid="Base_Column_List" />
  111. from daily_report_channel_put_in
  112. where 1 = 1
  113. <if test="channel != null and channel != ''">
  114. and channel = #{channel}
  115. </if>
  116. <if test="app != null and app != ''">
  117. and app = #{app}
  118. </if>
  119. <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
  120. and put_in_date between #{beginTime} and #{endTime}
  121. </if>
  122. order by put_in_date desc
  123. </select>
  124. </mapper>