KuaishouLiveDataFunnelMapper.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.ruixuan.data.mapper.KuaishouLiveDataFunnelMapper">
  6. <resultMap type="com.ruixuan.data.entity.KuaishouLiveDataFunnel" id="KuaishouLiveDataFunnelResult">
  7. <result property="ksId" column="ks_id"/>
  8. <result property="ksName" column="ks_name"/>
  9. <result property="accountId" column="account_id"/>
  10. <result property="accountName" column="account_name"/>
  11. <result property="allViewers" column="all_viewers"/>
  12. <result property="statDate" column="stat_date"/>
  13. <result property="createTime" column="create_time"/>
  14. <result property="updateTime" column="update_time"/>
  15. </resultMap>
  16. <sql id="selectKuaishouLiveDataFunnelVo">
  17. select ks_id,
  18. ks_name,
  19. account_id,
  20. account_name,
  21. all_viewers,
  22. stat_date,
  23. create_time,
  24. update_time
  25. from kuaishou_live_data_funnel
  26. </sql>
  27. <select id="selectKuaishouLiveDataFunnelList" parameterType="com.ruixuan.data.entity.KuaishouLiveDataFunnel"
  28. resultMap="KuaishouLiveDataFunnelResult">
  29. <include refid="selectKuaishouLiveDataFunnelVo"/>
  30. <where>
  31. <if test="ksId != null ">and ks_id = #{ksId}</if>
  32. <if test="ksName != null and ksName != ''">and ks_name like concat('%', #{ksName}, '%')</if>
  33. <if test="accountId != null ">and account_id = #{accountId}</if>
  34. <if test="accountName != null and accountName != ''">and account_name like concat('%', #{accountName},
  35. '%')
  36. </if>
  37. <if test="allViewers != null ">and all_viewers = #{allViewers}</if>
  38. <if test="statDate != null and statDate != ''">and stat_date = #{statDate}</if>
  39. </where>
  40. </select>
  41. <select id="selectKuaishouLiveDataFunnelByKsId" parameterType="Long" resultMap="KuaishouLiveDataFunnelResult">
  42. <include refid="selectKuaishouLiveDataFunnelVo"/>
  43. where ks_id = #{ksId}
  44. </select>
  45. <insert id="insertKuaishouLiveDataFunnel" parameterType="com.ruixuan.data.entity.KuaishouLiveDataFunnel">
  46. insert into kuaishou_live_data_funnel
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <if test="ksId != null">ks_id,</if>
  49. <if test="ksName != null">ks_name,</if>
  50. <if test="accountId != null">account_id,</if>
  51. <if test="accountName != null">account_name,</if>
  52. <if test="allViewers != null">all_viewers,</if>
  53. <if test="statDate != null">stat_date,</if>
  54. <if test="createTime != null">create_time,</if>
  55. <if test="updateTime != null">update_time,</if>
  56. </trim>
  57. <trim prefix="values (" suffix=")" suffixOverrides=",">
  58. <if test="ksId != null">#{ksId},</if>
  59. <if test="ksName != null">#{ksName},</if>
  60. <if test="accountId != null">#{accountId},</if>
  61. <if test="accountName != null">#{accountName},</if>
  62. <if test="allViewers != null">#{allViewers},</if>
  63. <if test="statDate != null">#{statDate},</if>
  64. <if test="createTime != null">#{createTime},</if>
  65. <if test="updateTime != null">#{updateTime},</if>
  66. </trim>
  67. </insert>
  68. <update id="updateKuaishouLiveDataFunnel" parameterType="com.ruixuan.data.entity.KuaishouLiveDataFunnel">
  69. update kuaishou_live_data_funnel
  70. <trim prefix="SET" suffixOverrides=",">
  71. <if test="ksName != null">ks_name = #{ksName},</if>
  72. <if test="accountId != null">account_id = #{accountId},</if>
  73. <if test="accountName != null">account_name = #{accountName},</if>
  74. <if test="allViewers != null">all_viewers = #{allViewers},</if>
  75. <if test="statDate != null">stat_date = #{statDate},</if>
  76. <if test="createTime != null">create_time = #{createTime},</if>
  77. <if test="updateTime != null">update_time = #{updateTime},</if>
  78. </trim>
  79. where ks_id = #{ksId}
  80. </update>
  81. <delete id="deleteKuaishouLiveDataFunnelByKsId" parameterType="Long">
  82. delete
  83. from kuaishou_live_data_funnel
  84. where ks_id = #{ksId}
  85. </delete>
  86. <delete id="deleteKuaishouLiveDataFunnelByKsIds" parameterType="String">
  87. delete from kuaishou_live_data_funnel where ks_id in
  88. <foreach item="ksId" collection="array" open="(" separator="," close=")">
  89. #{ksId}
  90. </foreach>
  91. </delete>
  92. <insert id="inserExcelBatchInfo">
  93. replace into kuaishou_live_data_funnel(
  94. ks_id,
  95. ks_name,
  96. account_id,
  97. account_name,
  98. all_viewers,
  99. stat_date
  100. )
  101. values
  102. <foreach collection="funnelList" item="cell" separator=",">
  103. (
  104. #{cell.ksId},
  105. #{cell.ksName},
  106. #{cell.accountId},
  107. #{cell.accountName},
  108. #{cell.allViewers},
  109. #{cell.statDate}
  110. )
  111. </foreach>
  112. </insert>
  113. </mapper>