Sfoglia il codice sorgente

补充路段总数查询

zhj 9 mesi fa
parent
commit
bc2789c720

+ 2 - 0
src/main/java/com/welampiot/controller/DataController.java

@@ -710,7 +710,9 @@ public class DataController extends BaseController {
         baseVO.setSectionList(sectionList);
         baseVO.setPageAndCount(baseVO.getPage(), baseVO.getCount());
         List<SectionDTO> sectionLampCountsList = sectionService.getSectionLampCountsListByBaseVO(baseVO);
+        Integer total = sectionService.getSectionAllCountByBaseVO(baseVO);
         SectionVO sectionVO = new SectionVO();
+        sectionVO.setTotal(total);
         sectionVO.setList(sectionLampCountsList);
         return toolUtils.response(InterfaceResultEnum.OPERATION_SUCCESS, version, sectionVO);
     }

+ 1 - 0
src/main/java/com/welampiot/dao/SectionDao.java

@@ -26,4 +26,5 @@ public interface SectionDao {
     SectionDTO getDataByVO(SectionDTO dto);
     void updateSectionById(SectionDTO dto);
     List<SectionDTO> getSectionLampCountsListByBaseVO(BaseVO baseVO);
+    Integer getSectionAllCountByBaseVO(BaseVO baseVO);
 }

+ 1 - 0
src/main/java/com/welampiot/service/SectionService.java

@@ -27,4 +27,5 @@ public interface SectionService {
     SectionDTO getDataByVO(SectionDTO dto);
     void updateSectionById(SectionDTO dto);
     List<SectionDTO> getSectionLampCountsListByBaseVO(BaseVO baseVO);
+    Integer getSectionAllCountByBaseVO(BaseVO baseVO);
 }

+ 5 - 0
src/main/java/com/welampiot/service/impl/SectionServiceImpl.java

@@ -91,4 +91,9 @@ public class SectionServiceImpl implements SectionService {
     public List<SectionDTO> getSectionLampCountsListByBaseVO(BaseVO baseVO) {
         return sectionDao.getSectionLampCountsListByBaseVO(baseVO);
     }
+
+    @Override
+    public Integer getSectionAllCountByBaseVO(BaseVO baseVO) {
+        return sectionDao.getSectionAllCountByBaseVO(baseVO);
+    }
 }

+ 1 - 0
src/main/java/com/welampiot/vo/SectionVO.java

@@ -7,6 +7,7 @@ import java.util.List;
 
 @Data
 public class SectionVO {
+    private Integer total;
     private List idList;
     private Integer version;
     private List<SectionDTO> list;

+ 30 - 0
src/main/resources/mapper/SectionMapper.xml

@@ -183,4 +183,34 @@
         </if>
     </select>
 
+    <select id="getSectionAllCountByBaseVO" resultType="Integer">
+        SELECT
+            count(*)
+        FROM
+        section s
+        LEFT JOIN global_location a ON a.id = s.pid
+        LEFT JOIN global_location b ON b.id = a.pid
+        LEFT JOIN global_location c ON c.id = b.pid
+        WHERE
+        1=1
+        <if test="sectionList != null and !sectionList.isEmpty()">
+            AND s.id IN
+            <foreach collection="sectionList" item="item" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="provinceId != null and provinceId != 0">
+            AND c.id = #{provinceId}
+        </if>
+        <if test="cityId != null and cityId != 0">
+            AND b.id = #{cityId}
+        </if>
+        <if test="areaId != null and areaId != 0">
+            AND a.id = #{areaId}
+        </if>
+        <if test="sectionId != null and sectionId != 0">
+            AND s.id = #{sectionId}
+        </if>
+    </select>
+
 </mapper>