select c.id,c.name,c.online,c.type,c.manhole1_X manhole1X,c.manhole1_Y manhole1Y,c.manhole1_Z manhole1Z,
c.manhole1_V manhole1V,c.manhole1_A manhole1A,c.manhole2_X manhole2X,c.manhole2_Y manhole2Y,c.manhole2_Z manhole2Z,
c.manhole2_V manhole2V,c.manhole2_A manhole2A,c.manhole3_X manhole3X,c.manhole3_Y manhole3Y,c.manhole3_Z manhole3Z,
c.manhole3_V manhole3V,c.manhole3_A manhole3A,c.manhole4_X manhole4X,c.manhole4_Y manhole4Y,c.manhole4_Z manhole4Z,
c.manhole4_V manhole4V,c.manhole4_A manhole4A,c.manhole5_X manhole5X,c.manhole5_Y manhole5Y,c.manhole5_Z manhole5Z,
c.manhole5_V manhole5V,c.manhole5_A manhole5A,c.temperature1_T temperature1T,c.temperature1_V temperature1V,
c.temperature1_A temperature1A,c.temperature2_T temperature2T,c.temperature2_V temperature2V,c.temperature2_A temperature2A,
c.temperature3_T temperature3T,c.temperature3_V temperature3V,c.temperature3_A temperature3A,c.water_W waterW,c.water_V waterV,
c.water_A waterA,c.ch4,c.co,c.h2s,c.o2,c.gas_V gasV,c.gas_A gasA,c.updatetime as updateTime,s.timezone
from cable c left join lamp_pole lp on lp.id = c.lamp_pole_id
left join section s on lp.sectionid = s.id
where 1=1
and (c.name like '%${keyword}%' or c.address like '%${keyword}%')
and lp.sectionid in
#{dto}
order by convert(c.name using gbk) asc,c.id desc
limit #{page},#{count}
select count(c.id) as total
from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
where 1=1
and lp.sectionid in
#{dto}
and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
select count(c.id) as total
from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
where c.online = 1
and lp.sectionid in
#{dto}
and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
select count(c.id) as total
from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
where c.online = 1 and (c.temperature1_A != 0 or c.temperature2_A != 0 or c.temperature3_A != 0)
and lp.sectionid in
#{dto}
and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
select count(c.id) as total
from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
where c.online = 1 and c.water_A != 0
and lp.sectionid in
#{dto}
and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
select count(c.id) as total
from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
where c.online = 1 and (c.manhole1_A != 0 or c.manhole2_A != 0 or c.manhole3_A != 0 or c.manhole4_A != 0 or c.manhole5_A != 0)
and lp.sectionid in
#{dto}
and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
select count(c.id) as total
from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
where c.online = 1 and c.gas_A = 1
and lp.sectionid in
#{dto}
and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
select count(c.id) as total
from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
where c.online = 1 and c.gas_A = 2
and lp.sectionid in
#{dto}
and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
select count(c.id) as total
from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
where c.online = 1 and c.gas_A = 4
and lp.sectionid in
#{dto}
and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
select count(c.id) as total
from cable c left join lamp_pole lp on c.lamp_pole_id = lp.id
where c.online = 1 and c.gas_A = 8
and lp.sectionid in
#{dto}
and (c.address like '%${keyword}%' or c.name like '%${keyword}%')
delete
from cable
where id = #{id};
select b.lamp_pole_id,lp.sectionid as sectionId
from cable 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 cable b
where b.lamp_pole_id = #{lampPoleId}
select b.lamp_pole_id,lp.sectionid as sectionId
from cable b
left join lamp_pole lp on lp.id = b.lamp_pole_id
left join section s on lp.sectionid = s.id
where b.lamp_pole_id = #{lampPoleId}
select count(*)
from cable b
where 1=1
and b.address = #{address}
and b.lamp_pole_id != #{lampPoleId}
and b.name = #{name}
and b.id != #{id}
update
cable 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}