and ${criterion.condition}
and ${criterion.condition} #{criterion.value}
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
and ${criterion.condition}
#{listItem}
z
id, name, address, longitude, latitude, mac, operate_user_id, state, is_delete, create_time,
install_time, monitor_point_id, device_version_id
select DATE_FORMAT(create_time,#{format}) as time, COUNT(*) as count from device
where create_time >= #{start}
and create_time
#{end}
and is_delete
]]> 1
GROUP BY DATE_FORMAT(create_time,#{format}) ;
select
dev.*,
ouser.name as operate_user_name,
dvn.name as device_version_name,
mpt.name as monitor_point_name
from device dev
left join operate_user ouser on dev.operate_user_id = ouser.id
left join device_version dvn on dev.device_version_id = dvn.id
left join monitor_point mpt on dev.monitor_point_id = mpt.id
where dev.id in (
select id from device
order by ${orderByClause}
)
SELECT
COUNT( d.state ) count,
d.state
FROM
device d
,monitor_point mp
WHERE
d.monitor_point_id = mp.id
AND mp.organization_id IN
#{listItem}
GROUP BY d.state
SELECT
s.`key`,
s.`name`
FROM
sensor s,
device d,
device_version_sensor dvs
WHERE
d.mac = #{mac}
AND d.device_version_id = dvs.version_id
AND dvs.sensor_id = s.id
ORDER BY
s.id
SELECT
device_version_id deviceVersionId
FROM
device
WHERE
monitor_point_id = #{monitorPoint}
GROUP BY
device_version_id
SELECT DISTINCT
d.device_version_id
FROM
monitor_point mp,
device d
WHERE
mp.area_code = #{areaCode}
AND d.monitor_point_id = mp.id
AND mp.organization_id IN
#{listItem}
SELECT
mac
FROM
device
WHERE
monitor_point_id = #{monitorPointId}
AND device_version_id = #{deviceVersionId}
SELECT dev.*,dve.version as device_version_value from device dev
left join monitor_point mpt on dev.monitor_point_id = mpt.id
left join device_version dve on dev.device_version_id = dve.id
(
1 > 1
or mpt.organization_id in
#{tempOrgId,jdbcType=INTEGER}
)
and dev.is_delete = 0
and dev.state = #{devState}
and
(
dev.name like CONCAT('%',#{name},'%')
or dev.mac like CONCAT('%',#{name},'%')
or mpt.name like CONCAT('%',#{name},'%')
)
SELECT dev.*,dve.version as device_version_value,mpt.* from device dev
left join monitor_point mpt on dev.monitor_point_id = mpt.id
left join device_version dve on dev.device_version_id = dve.id
(
1 > 1
or mpt.organization_id in
#{tempOrgId,jdbcType=INTEGER}
)
and dev.monitor_point_id = #{mpId}
and dev.is_delete = 0
SELECT dev.*,dve.version as device_version_value from device dev
left join monitor_point mpt on dev.monitor_point_id = mpt.id
left join device_version dve on dev.device_version_id = dve.id
(
1 > 1
or mpt.organization_id in
#{tempOrgId,jdbcType=INTEGER}
)
#{mapBounds.Le,jdbcType=NUMERIC}
AND dev.latitude < #{mapBounds.Fe,jdbcType=NUMERIC}
AND dev.latitude > #{mapBounds.Ke,jdbcType=NUMERIC}
]]>
AND mpt.${regionType}_code = #{regionCode}
AND dev.is_delete =0
call proc_organizationIds_GetByDeviceId(#{id,jdbcType=INTEGER});
select
dev.*,
mpt.name as monitor_point_name,
pro.name as profession_name,
dvn.version as device_version_value
from device dev
left join device_version dvn on dev.device_version_id = dvn.id
left join monitor_point mpt on dev.monitor_point_id = mpt.id
left join profession pro on pro.id = dev.profession_id
where dev.mac = #{mac,jdbcType=VARCHAR}
limit 0,1
SELECT
COUNT( * )
FROM
device d
WHERE
d.is_delete = 0
AND d.monitor_point_id IN (
SELECT
mp.id
FROM
monitor_point mp
WHERE
mp.is_delete = 0
AND mp.province_code = #{provinceCode}
AND mp.city_code = #{cityCode}
AND mp.area_code = #{areaCode}
AND mp.town_code = #{townCode}
AND mp.village_code = #{villageCode}
)
AND d.profession_id = #{professionId}
SELECT
*
FROM
device d
WHERE
d.is_delete = 0
AND d.monitor_point_id IN (
SELECT
mp.id
FROM
monitor_point mp
WHERE
mp.is_delete = 0
AND mp.province_code = #{provinceCode}
AND mp.city_code = #{cityCode}
AND mp.area_code = #{areaCode}
AND mp.id = #{monitorPointId}
AND mp.town_code = #{townCode}
AND mp.village_code = #{villageCode}
)
AND d.profession_id = #{professionId}
SELECT
d.*
FROM
device d,
monitor_point mp
WHERE
d.monitor_point_id = mp.id
AND d.is_delete = 0
AND mp.is_delete = 0
AND mp.organization_id = #{organizationId}
SELECT mac FROM `device` where state!=4;
SELECT * from device where mac=#{mac}
select d.longitude as longitude,d.latitude as latitude,
case when h.json->"$.e18[0]"=0 then 0.1 else h.json->"$.e18[0]" end
as windSpeed, h.json->"$.e23[0]" as windDir,
h.json->"$.e17[0]" as tVoc
from ${table} h ,`device` as d
where d.mac=h.mac and d.mac=#{mac} and h.time=#{time}
select d.longitude as longitude,d.latitude as latitude,
case when h.json->"$.e18[0]"=0 then 0.1 else h.json->"$.e18[0]" end
as windSpeed, h.json->"$.e23[0]" as windDir,
h.json->"$.e17[0]" as tVoc
from ${table} h ,`device` as d
where d.mac=h.mac and h.time=#{time}
and d.mac in (select d.mac from device , monitor_point as m where d.monitor_point_id=m.id and m.id=#{id})
SELECT
d.id deviceId,d.mac,d.state,d.name deviceName,
mp.id,mp.name
FROM
device d ,
monitor_point mp
d.monitor_point_id = mp.id
AND d.is_delete = 0
AND mp.is_delete = 0
AND mp.${regionType}_code = #{regionCode}
AND mp.organization_id IN
#{listItem}
select
dev.*,
ouser.name as operate_user_name,
dvn.name as device_version_name,
mpt.name as monitor_point_name,
mpt.province_code,
dp.device_tech,
dp.device_cat,
dp.device_source,
dp.ext_c,
dp.ext_d
from device dev
left join operate_user ouser on dev.operate_user_id = ouser.id
left join device_version dvn on dev.device_version_id = dvn.id
left join monitor_point mpt on dev.monitor_point_id = mpt.id
left join device_property dp on dev.id = dp.id
where dev.id in (
select id from device
order by ${orderByClause}
)
SELECT limit_val FROM view_device_density WHERE mac = #{mac}
SELECT d.mac
FROM monitor_point mp, device d
WHERE mp.id = d.monitor_point_id
AND mp.organization_id IN
#{organizationId}
AND d.is_delete = '0'
SELECT d.* FROM `device` as d,monitor_point as mp,device_property as dp where d.monitor_point_id=mp.id and d.id=dp.id and dp.device_tech=1 and d.monitor_point_id=#{id}
SELECT d.* FROM `device` as d,monitor_point as mp,device_property as dp where d.monitor_point_id=mp.id and d.id=dp.id and dp.device_tech=2 and d.monitor_point_id=#{id}
SELECT d.* FROM `device` as d,monitor_point as mp,device_property as dp where d.monitor_point_id=mp.id and d.id=dp.id and dp.device_tech=3 and d.monitor_point_id=#{id}
SELECT id from
device_version
where id in
(SELECT s.device_version_id
from
(SELECT device_version_id
from
device_version_sensor
WHERE sensor_Id in
(SELECT id from
sensor
where
sensor_key='e18' or sensor_key='e23')) s
GROUP BY s.device_version_id
HAVING count(1)=2)
and is_delete=0;
SELECT dev.id,dev.mac,dev.device_version_id deviceVersionId from device dev
left join monitor_point mpt on dev.monitor_point_id = mpt.id
(
1 > 1
or mpt.organization_id in
#{tempOrgId,jdbcType=INTEGER}
)
AND mpt.${regionType}_code = #{regionCode}
AND dev.is_delete =0
select d.longitude as longitude,d.latitude as latitude,
case when h.json->"$.e18[0]"=0 then 0.1 else h.json->"$.e18[0]" end
as windSpeed, h.json->"$.e23[0]" as windDir
from history_minutely_202007 h ,`device` as d
where h.time="2020-07-20 15:30:00" and h.json->"$.e23[0]" is not null and h.mac in(SELECT d.mac FROM monitor_point m
where d.monitor_point_id=m.id
)
select * from device where monitor_point_id in
#{item}
SELECT *
FROM device
WHERE mac = #{mac}