样地+样木查询修正了limit 1并且做不完期末作业

This commit is contained in:
2025-12-08 13:30:28 +08:00
parent e755e9d98e
commit 256ec6da69
15 changed files with 223 additions and 107 deletions

View File

@@ -1,9 +1,10 @@
package com.whu.edu.LyStatistic.MapLyStatistic.Controller; package com.whu.edu.LyStatistic.MapLyStatistic.Controller;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.*; import com.whu.edu.LyStatistic.MapLyStatistic.Dto.*;
import com.whu.edu.LyStatistic.MapLyStatistic.Service.StatisticsService; import com.whu.edu.LyStatistic.MapLyStatistic.Service.StatisticService;
import com.whu.edu.LyStatistic.MapLyStatistic.Service.AttrService; import com.whu.edu.LyStatistic.MapLyStatistic.Service.AttrService;
import com.whu.edu.LyStatistic.MapLyStatistic.Service.DateService; import com.whu.edu.LyStatistic.MapLyStatistic.Service.DateService;
import com.whu.edu.LyStatistic.MapLyStatistic.Service.CountService;
import com.whu.edu.LyStatistic.Util.ApiResponse; import com.whu.edu.LyStatistic.Util.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@@ -22,11 +23,13 @@ import java.util.List;
public class StatisticsController { public class StatisticsController {
@Autowired @Autowired
private StatisticsService statisticsService; private StatisticService statisticService;
@Autowired @Autowired
private AttrService attrService; private AttrService attrService;
@Autowired @Autowired
private DateService dateService; private DateService dateService;
@Autowired
private CountService countService;
/** /**
* 小班属性 * 小班属性
* 入参内业小班号NYXBH+乡XIANG * 入参内业小班号NYXBH+乡XIANG
@@ -48,9 +51,9 @@ public class StatisticsController {
* 出参t1sub1内所有值、t1sub1_media中的媒体数据 * 出参t1sub1内所有值、t1sub1_media中的媒体数据
*/ */
@GetMapping("/t1sub1") @GetMapping("/t1sub1")
public ApiResponse<T1sub1DTO> getT1sub1(@RequestParam String database, @RequestParam String id) { public ApiResponse<List<T1sub1DTO>> getT1sub1(@RequestParam String database, @RequestParam String id) {
try { try {
T1sub1DTO data = attrService.getT1sub1(database, id); List<T1sub1DTO> data = attrService.getT1sub1(database, id);
return ApiResponse.success(data); return ApiResponse.success(data);
} catch (Exception e) { } catch (Exception e) {
return ApiResponse.error("查询小班属性失败:" + e.getMessage()); return ApiResponse.error("查询小班属性失败:" + e.getMessage());
@@ -63,9 +66,9 @@ public class StatisticsController {
* 出参t1sub2内所有值 * 出参t1sub2内所有值
*/ */
@GetMapping("/t1sub2") @GetMapping("/t1sub2")
public ApiResponse<T1sub2DTO> getT1sub2(@RequestParam String database, @RequestParam String id) { public ApiResponse<List<T1sub2DTO>> getT1sub2(@RequestParam String database, @RequestParam String id) {
try { try {
T1sub2DTO data = attrService.getT1sub2(database, id); List<T1sub2DTO> data = attrService.getT1sub2(database, id);
return ApiResponse.success(data); return ApiResponse.success(data);
} catch (Exception e) { } catch (Exception e) {
return ApiResponse.error("查询小班属性失败:" + e.getMessage()); return ApiResponse.error("查询小班属性失败:" + e.getMessage());
@@ -103,7 +106,7 @@ public class StatisticsController {
@GetMapping("/district/count") @GetMapping("/district/count")
public ApiResponse<DistrictCountDTO> getDistrictCount(@RequestParam String district) { public ApiResponse<DistrictCountDTO> getDistrictCount(@RequestParam String district) {
try { try {
DistrictCountDTO data = statisticsService.getDistrictCount(district); DistrictCountDTO data = countService.getDistrictCount(district);
return ApiResponse.success(data); return ApiResponse.success(data);
} catch (Exception e) { } catch (Exception e) {
return ApiResponse.error("查询区计数失败:" + e.getMessage()); return ApiResponse.error("查询区计数失败:" + e.getMessage());
@@ -118,7 +121,7 @@ public class StatisticsController {
@GetMapping("/plot/count") @GetMapping("/plot/count")
public ApiResponse<PlotCountDTO> getPlotCount(@RequestParam String rootId, @RequestParam String databaseName) { public ApiResponse<PlotCountDTO> getPlotCount(@RequestParam String rootId, @RequestParam String databaseName) {
try { try {
PlotCountDTO data = statisticsService.getPlotCount(rootId,databaseName); PlotCountDTO data = countService.getPlotCount(rootId,databaseName);
return ApiResponse.success(data); return ApiResponse.success(data);
} catch (Exception e) { } catch (Exception e) {
return ApiResponse.error("查询小班计数失败:" + e.getMessage()); return ApiResponse.error("查询小班计数失败:" + e.getMessage());
@@ -136,7 +139,7 @@ public class StatisticsController {
public ApiResponse<DistrictStatsDTO> getDistrictStats() { public ApiResponse<DistrictStatsDTO> getDistrictStats() {
try { try {
// 1⃣ 获取各区统计 List // 1⃣ 获取各区统计 List
List<PlotStatsDTO> statsList = statisticsService.getAllDistrictStats(); List<PlotStatsDTO> statsList = statisticService.getAllDistrictStats();
// 2⃣ 构建 DTO 需要的 Map // 2⃣ 构建 DTO 需要的 Map
Map<String, String> completionStatus = new LinkedHashMap<>(); Map<String, String> completionStatus = new LinkedHashMap<>();

View File

@@ -12,8 +12,8 @@ import java.util.List;
public interface AttrMapper { public interface AttrMapper {
PlotAttrDTO findPlotAttributes(@Param("nyxbh") String nyxbh,@Param("xiang") String xiang); PlotAttrDTO findPlotAttributes(@Param("nyxbh") String nyxbh,@Param("xiang") String xiang);
T1sub1DTO findT1sub1(@Param("database") String database, @Param("id") String id); List<T1sub1DTO> findT1sub1(@Param("database") String database, @Param("id") String id);
T1sub2DTO findT1sub2(@Param("database") String database, @Param("id") String id); List<T1sub2DTO> findT1sub2(@Param("database") String database, @Param("id") String id);
List<String> findMediaPaths(@Param("id") String id, List<String> findMediaPaths(@Param("id") String id,
@Param("databaseName") String databaseName, @Param("databaseName") String databaseName,
@Param("table") String table); @Param("table") String table);

View File

@@ -0,0 +1,26 @@
package com.whu.edu.LyStatistic.MapLyStatistic.Mapper;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.DistrictCountDTO;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotCountDTO;
import org.apache.ibatis.annotations.Mapper;
/**
* TaskCommonMapper.xml
* 区、小班的计数
*/
@Mapper
public interface CountMapper {
/**
* 按照区统计数量(内业外业样地数量)
* @return 统计结果 DTO
*/
DistrictCountDTO loadDistrictCount(String district);
/**
* 按照小班统计数量(样地数量)
* @return 统计结果 DTO
*/
PlotCountDTO loadPlotCount(String rootId, String databaseName);
}

View File

@@ -0,0 +1,23 @@
package com.whu.edu.LyStatistic.MapLyStatistic.Mapper;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotStatsDTO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* TaskCommonMapper.xml
* 通用 Mapper用于不同 schema 下的 roottable1 表
*/
@Mapper
public interface StatisticMapper {
/**
* 按照区统计图斑信息(数量、面积、各状态)
* @return 统计结果 DTO
*/
List<PlotStatsDTO> selectPlotStatsByDistrict();
}

View File

@@ -1,12 +1,8 @@
package com.whu.edu.LyStatistic.MapLyStatistic.Mapper; package com.whu.edu.LyStatistic.MapLyStatistic.Mapper;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotStatsDTO; import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotStatsDTO;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.DistrictCountDTO;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotCountDTO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* TaskCommonMapper.xml * TaskCommonMapper.xml
@@ -21,25 +17,6 @@ public interface TaskCommonMapper {
* @return 统计结果 DTO * @return 统计结果 DTO
*/ */
PlotStatsDTO selectPlotStats(@Param("schema") String schema); PlotStatsDTO selectPlotStats(@Param("schema") String schema);
/**
* 按照区统计图斑信息(数量、面积、各状态)
* @return 统计结果 DTO
*/
List<PlotStatsDTO> selectPlotStatsByDistrict();
/**
* 按照区统计数量(内业外业样地数量)
* @return 统计结果 DTO
*/
DistrictCountDTO loadDistrictCount(String district);
/**
* 按照小班统计信息(内业外业样地数量)
* @return 统计结果 DTO
*/
PlotCountDTO loadPlotCount(String rootId, String databaseName);
/** /**
* 获取所有小班的ID和边界信息 * 获取所有小班的ID和边界信息

View File

@@ -36,24 +36,30 @@ public class AttrService {
* 入参database_name+ID * 入参database_name+ID
* 出参t1sub1内所有值、t1sub1_media中的媒体数据 * 出参t1sub1内所有值、t1sub1_media中的媒体数据
*/ */
public T1sub1DTO getT1sub1(String database, String id){ public List<T1sub1DTO> getT1sub1(String database, String id){
T1sub1DTO schema = attrMapper.findT1sub1(database, id);
if (schema == null) { // 查询得到 List<T1sub1DTO>
List<T1sub1DTO> schema = attrMapper.findT1sub1(database, id);
if (schema == null || schema.isEmpty()) {
throw new RuntimeException("未找到对应的样地所在任务 schema"); throw new RuntimeException("未找到对应的样地所在任务 schema");
} }
// 第二次查 media_path 列表 // 为每条 DTO 设置 mediaPathList
List<String> mediaPaths = attrMapper.findMediaPaths(schema.getId(), schema.getDatabaseName(),"merged.t1sub1_media_merged"); for (T1sub1DTO dto : schema) {
List<String> mediaPaths = attrMapper.findMediaPaths(
// 设置到 DTO 中 dto.getId(),
schema.setMediaPathList(mediaPaths); dto.getDatabaseName(),
"merged.t1sub1_media_merged"
);
dto.setMediaPathList(mediaPaths);
}
return schema; return schema;
} }
public T1sub2DTO getT1sub2(String database, String id){ public List<T1sub2DTO> getT1sub2(String database, String id){
T1sub2DTO schema = attrMapper.findT1sub2(database, id); List<T1sub2DTO> schema = attrMapper.findT1sub2(database, id);
if (schema == null) { if (schema == null) {
throw new RuntimeException("未找到对应的样木所在任务 schema"); throw new RuntimeException("未找到对应的样木所在任务 schema");
} }

View File

@@ -0,0 +1,33 @@
package com.whu.edu.LyStatistic.MapLyStatistic.Service;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.DistrictCountDTO;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotCountDTO;
import com.whu.edu.LyStatistic.MapLyStatistic.Mapper.CountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CountService {
@Autowired
private CountMapper countMapper;
/**
* 查询区的计数信息
*/
public DistrictCountDTO getDistrictCount(String district) {
DistrictCountDTO data = countMapper.loadDistrictCount(district);
return data;
}
/**
* 查询小班的计数信息
*/
public PlotCountDTO getPlotCount(String rootId, String databaseName) {
PlotCountDTO data = countMapper.loadPlotCount(rootId,databaseName);
return data;
}
}

View File

@@ -1,26 +1,30 @@
package com.whu.edu.LyStatistic.MapLyStatistic.Service; package com.whu.edu.LyStatistic.MapLyStatistic.Service;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotStatsDTO; import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotStatsDTO;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.DistrictCountDTO; import com.whu.edu.LyStatistic.MapLyStatistic.Mapper.StatisticMapper;
import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotCountDTO;
//import com.whu.edu.LyStatistic.MapLyStatistic.Dto.UnitInfo;
//import com.whu.edu.LyStatistic.MapLyStatistic.Mapper.InfoMapper;
import com.whu.edu.LyStatistic.MapLyStatistic.Mapper.TaskCommonMapper;
//import com.whu.edu.LyStatistic.MapLyStatistic.Service.BaseService.BaseTaskQueryService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
@Service @Service
public class StatisticsService { public class StatisticService {
// @Autowired // @Autowired
// private InfoMapper unitInfoMapper; // 查询 unit_info // private InfoMapper unitInfoMapper; // 查询 unit_info
// //
// @Autowired // @Autowired
// private BaseTaskQueryService baseQueryService; // 通用任务查询 Service // private BaseTaskQueryService baseQueryService; // 通用任务查询 Service
@Autowired @Autowired
private TaskCommonMapper taskCommonMapper; private StatisticMapper statisticMapper;
/**
* 查询所有区的统计信息
* 返回 Map<区名, PlotStatsDTO>
*/
public List<PlotStatsDTO> getAllDistrictStats() {
// 直接从数据库一次性查出按区聚合后的统计数据
List<PlotStatsDTO> list = statisticMapper.selectPlotStatsByDistrict();
return list;
}
/** /**
* 查询单个区的统计信息 * 查询单个区的统计信息
*/ */
@@ -42,34 +46,6 @@ public class StatisticsService {
// return total; // return total;
// } // }
/**
* 查询所有区的统计信息
* 返回 Map<区名, PlotStatsDTO>
*/
public List<PlotStatsDTO> getAllDistrictStats() {
// 直接从数据库一次性查出按区聚合后的统计数据
List<PlotStatsDTO> list = taskCommonMapper.selectPlotStatsByDistrict();
return list;
}
/**
* 查询区的计数信息
*/
public DistrictCountDTO getDistrictCount(String district) {
DistrictCountDTO data = taskCommonMapper.loadDistrictCount(district);
return data;
}
/**
* 查询小班的计数信息
*/
public PlotCountDTO getPlotCount(String rootId, String databaseName) {
PlotCountDTO data = taskCommonMapper.loadPlotCount(rootId,databaseName);
return data;
}
/** /**
* 按街道统计传入区名称 * 按街道统计传入区名称
* 返回 Map<街道名, PlotStatsDTO> * 返回 Map<街道名, PlotStatsDTO>

View File

@@ -8,7 +8,7 @@ import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
public interface TaskStatisticMapper { public interface StatisticDataMapper {
/** /**
* 查询根表任务支持时间范围 + 人员过滤 * 查询根表任务支持时间范围 + 人员过滤

View File

@@ -1,7 +1,7 @@
package com.whu.edu.LyStatistic.statistic.service; package com.whu.edu.LyStatistic.statistic.service;
import com.whu.edu.LyStatistic.statistic.dto.*; import com.whu.edu.LyStatistic.statistic.dto.*;
import com.whu.edu.LyStatistic.statistic.mapper.TaskStatisticMapper; import com.whu.edu.LyStatistic.statistic.mapper.StatisticDataMapper;
import com.whu.edu.LyStatistic.statistic.mapper.UserStaffMapper; import com.whu.edu.LyStatistic.statistic.mapper.UserStaffMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -18,7 +18,7 @@ public class TaskStatisticService {
private UserStaffMapper userStaffMapper; private UserStaffMapper userStaffMapper;
@Autowired @Autowired
private TaskStatisticMapper taskStatisticMapper; private StatisticDataMapper statisticDataMapper;
/** /**
* 按 schema 和时间区间统计任务数据 * 按 schema 和时间区间统计任务数据
@@ -42,11 +42,11 @@ public class TaskStatisticService {
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
String districtName = taskStatisticMapper.getDistrictNameBySchema(schema); String districtName = statisticDataMapper.getDistrictNameBySchema(schema);
String villageName = taskStatisticMapper.getVillageNameBySchema(schema); String villageName = statisticDataMapper.getVillageNameBySchema(schema);
// 2⃣ 查询根表记录(支持时间区间) // 2⃣ 查询根表记录(支持时间区间)
List<RootTask> rootTasks = taskStatisticMapper.findRootTasksByTimeRange(schema, startTime, endTime, userIds); List<RootTask> rootTasks = statisticDataMapper.findRootTasksByTimeRange(schema, startTime, endTime, userIds);
if (rootTasks.isEmpty()) { if (rootTasks.isEmpty()) {
return new TaskStatisticResult(schema, districtName, villageName, Collections.emptyList(), 0, 0, 0, 0); return new TaskStatisticResult(schema, districtName, villageName, Collections.emptyList(), 0, 0, 0, 0);
} }
@@ -139,7 +139,7 @@ public class TaskStatisticService {
// 🧩 安全封装:防止 schema 无表时报错 // 🧩 安全封装:防止 schema 无表时报错
private Map<Long, Integer> safeCountByParent(String schema, String table, List<Long> rootIds) { private Map<Long, Integer> safeCountByParent(String schema, String table, List<Long> rootIds) {
try { try {
return taskStatisticMapper.countGroupByParent(schema, table, "parentID", rootIds) return statisticDataMapper.countGroupByParent(schema, table, "parentID", rootIds)
.stream() .stream()
.filter(m -> m.get("parentid") != null) .filter(m -> m.get("parentid") != null)
.collect(Collectors.toMap( .collect(Collectors.toMap(
@@ -153,7 +153,7 @@ public class TaskStatisticService {
private List<Map<String, Object>> safeFindSubIds(String schema, String table, List<Long> rootIds) { private List<Map<String, Object>> safeFindSubIds(String schema, String table, List<Long> rootIds) {
try { try {
return taskStatisticMapper.findSubIdsGroupByParent(schema, table, "parentID", rootIds); return statisticDataMapper.findSubIdsGroupByParent(schema, table, "parentID", rootIds);
} catch (Exception e) { } catch (Exception e) {
return Collections.emptyList(); return Collections.emptyList();
} }
@@ -161,7 +161,7 @@ public class TaskStatisticService {
private Integer safeCountByParentId(String schema, String table, Long parentId) { private Integer safeCountByParentId(String schema, String table, Long parentId) {
try { try {
return taskStatisticMapper.countByParentId(schema, table, "parentID", parentId); return statisticDataMapper.countByParentId(schema, table, "parentID", parentId);
} catch (Exception e) { } catch (Exception e) {
return 0; return 0;
} }

View File

@@ -15,7 +15,6 @@
SELECT * SELECT *
FROM merged.t1sub1_merged FROM merged.t1sub1_merged
WHERE database_name = #{database} AND "parentID" = #{id} WHERE database_name = #{database} AND "parentID" = #{id}
LIMIT 1
</select> </select>
<select id="findMediaPaths" resultType="string"> <select id="findMediaPaths" resultType="string">
@@ -30,7 +29,6 @@
SELECT * SELECT *
FROM merged.t1sub2_merged FROM merged.t1sub2_merged
WHERE database_name = #{database} AND "parentID" = #{id} WHERE database_name = #{database} AND "parentID" = #{id}
LIMIT 1
</select> </select>
</mapper> </mapper>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.whu.edu.LyStatistic.MapLyStatistic.Mapper.CountMapper">
<!-- 按区返回计数 -->
<select id="loadDistrictCount" resultType="com.whu.edu.LyStatistic.MapLyStatistic.Dto.DistrictCountDTO">
SELECT
"NY",
"WY",
"YD"
FROM xian_stats
WHERE "NAME" = #{district}
</select>
<!-- 按小班返回计数 -->
<select id="loadPlotCount" resultType="com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotCountDTO">
SELECT *
FROM root_summary
WHERE root_id = #{rootId} AND database_name = #{databaseName}
</select>
</mapper>

View File

@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.whu.edu.LyStatistic.MapLyStatistic.Mapper.StatisticMapper">
<select id="selectPlotStatsByDistrict"
resultType="com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotStatsDTO">
SELECT
r.region AS district,
-- 统计总行数plotCount
COUNT(*) AS plotCount,
-- 面积求和XBMJ 是 text需要转 numeric
COALESCE(SUM(NULLIF(m."XBMJ", '')::numeric), 0) AS totalArea,
-- status 也是 text因此必须先转 integer
COALESCE(SUM(CASE WHEN m."status"::int = -1 THEN 1 ELSE 0 END), 0) AS unPassedCount,
COALESCE(SUM(CASE WHEN m."status"::int = 0 THEN 1 ELSE 0 END), 0) AS assignedCount,
-- 新的状态统计逻辑
-- collector/reviewer有一个不是-1已采集
COALESCE(SUM(CASE
WHEN (m."collector" != '-1' OR m."reviewer" != '-1')
THEN 1 ELSE 0
END), 0) AS collectedCount,
-- collector/reviewer均为-1已发布未采集
COALESCE(SUM(CASE
WHEN m."collector" = '-1' AND m."reviewer" = '-1'
THEN 1 ELSE 0
END), 0) AS publishedUncollectedCount,
COALESCE(SUM(CASE WHEN m."status"::int = 2 THEN 1 ELSE 0 END), 0) AS approvedCount
FROM merged.roottable1_merged m
JOIN region r
ON substring(m."CUN", 1, 6) = r.regionid::text
GROUP BY r.region
ORDER BY r.region
</select>
<!--按街道
统计图斑信息:
- plotCount: 图斑数量
- totalArea: 图斑面积汇总 (XBMJ)
- 各状态数量 (-1,0,1,2)
-->
<select id="selectPlotStatsByStreet" resultType="com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotStatsDTO">
SELECT
COUNT(*) AS plotCount,
COALESCE(SUM("XBMJ"), 0) AS totalArea,
COALESCE(SUM(CASE WHEN "status" = -1 THEN 1 ELSE 0 END), 0) AS unPassedCount,
COALESCE(SUM(CASE WHEN "status" = 0 THEN 1 ELSE 0 END), 0) AS assignedCount,
COALESCE(SUM(CASE WHEN "status" = 1 THEN 1 ELSE 0 END), 0) AS collectedCount,
COALESCE(SUM(CASE WHEN "status" = 2 THEN 1 ELSE 0 END), 0) AS approvedCount
FROM merged.roottable1_merged
WHERE village = #{village}
</select>
</mapper>

View File

@@ -105,20 +105,5 @@
FROM "${schema}".roottable1 FROM "${schema}".roottable1
</select> </select>
<!-- 按区返回计数 -->
<select id="loadDistrictCount" resultType="com.whu.edu.LyStatistic.MapLyStatistic.Dto.DistrictCountDTO">
SELECT
"NY",
"WY",
"YD"
FROM xian_stats
WHERE "NAME" = #{district}
</select>
<!-- 按小班返回计数 -->
<select id="loadPlotCount" resultType="com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotCountDTO">
SELECT *
FROM root_summary
WHERE root_id = #{rootId} AND database_name = #{databaseName}
</select>
</mapper> </mapper>

View File

@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.whu.edu.LyStatistic.statistic.mapper.TaskStatisticMapper"> <mapper namespace="com.whu.edu.LyStatistic.statistic.mapper.StatisticDataMapper">
<!-- 根表记录 --> <!-- 根表记录 -->
<select id="findRootTasks" resultType="com.whu.edu.LyStatistic.statistic.dto.RootTask"> <select id="findRootTasks" resultType="com.whu.edu.LyStatistic.statistic.dto.RootTask">