select id,name from `group`
where sectionid in
#{vo}
select g.id,g.name,g.number,g.sectionid as sectionId,g.areaid as areaId,g.type,g.value,g.lampid as lampId,
(select count(id) from lampinfo where find_in_set(id,g.lampid)) as lampCount,g.onLight,g.offLight,g.day_or_night,g.patrolinterval as patrolInterval,g.devType,s.name as section,p.name as policy,
gl.english_name as area
gl.ru_name as area
gl.chinese_name as area
from `group` as g
left join section s on g.sectionid = s.id
left join global_location gl on gl.id = s.pid
left join policy p on g.value = p.id
where 1=1
and g.sectionid in
#{vo}
and g.devType = #{devType}
and g.name like '%#{keyword}%'
order by g.name asc
limit #{offset},#{limit}
select count(*)
from `group` as g
where 1=1
and g.sectionid in
#{vo}
and g.devType = #{devType}
and g.name like '%#{keyword}%'
select
g.name,g.number,g.id,g.areaid as areaId,g.sectionid as sectionId,(select count(id) from lampinfo where find_in_set(id,g.lampid)) as lampCount,g.type,g.value,s.name as section,g.lampid as lampId,
gl.english_name as area
gl.ru_name as area
gl.chinese_name as area
from `group` as g
left join section s on g.sectionid = s.id
left join global_location gl on gl.id = s.pid
where g.id=#{id}
and g.sectionid in
#{vo}
limit 1
insert into `group` (name,number,lampid,areaid,sectionid,lampcount,createtime,devType,updatetime
)
values
(#{name},#{number},#{lampId},#{areaId},#{sectionId},#{lampCount},#{createTime},#{devType},#{updateTime}
)
select count(id) from `group`
where 1=1
and sectionid = #{sectionId}
and name = #{name}
and number = #{number}
and id != #{id}
update `group` set
name = #{name},
number = #{number},
lampid = #{lampId},
areaid = #{areaId},
sectionid = #{sectionId},
lampcount = #{lampCount},
devType = #{devType},
updatetime = #{updateTime}
where id = #{id}
delete from `group` where id=#{id};
select g.name,g.id,g.value,g.type,g.offLight,g.onLight,g.updatetime as updateTime,g.lampcount as lampCount,g.color_temp as colarTemp,s.timezone
from `group` g
left join section s on g.sectionid = s.id
where 1=1
and g.name like '%${keyword}%'
and g.sectionid in
#{dto}
and g.devType = 0
and g.devType = 1
select p.name
from policy p
where p.id = #{id}
select count(g.id)
from `group` g
where 1=1
and g.sectionid in
#{item}
and g.areaid = #{areaId}
select
g.id,
g.lampid as lampId,
g.devType,
g.patrolinterval as patrolInterval,
g.type,
g.value
from `group` g
where g.id = #{id}
update
`group` g
set
g.lampid = #{lampId}
where
g.id = #{id}
select id,lampid,number from `group`
id in
#{id}