| | |
| | | else length(ds.area_divide_ids) - length(replace(ds.area_divide_ids, ',', '')) + 1 |
| | | end as area_count, |
| | | ( |
| | | select COALESCE(sum(`` |
| | | case |
| | | when ad.device_ids is null or ad.device_ids = '' then 0 |
| | | else length(ad.device_ids) - length(replace(ad.device_ids, ',', '')) + 1 |
| | | end |
| | | ), 0) |
| | | SELECT COALESCE( |
| | | SUM( -- 这里已经删除了那两个反引号 `` |
| | | CASE |
| | | WHEN ad.device_ids IS NULL OR ad.device_ids = '' THEN 0 |
| | | ELSE length(ad.device_ids) - length(replace(ad.device_ids, ',', '')) + 1 |
| | | END |
| | | ), 0 |
| | | ) |
| | | from ja_fw_area_divide ad |
| | | where ad.is_deleted = 0 |
| | | and ad.id::VARCHAR = ANY(string_to_array(ds.area_divide_ids, ',')) |