BroadcastItemMapper.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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.welampiot.dao.BroadcastItemDao">
  4. <insert id="addCommonProgramData" keyProperty="id" useGeneratedKeys="true" parameterType="BroadcastItemDTO">
  5. INSERT INTO broadcast_item(broadcastId,
  6. `name`,
  7. userId,
  8. <if test="proId1 != null and proId1 != 0">
  9. proId1,
  10. </if>
  11. <if test="proId2 != null and proId2 != 0">
  12. proId2,
  13. </if>
  14. <if test="proId3 != null and proId3 != 0">
  15. proId3,
  16. </if>
  17. <if test="proId4 != null and proId4 != 0">
  18. proId4,
  19. </if>
  20. <if test="proId5 != null and proId5 != 0">
  21. proId5,
  22. </if>
  23. <if test="proId6 != null and proId6 != 0">
  24. proId6,
  25. </if>
  26. <if test="proId7 != null and proId7 != 0">
  27. proId7,
  28. </if>
  29. <if test="proId8 != null and proId8 != 0">
  30. proId8,
  31. </if>
  32. <if test="proId9 != null and proId9 != 0">
  33. proId9,
  34. </if>
  35. <if test="proId10 != null and proId10 != 0">
  36. proId10,
  37. </if>
  38. <if test="policyType != null and policyType != 0">
  39. policyType,
  40. </if>
  41. <if test="playType != null">
  42. playType,
  43. </if>
  44. proType,
  45. createTime)
  46. VALUES (#{broadcastId},
  47. #{name},
  48. #{userId},
  49. <if test="proId1 != null and proId1 != 0">
  50. #{proId1},
  51. </if>
  52. <if test="proId2 != null and proId2 != 0">
  53. #{proId2},
  54. </if>
  55. <if test="proId3 != null and proId3 != 0">
  56. #{proId3},
  57. </if>
  58. <if test="proId4 != null and proId4 != 0">
  59. #{proId4},
  60. </if>
  61. <if test="proId5 != null and proId5 != 0">
  62. #{proId5},
  63. </if>
  64. <if test="proId6 != null and proId6 != 0">
  65. #{proId6},
  66. </if>
  67. <if test="proId7 != null and proId7 != 0">
  68. #{proId7},
  69. </if>
  70. <if test="proId8 != null and proId8 != 0">
  71. #{proId8},
  72. </if>
  73. <if test="proId9 != null and proId9 != 0">
  74. #{proId9},
  75. </if>
  76. <if test="proId10 != null and proId10 != 0">
  77. #{proId10},
  78. </if>
  79. <if test="policyType != null and policyType != 0">
  80. #{policyType},
  81. </if>
  82. <if test="playType != null">
  83. #{playType},
  84. </if>
  85. #{proType},
  86. #{createTime})
  87. </insert>
  88. <update id="updateCommonProgramData" parameterType="BroadcastItemDTO">
  89. update
  90. broadcast_item b
  91. set
  92. <if test="broadcastId != null and broadcastId != 0">
  93. b.broadcastId = #{broadcastId},
  94. </if>
  95. <if test="name != null and name != 0">
  96. b.name = #{name},
  97. </if>
  98. <if test="proId1 != null and proId1 != 0">
  99. b.proId1 = #{proId1},
  100. </if>
  101. <if test="proId2 != null and proId2 != 0">
  102. b.proId2 = #{proId2},
  103. </if>
  104. <if test="proId3 != null and proId3 != 0">
  105. b.proId3 = #{proId3},
  106. </if>
  107. <if test="proId4 != null and proId4 != 0">
  108. b.proId4 = #{proId4},
  109. </if>
  110. <if test="proId5 != null and proId5 != 0">
  111. b.proId5 = #{proId5},
  112. </if>
  113. <if test="proId6 != null and proId6 != 0">
  114. b.proId6 = #{proId6},
  115. </if>
  116. <if test="proId7 != null and proId7 != 0">
  117. b.proId7 = #{proId7},
  118. </if>
  119. <if test="proId8 != null and proId8 != 0">
  120. b.proId8 = #{proId8},
  121. </if>
  122. <if test="proId9 != null and proId9 != 0">
  123. b.proId9 = #{proId9},
  124. </if>
  125. <if test="proId10 != null and proId10 != 0">
  126. b.proId10 = #{proId10},
  127. </if>
  128. <if test="policyType != null and policyType != 0">
  129. b.policyType = #{policyType},
  130. </if>
  131. <if test="playType != null and playType != 0">
  132. b.playType = #{playType},
  133. </if>
  134. <if test="proType != null and proType != 0">
  135. b.proType = #{proType},
  136. </if>
  137. <if test="status != null">
  138. b.status = #{status},
  139. </if>
  140. <if test="weierxiId != null">
  141. b.weierxiId = #{weierxiId},
  142. </if>
  143. <if test="sipId != null">
  144. b.sip_id = #{sipId}
  145. </if>
  146. b.id = #{id}
  147. where
  148. b.id = #{id}
  149. </update>
  150. <select id="getBroadcastItemDTOById" resultType="BroadcastItemDTO">
  151. select b.id, b.broadcastId,b.`name`, b.userId,
  152. b.proId1, b.proId2, b.proId3, b.proId4, b.proId5,
  153. b.proId6, b.proId7, b.proId8, b.proId9, b.proId10,
  154. b.playType,b.proType,b.policyType,b.createTime,b.taskId,b.taskId2,b.xiankeId as xianKeId,b.guid as guid,b.number,b.weierxiId as weiErXiId
  155. from broadcast_item b
  156. where b.id = #{id}
  157. </select>
  158. <delete id="deleteBroadcastItemDataById">
  159. delete
  160. from broadcast_item
  161. where id = #{id};
  162. </delete>
  163. <select id="getBroadcastItemListByItemVO" resultType="BroadcastItemDTO">
  164. select
  165. b.id,
  166. b.name,
  167. b.policyType,
  168. b.status,
  169. b.createTime
  170. from broadcast_item b
  171. where b.userId = #{userId}
  172. <if test="keyword != null and keyword != ''">
  173. and b.name like '%${keyword}%'
  174. </if>
  175. <if test="page >= 0 and count > 0">
  176. limit #{page},#{count}
  177. </if>
  178. </select>
  179. <select id="getBroadcastItemTotalByItemVO" resultType="Integer">
  180. select
  181. count(*)
  182. from broadcast_item b
  183. <trim prefix="where" suffixOverrides="and|or">
  184. <if test="userId != null">
  185. b.userId = #{userId} and
  186. </if>
  187. <if test="name != null">
  188. b.name = #{name} and
  189. </if>
  190. </trim>
  191. </select>
  192. <select id="getOneDataById" resultType="BroadcastItemDTO" parameterType="integer">
  193. select name from broadcast_item where id = #{id} order by id desc
  194. </select>
  195. <select id="getList" parameterType="BroadcastItemDTO" resultType="BroadcastItemDTO">
  196. select B.id,B.name,B.proType,B.createTime,B.broadcastId,B.status,B.proId1,B.proId2,B.proId3,B.proId4,B.proId5,B.proId6,B.proId7,B.proId8,B.proId9,B.proId10
  197. from broadcast_item B
  198. <trim prefix="where" prefixOverrides="and|or">
  199. <if test="userId != null">
  200. B.userId = #{userId}
  201. </if>
  202. </trim>
  203. </select>
  204. </mapper>