refactor: simplify CityScreenMapper queries by removing redundant conditions and adding longitude/latitude fields

This commit is contained in:
syruan 2025-09-22 13:08:12 +08:00
parent fb0ec77c8f
commit d17d536991
1 changed files with 7 additions and 6 deletions

View File

@ -201,14 +201,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
jsp.pro_name as projectName,
jsp.city as city,
jsp.county as county,
jsp.lon as lon,
jsp.lat as lat,
sum(mdi.device_count) as useNum
<!-- cp.lon as lon,-->
<!-- cp.lat as lat-->
from jj_sing_project jsp
left join ma_dev_info mdi on mdi.on_project = jsp.id
left join ma_type_view mtv on mtv.typeId = mdi.type_id
<!-- left join coordinate_point cp on cp.name = jsp.county-->
where mdi.is_active = 1 and mdi.own_co = #{companyId} and mdi.change_status in (2,3)
where mdi.is_active = 1
<!-- and mdi.change_status in (2,3)-->
and jsp.city = #{city}
group by jsp.id
</select>
@ -221,7 +222,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from jj_sing_project jsp
left join ma_dev_info mdi on mdi.on_project = jsp.id
left join ma_type_view mtv on mtv.typeId = mdi.type_id
where mdi.is_active = 1 and mdi.own_co = #{companyId} and mdi.change_status in (1,5)
where mdi.is_active = 1
and mdi.change_status in (1,5)
and jsp.city = #{city}
)r
</select>
@ -233,8 +235,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join ma_dev_info mdi on mdi.on_project = jsp.id
left join ma_type_view mtv on mtv.typeId = mdi.type_id
where mdi.is_active = 1
and mdi.own_co = #{companyId}
and mdi.change_status in (2, 3)
and (mdi.change_status in (2, 3) or mdi.change_status is null)
and jsp.city != #{city}) r
</select>
</mapper>