select b.id,b.name,b.dev_id devId,b.address,b.online,b.vol,bi.name as proName,b.isPlay,
lp.name as lampPoleName,lp.id as lampPoleId,b.type,b.install_date installDate,b.expiration_date expirationDate
from broadcast b
left join broadcast_item bi on bi.id = b.itemId
left join lamp_pole lp on b.lamp_pole_id = lp.id
left join broadcast_pro_list as BP on b.proId = BP.id
where b.lamp_pole_id != 0
and lp.areaid = #{areaId}
and lp.sectionid = #{sectionId}
and lp.sectionid in
#{dto}
and b.online = 0
and b.online = 1
order by convert(lp.number using gbk) asc,
convert(b.name using gbk) asc,b.id desc
select count(b.id) as total from broadcast b
left join lamp_pole lp on b.lamp_pole_id = lp.id
where lp.sectionid in
#{dto}
select count(b.id) as total from broadcast b
left join lamp_pole lp on b.lamp_pole_id = lp.id
where b.online = 1
and lp.sectionid in
#{dto}
select u.id from user u
where u.username = #{username}
select b.id,b.name,b.url
from broadcast_pro_list b
where b.userId = #{userId}
select b.id,b.name,b.proType,b.broadcastId,b.status,b.createTime,b1.name as broadcastStr
from broadcast_item b left join broadcast b1 on b.broadcastId = b1.id
left join lamp_pole lp on lp.id = b1.lamp_pole_id
left join section s on lp.sectionid = s.id
where b.userId = #{userId}
and b.broadcastId = #{devId}
delete
from broadcast
where id = #{id};
select b.lamp_pole_id as lampPoleId,lp.sectionid as sectionId,b.address,b.type,b.dev_id as devId,b.name,
from broadcast b
left join lamp_pole lp on lp.id = b.lamp_pole_id
left join section s on lp.sectionid = s.id
where b.id = #{id}
select count(*)
from broadcast b
where b.lamp_pole_id = #{lampPoleId}
select b.lamp_pole_id,lp.sectionid as sectionId,b.id,b.itemId as proId,
b2.name as proName,b3.time,b.online
from broadcast b
left join lamp_pole lp on lp.id = b.lamp_pole_id
left join broadcast_pro_list b3 on b3.id = b.proId
left join broadcast_item b2 on b2.id = b.itemId
left join section s on lp.sectionid = s.id
where b.lamp_pole_id = #{lampPoleId}
select count(*)
from broadcast b
where 1=1
and b.address = #{address}
and b.lamp_pole_id != #{lampPoleId}
and b.name = #{name}
and b.id != #{id}
update
broadcast e
set
e.install_date = #{installDate},
e.expiration_date = #{expirationDate},
e.address = #{address},
e.type = #{type},
e.name = #{name}
where 1=1
and e.lamp_pole_id = #{lampPoleId}
and e.id = #{id}
update
broadcast e
set
e.vol = #{vol},
e.policy_id = #{policyId},
e.itemId = #{itemId},
e.id = #{id}
where e.id = #{id}
select address,online,dev_id as devId,type,vol
from broadcast b
where id in (#{ids})
select isPlay,proId,itemId,id
from broadcast
where lamp_pole_id = #{lampPoleId} order by id desc
select a.id,a.online,a.isPlay,a.type,b.name as itemName,c.name as proName
from broadcast a left join broadcast_item b on a.itemId = b.id
left join broadcast_pro_list c on a.proId = c.id
where a.lamp_pole_id = #{lampPoleId}
select count(*) as total from broadcast b
left join broadcast_item bi on bi.id = b.itemId
left join lamp_pole lp on b.lamp_pole_id = lp.id
left join broadcast_pro_list as BP on b.proId = BP.id
where b.lamp_pole_id != 0
and lp.areaid = #{areaId}
and lp.sectionid = #{sectionId}
and lp.sectionid in
#{dto}
and b.online = 0
and b.online = 1
order by convert(lp.number using gbk) asc,
convert(b.name using gbk) asc,b.id desc
select id,name,dev_id as devId,name,vol,address,lamp_pole_id as lampPoleId from broadcast
id in
#{item}