KuaishouLiveBroadcastMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  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.live.mapper.KuaishouLiveBroadcastMapper">
  6. <resultMap type="com.ruixuan.live.entity.KuaishouLiveBroadcast" id="KuaishouLiveBroadcastResult">
  7. <result property="id" column="id"/>
  8. <result property="ksId" column="ks_id"/>
  9. <result property="ksName" column="ks_name"/>
  10. <result property="accountId" column="account_id"/>
  11. <result property="accountName" column="account_name"/>
  12. <result property="goalGmv" column="goal_gmv"/>
  13. <result property="actualGmv" column="actual_gmv"/>
  14. <result property="gmvRoi" column="gmvRoi"/>
  15. <result property="liveTime" column="live_time"/>
  16. <result property="startTime" column="start_time"/>
  17. <result property="endTime" column="end_time"/>
  18. <result property="liveLevel" column="live_level"/>
  19. <result property="anchorId" column="anchor_id"/>
  20. <result property="anchor" column="anchor"/>
  21. <result property="traderId" column="trader_id"/>
  22. <result property="trader" column="trader"/>
  23. <result property="centralControlId" column="central_control_id"/>
  24. <result property="centralController" column="central_controller"/>
  25. <result property="fieldControlId" column="field_control_id"/>
  26. <result property="fieldController" column="field_controller"/>
  27. <result property="contentControlId" column="content_control_id"/>
  28. <result property="contentController" column="content_controller"/>
  29. <result property="inputControlId" column="input_control_id"/>
  30. <result property="inputController" column="input_controller"/>
  31. <result property="createrId" column="creater_id"/>
  32. <result property="uploadFileCount" column="upload_file_count"/>
  33. <result property="uploadFileCount" column="upload_file_count"/>
  34. <result property="createTime" column="create_time"/>
  35. <result property="updateTime" column="update_time"/>
  36. </resultMap>
  37. <sql id="selectKuaishouLiveBroadcastVo">
  38. select id,
  39. ks_id,
  40. ks_name,
  41. account_id,
  42. account_name,
  43. if(goal_gmv > 10000, CONCAT(ROUND(goal_gmv / 10000, 2), 'W'), goal_gmv) as 'goal_gmv',
  44. actual_gmv,
  45. if(actual_gmv is null, '-', CONCAT(ROUND(actual_gmv / goal_gmv * 100, 2), '%')) as 'gmvRoi',
  46. live_time,
  47. start_time,
  48. end_time,
  49. live_level,
  50. anchor_id,
  51. anchor,
  52. trader_id,
  53. trader,
  54. central_control_id,
  55. central_controller,
  56. field_control_id,
  57. field_controller,
  58. content_control_id,
  59. content_controller,
  60. input_control_id,
  61. input_controller,
  62. upload_file_count,
  63. upload_picture_count
  64. from kuaishou_live_broadcast
  65. </sql>
  66. <select id="selectKuaishouLiveBroadcastList" parameterType="com.ruixuan.live.entity.KuaishouLiveBroadcast"
  67. resultMap="KuaishouLiveBroadcastResult">
  68. <include refid="selectKuaishouLiveBroadcastVo"/>
  69. <where>
  70. <if test="ksId != null ">and ks_id = #{ksId}</if>
  71. <if test="ksName != null and ksName != ''">and ks_name like concat('%', #{ksName}, '%')</if>
  72. <if test="accountId != null ">and account_id = #{accountId}</if>
  73. <if test="accountName != null and accountName != ''">and account_name like concat('%', #{accountName},
  74. '%')
  75. </if>
  76. <if test="goalGmv != null and goalGmv != ''">and goal_gmv = #{goalGmv}</if>
  77. <if test="startTime != null and startTime != ''">and start_time >= #{startTime}</if>
  78. <if test="endTime != null and endTime != ''">and end_time &lt;= #{endTime}</if>
  79. <if test="liveLevel != null and liveLevel != ''">and live_level = #{liveLevel}</if>
  80. <if test="anchorId != null and anchorId != ''">and anchor_id = #{anchorId}</if>
  81. <if test="anchor != null and anchor != ''">and anchor = #{anchor}</if>
  82. <if test="traderId != null and traderId != ''">and trader_id = #{traderId}</if>
  83. <if test="trader != null and trader != ''">and trader = #{trader}</if>
  84. <if test="centralControlId != null and centralControlId != ''">and central_control_id =
  85. #{centralControlId}
  86. </if>
  87. <if test="centralController != null and centralController != ''">and central_controller
  88. like concat('%', #{centralController}, '%')
  89. </if>
  90. <if test="fieldControlId != null and fieldControlId != ''">and field_control_id = #{fieldControlId}</if>
  91. <if test="fieldController != null and fieldController != ''">and field_controller
  92. like concat('%', #{fieldController}, '%')
  93. </if>
  94. <if test="contentControlId != null and contentControlId != ''">and content_control_id =
  95. #{contentControlId}
  96. </if>
  97. <if test="contentController != null and contentController != ''">and content_controller
  98. like concat('%', #{contentController}, '%')
  99. </if>
  100. <if test="inputControlId != null and inputControlId != ''">and input_control_id = #{inputControlId}</if>
  101. <if test="inputController != null and inputController != ''">and input_controller
  102. like concat('%', #{inputController}, '%')
  103. </if>
  104. </where>
  105. ORDER BY create_time desc
  106. </select>
  107. <select id="selectKuaishouLiveBroadcastById" parameterType="String" resultMap="KuaishouLiveBroadcastResult">
  108. select id,
  109. ks_id,
  110. ks_name,
  111. account_id,
  112. account_name,
  113. goal_gmv,
  114. actual_gmv,
  115. live_time,
  116. start_time,
  117. end_time,
  118. live_level,
  119. anchor_id,
  120. anchor,
  121. trader_id,
  122. trader,
  123. central_control_id,
  124. central_controller,
  125. field_control_id,
  126. field_controller,
  127. content_control_id,
  128. content_controller,
  129. input_control_id,
  130. input_controller,
  131. upload_file_count,
  132. upload_picture_count
  133. from kuaishou_live_broadcast
  134. where id = #{id}
  135. </select>
  136. <select id="getOne" parameterType="com.ruixuan.live.entity.KuaishouLiveBroadcast"
  137. resultMap="KuaishouLiveBroadcastResult">
  138. <include refid="selectKuaishouLiveBroadcastVo"/>
  139. where ks_id = #{ksId}
  140. and account_name = #{accountName}
  141. and start_time = #{startTime}
  142. and end_time = #{endTime}
  143. <if test="id != null and id != ''">and id = #{id}</if>
  144. </select>
  145. <insert id="insertKuaishouLiveBroadcast" parameterType="com.ruixuan.live.entity.KuaishouLiveBroadcast">
  146. insert into kuaishou_live_broadcast
  147. <trim prefix="(" suffix=")" suffixOverrides=",">
  148. <if test="id != null">id,</if>
  149. <if test="ksId != null">ks_id,</if>
  150. <if test="ksName != null">ks_name,</if>
  151. <if test="accountId != null">account_id,</if>
  152. <if test="accountName != null">account_name,</if>
  153. <if test="actualGmv != null">actual_gmv,</if>
  154. <if test="goalGmv != null">goal_gmv,</if>
  155. <if test="liveTime != null">live_time,</if>
  156. <if test="startTime != null">start_time,</if>
  157. <if test="endTime != null">end_time,</if>
  158. <if test="liveLevel != null">live_level,</if>
  159. <if test="anchorId != null">anchor_id,</if>
  160. <if test="anchor != null">anchor,</if>
  161. <if test="traderId != null">trader_id,</if>
  162. <if test="trader != null">trader,</if>
  163. <if test="centralControlId != null">central_control_id,</if>
  164. <if test="centralController != null">central_controller,</if>
  165. <if test="fieldControlId != null">field_control_id,</if>
  166. <if test="fieldController != null">field_controller,</if>
  167. <if test="contentControlId != null">content_control_id,</if>
  168. <if test="contentController != null">content_controller,</if>
  169. <if test="inputControlId != null">input_control_id,</if>
  170. <if test="inputController != null">input_controller,</if>
  171. <if test="createrId != null">creater_id,</if>
  172. <if test="createTime != null">create_time,</if>
  173. <if test="updateTime != null">update_time,</if>
  174. </trim>
  175. <trim prefix="values (" suffix=")" suffixOverrides=",">
  176. <if test="id != null">#{id},</if>
  177. <if test="ksId != null">#{ksId},</if>
  178. <if test="ksName != null">#{ksName},</if>
  179. <if test="accountId != null">#{accountId},</if>
  180. <if test="accountName != null">#{accountName},</if>
  181. <if test="actualGmv != null">#{actualGmv},</if>
  182. <if test="goalGmv != null">#{goalGmv},</if>
  183. <if test="liveTime != null">#{liveTime},</if>
  184. <if test="startTime != null">#{startTime},</if>
  185. <if test="endTime != null">#{endTime},</if>
  186. <if test="liveLevel != null">#{liveLevel},</if>
  187. <if test="anchorId != null">#{anchorId},</if>
  188. <if test="anchor != null">#{anchor},</if>
  189. <if test="traderId != null">#{traderId},</if>
  190. <if test="trader != null">#{trader},</if>
  191. <if test="centralControlId != null">#{centralControlId},</if>
  192. <if test="centralController != null">#{centralController},</if>
  193. <if test="fieldControlId != null">#{fieldControlId},</if>
  194. <if test="fieldController != null">#{fieldController},</if>
  195. <if test="contentControlId != null">#{contentControlId},</if>
  196. <if test="contentController != null">#{contentController},</if>
  197. <if test="inputControlId != null">#{inputControlId},</if>
  198. <if test="inputController != null">#{inputController},</if>
  199. <if test="createrId != null">#{createrId},</if>
  200. <if test="createTime != null">#{createTime},</if>
  201. <if test="updateTime != null">#{updateTime},</if>
  202. </trim>
  203. </insert>
  204. <update id="updateKuaishouLiveBroadcast" parameterType="com.ruixuan.live.entity.KuaishouLiveBroadcast">
  205. update kuaishou_live_broadcast
  206. <trim prefix="SET" suffixOverrides=",">
  207. <if test="ksId != null">ks_id = #{ksId},</if>
  208. <if test="ksName != null">ks_name = #{ksName},</if>
  209. <if test="accountId != null">account_id = #{accountId},</if>
  210. <if test="accountName != null">account_name = #{accountName},</if>
  211. <if test="actualGmv != null">actual_gmv = #{actualGmv},</if>
  212. <if test="goalGmv != null">goal_gmv = #{goalGmv},</if>
  213. <if test="liveTime != null">live_time = #{liveTime},</if>
  214. <if test="startTime != null">start_time = #{startTime},</if>
  215. <if test="endTime != null">end_time = #{endTime},</if>
  216. <if test="liveLevel != null">live_level = #{liveLevel},</if>
  217. <if test="anchorId != null">anchor_id = #{anchorId},</if>
  218. <if test="anchor != null">anchor = #{anchor},</if>
  219. <if test="traderId != null">trader_id = #{traderId},</if>
  220. <if test="trader != null">trader = #{trader},</if>
  221. <if test="centralControlId != null">central_control_id = #{centralControlId},</if>
  222. <if test="centralController != null">central_controller = #{centralController},</if>
  223. <if test="fieldControlId != null">field_control_id = #{fieldControlId},</if>
  224. <if test="fieldController != null">field_controller = #{fieldController},</if>
  225. <if test="contentControlId != null">content_control_id = #{contentControlId},</if>
  226. <if test="contentController != null">content_controller = #{contentController},</if>
  227. <if test="inputControlId != null">input_control_id = #{inputControlId},</if>
  228. <if test="inputController != null">input_controller = #{inputController},</if>
  229. <if test="createrId != null">creater_id = #{createrId},</if>
  230. <if test="createTime != null">create_time = #{createTime},</if>
  231. <if test="updateTime != null">update_time = #{updateTime},</if>
  232. <if test="uploadPictureCount != null">upload_picture_count = #{uploadPictureCount},</if>
  233. <if test="uploadFileCount != null">upload_file_count = #{uploadFileCount},</if>
  234. </trim>
  235. where id = #{id}
  236. </update>
  237. <delete id="deleteKuaishouLiveBroadcastById" parameterType="String">
  238. delete
  239. from kuaishou_live_broadcast
  240. where id = #{id}
  241. </delete>
  242. <delete id="deleteKuaishouLiveBroadcastByIds" parameterType="String">
  243. delete from kuaishou_live_broadcast where id in
  244. <foreach item="id" collection="array" open="(" separator="," close=")">
  245. #{id}
  246. </foreach>
  247. </delete>
  248. </mapper>