BroadcastItemMapper.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. playType,
  42. proType,
  43. createTime)
  44. VALUES (#{broadcastId},
  45. #{name},
  46. #{userId},
  47. <if test="proId1 != null and proId1 != 0">
  48. #{proId1},
  49. </if>
  50. <if test="proId2 != null and proId2 != 0">
  51. #{proId2},
  52. </if>
  53. <if test="proId3 != null and proId3 != 0">
  54. #{proId3},
  55. </if>
  56. <if test="proId4 != null and proId4 != 0">
  57. #{proId4},
  58. </if>
  59. <if test="proId5 != null and proId5 != 0">
  60. #{proId5},
  61. </if>
  62. <if test="proId6 != null and proId6 != 0">
  63. #{proId6},
  64. </if>
  65. <if test="proId7 != null and proId7 != 0">
  66. #{proId7},
  67. </if>
  68. <if test="proId8 != null and proId8 != 0">
  69. #{proId8},
  70. </if>
  71. <if test="proId9 != null and proId9 != 0">
  72. #{proId9},
  73. </if>
  74. <if test="proId10 != null and proId10 != 0">
  75. #{proId10},
  76. </if>
  77. <if test="policyType != null and policyType != 0">
  78. #{policyType},
  79. </if>
  80. #{playType},
  81. #{proType},
  82. #{createTime})
  83. </insert>
  84. <update id="updateCommonProgramData" parameterType="BroadcastItemDTO">
  85. update
  86. broadcast_item b
  87. set
  88. <if test="broadcastId != null and broadcastId != 0">
  89. b.broadcastId = #{broadcastId},
  90. </if>
  91. <if test="name != null and name != 0">
  92. b.name = #{name},
  93. </if>
  94. <if test="proId1 != null and proId1 != 0">
  95. b.proId1 = #{proId1},
  96. </if>
  97. <if test="proId2 != null and proId2 != 0">
  98. b.proId2 = #{proId2},
  99. </if>
  100. <if test="proId3 != null and proId3 != 0">
  101. b.proId3 = #{proId3},
  102. </if>
  103. <if test="proId4 != null and proId4 != 0">
  104. b.proId4 = #{proId4},
  105. </if>
  106. <if test="proId5 != null and proId5 != 0">
  107. b.proId5 = #{proId5},
  108. </if>
  109. <if test="proId6 != null and proId6 != 0">
  110. b.proId6 = #{proId6},
  111. </if>
  112. <if test="proId7 != null and proId7 != 0">
  113. b.proId7 = #{proId7},
  114. </if>
  115. <if test="proId8 != null and proId8 != 0">
  116. b.proId8 = #{proId8},
  117. </if>
  118. <if test="proId9 != null and proId9 != 0">
  119. b.proId9 = #{proId9},
  120. </if>
  121. <if test="proId10 != null and proId10 != 0">
  122. b.proId10 = #{proId10},
  123. </if>
  124. <if test="policyType != null and policyType != 0">
  125. b.policyType = #{policyType},
  126. </if>
  127. <if test="playType != null and playType != 0">
  128. b.playType = #{playType},
  129. </if>
  130. <if test="proType != null and proType != 0">
  131. b.proType = #{proType},
  132. </if>
  133. <if test="status != null">
  134. b.status = #{status},
  135. </if>
  136. b.id = #{id}
  137. where
  138. b.id = #{id}
  139. </update>
  140. <select id="getBroadcastItemDTOById" resultType="BroadcastItemDTO">
  141. select b.id, b.broadcastId,b.`name`, b.userId,
  142. b.proId1, b.proId2, b.proId3, b.proId4, b.proId5,
  143. b.proId6, b.proId7, b.proId8, b.proId9, b.proId10,
  144. 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
  145. from broadcast_item b
  146. where b.id = #{id}
  147. </select>
  148. <delete id="deleteBroadcastItemDataById">
  149. delete
  150. from broadcast_item
  151. where id = #{id};
  152. </delete>
  153. <select id="getBroadcastItemListByItemVO" resultType="BroadcastItemDTO">
  154. select
  155. b.id,
  156. b.name,
  157. b.policyType,
  158. b.status,
  159. b.createTime
  160. from broadcast_item b
  161. where b.userId = #{userId}
  162. <if test="keyword != null and keyword != ''">
  163. and b.name like '%${keyword}%'
  164. </if>
  165. <if test="page >= 0 and count > 0">
  166. limit #{page},#{count}
  167. </if>
  168. </select>
  169. <select id="getBroadcastItemTotalByItemVO" resultType="Integer">
  170. select
  171. count(*)
  172. from broadcast_item b
  173. where b.userId = #{userId}
  174. </select>
  175. <select id="getOneDataById" resultType="BroadcastItemDTO" parameterType="integer">
  176. select name from broadcast_item where id = #{id} order by id desc
  177. </select>
  178. </mapper>