123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.welampiot.dao.BroadcastItemDao">
- <insert id="addCommonProgramData" keyProperty="id" useGeneratedKeys="true" parameterType="BroadcastItemDTO">
- INSERT INTO broadcast_item(broadcastId,
- `name`,
- userId,
- <if test="proId1 != null and proId1 != 0">
- proId1,
- </if>
- <if test="proId2 != null and proId2 != 0">
- proId2,
- </if>
- <if test="proId3 != null and proId3 != 0">
- proId3,
- </if>
- <if test="proId4 != null and proId4 != 0">
- proId4,
- </if>
- <if test="proId5 != null and proId5 != 0">
- proId5,
- </if>
- <if test="proId6 != null and proId6 != 0">
- proId6,
- </if>
- <if test="proId7 != null and proId7 != 0">
- proId7,
- </if>
- <if test="proId8 != null and proId8 != 0">
- proId8,
- </if>
- <if test="proId9 != null and proId9 != 0">
- proId9,
- </if>
- <if test="proId10 != null and proId10 != 0">
- proId10,
- </if>
- <if test="policyType != null and policyType != 0">
- policyType,
- </if>
- <if test="playType != null">
- playType,
- </if>
- proType,
- createTime)
- VALUES (#{broadcastId},
- #{name},
- #{userId},
- <if test="proId1 != null and proId1 != 0">
- #{proId1},
- </if>
- <if test="proId2 != null and proId2 != 0">
- #{proId2},
- </if>
- <if test="proId3 != null and proId3 != 0">
- #{proId3},
- </if>
- <if test="proId4 != null and proId4 != 0">
- #{proId4},
- </if>
- <if test="proId5 != null and proId5 != 0">
- #{proId5},
- </if>
- <if test="proId6 != null and proId6 != 0">
- #{proId6},
- </if>
- <if test="proId7 != null and proId7 != 0">
- #{proId7},
- </if>
- <if test="proId8 != null and proId8 != 0">
- #{proId8},
- </if>
- <if test="proId9 != null and proId9 != 0">
- #{proId9},
- </if>
- <if test="proId10 != null and proId10 != 0">
- #{proId10},
- </if>
- <if test="policyType != null and policyType != 0">
- #{policyType},
- </if>
- <if test="playType != null">
- #{playType},
- </if>
- #{proType},
- #{createTime})
- </insert>
- <update id="updateCommonProgramData" parameterType="BroadcastItemDTO">
- update
- broadcast_item b
- set
- <if test="broadcastId != null and broadcastId != 0">
- b.broadcastId = #{broadcastId},
- </if>
- <if test="name != null and name != 0">
- b.name = #{name},
- </if>
- <if test="proId1 != null and proId1 != 0">
- b.proId1 = #{proId1},
- </if>
- <if test="proId2 != null and proId2 != 0">
- b.proId2 = #{proId2},
- </if>
- <if test="proId3 != null and proId3 != 0">
- b.proId3 = #{proId3},
- </if>
- <if test="proId4 != null and proId4 != 0">
- b.proId4 = #{proId4},
- </if>
- <if test="proId5 != null and proId5 != 0">
- b.proId5 = #{proId5},
- </if>
- <if test="proId6 != null and proId6 != 0">
- b.proId6 = #{proId6},
- </if>
- <if test="proId7 != null and proId7 != 0">
- b.proId7 = #{proId7},
- </if>
- <if test="proId8 != null and proId8 != 0">
- b.proId8 = #{proId8},
- </if>
- <if test="proId9 != null and proId9 != 0">
- b.proId9 = #{proId9},
- </if>
- <if test="proId10 != null and proId10 != 0">
- b.proId10 = #{proId10},
- </if>
- <if test="policyType != null and policyType != 0">
- b.policyType = #{policyType},
- </if>
- <if test="playType != null and playType != 0">
- b.playType = #{playType},
- </if>
- <if test="proType != null and proType != 0">
- b.proType = #{proType},
- </if>
- <if test="status != null">
- b.status = #{status},
- </if>
- <if test="weierxiId != null">
- b.weierxiId = #{weierxiId},
- </if>
- <if test="sipId != null">
- b.sip_id = #{sipId}
- </if>
- b.id = #{id}
- where
- b.id = #{id}
- </update>
- <select id="getBroadcastItemDTOById" resultType="BroadcastItemDTO">
- select b.id, b.broadcastId,b.`name`, b.userId,
- b.proId1, b.proId2, b.proId3, b.proId4, b.proId5,
- b.proId6, b.proId7, b.proId8, b.proId9, b.proId10,
- 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
- from broadcast_item b
- where b.id = #{id}
- </select>
- <delete id="deleteBroadcastItemDataById">
- delete
- from broadcast_item
- where id = #{id};
- </delete>
-
- <select id="getBroadcastItemListByItemVO" resultType="BroadcastItemDTO">
- select
- b.id,
- b.name,
- b.policyType,
- b.status,
- b.createTime
- from broadcast_item b
- where b.userId = #{userId}
- <if test="keyword != null and keyword != ''">
- and b.name like '%${keyword}%'
- </if>
- <if test="page >= 0 and count > 0">
- limit #{page},#{count}
- </if>
- </select>
- <select id="getBroadcastItemTotalByItemVO" resultType="Integer">
- select
- count(*)
- from broadcast_item b
- <trim prefix="where" suffixOverrides="and|or">
- <if test="userId != null">
- b.userId = #{userId} and
- </if>
- <if test="name != null">
- b.name = #{name} and
- </if>
- </trim>
- </select>
- <select id="getOneDataById" resultType="BroadcastItemDTO" parameterType="integer">
- select name from broadcast_item where id = #{id} order by id desc
- </select>
- <select id="getList" parameterType="BroadcastItemDTO" resultType="BroadcastItemDTO">
- 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
- from broadcast_item B
- <trim prefix="where" prefixOverrides="and|or">
- <if test="userId != null">
- B.userId = #{userId}
- </if>
- </trim>
- </select>
- </mapper>
|