=obr.date)
order by objectsensor_id;
]]>
=mu.date_create)
and (${read} is null or (${read} and date_read is not null) or (not ${read} and date_read is null))
]]>
=m.date_create) and m.del=false )
union all
(SELECT 'Создано карточек ДТП' description, count(1) cnt FROM incidentcard ic where (${date_start} is null or FROM_UNIXTIME(${date_start})<=ic.date) and (${date_end} is null or FROM_UNIXTIME(${date_end})>=ic.date) and ic.del=false)
union all
(SELECT 'В обработке' description, count(1) cnt FROM incidentcard ic where ic.status='В обработке' and (${date_start} is null or FROM_UNIXTIME(${date_start})<=ic.date) and (${date_end} is null or FROM_UNIXTIME(${date_end})>=ic.date) and ic.del=false)
union all
(SELECT 'В исполнении' description, count(1) cnt FROM incidentcard ic where ic.status='В исполнении' and (${date_start} is null or FROM_UNIXTIME(${date_start})<=ic.date) and (${date_end} is null or FROM_UNIXTIME(${date_end})>=ic.date) and ic.del=false)
union all
(SELECT 'Выполнено' description, count(1) cnt FROM incidentcard ic where ic.status='Выполнено' and (${date_start} is null or FROM_UNIXTIME(${date_start})<=ic.date) and (${date_end} is null or FROM_UNIXTIME(${date_end})>=ic.date) and ic.del=false)
]]>
=ore.date)
and (${value_min} is null or ${value_min}<=value)
and (${value_max} is null or ${value_max}>=value)
ORDER BY o.name, ose.name, ore.date
]]>
=ol.`date`)
group by ol.object_id
]]>
=ol.`date`)
and (o.company_id in (select company_id from CompaniesUsers where del=false and user_id=${_user_id}) or getAccess(${_user_id}, 'show_all'))
ORDER BY o.name, g.name, ol.`date` DESC
]]>