From d17d536991ed2c27d3e5f665c69aa6937e15d792 Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Mon, 22 Sep 2025 13:08:12 +0800 Subject: [PATCH] refactor: simplify CityScreenMapper queries by removing redundant conditions and adding longitude/latitude fields --- .../mapper/material/cityScreen/CityScreenMapper.xml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/cityScreen/CityScreenMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/cityScreen/CityScreenMapper.xml index 00faa89..f6ebe46 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/cityScreen/CityScreenMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/cityScreen/CityScreenMapper.xml @@ -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 - - 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 (2,3) + where mdi.is_active = 1 + and jsp.city = #{city} group by jsp.id @@ -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 @@ -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 \ No newline at end of file