( SELECT count(*) FROM t_detector_user duser WHERE duser.f_village_id = villageId AND duser.user_type = 1 ) AS userNum,
(
SELECT
count(*)
FROM
t_gasuser_safety_device_info deviceinfo
LEFT JOIN t_detector_user duser ON deviceinfo.f_relation_gasUser_id = duser.user_id
WHERE
duser.f_village_id = villageId
AND duser.user_type = 1
AND ( deviceinfo.is_del = 0 OR deviceinfo.is_del IS NULL )
) AS deviceNum,
'6' AS iconType,
( SELECT count(*) FROM t_detector_user_link_gas_bottle userlinkgas LEFT JOIN t_detector_user duser ON userlinkgas.f_user_id = duser.user_id WHERE duser.f_village_id = villageId ) AS gasBottle
FROM
t_user_manage_village userVillage
WHERE
userVillage.longitude IS NOT NULL
AND userVillage.latitude IS NOT NULL
<iftest="villageId != null and villageId != ''"> and duser.f_village_id = #{villageId}</if>