|
@@ -119,7 +119,7 @@
|
|
|
left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
|
|
|
<where>
|
|
|
<if test="forestGridLevel != null and forestGridLevel != ''">
|
|
|
- and a.forest_grid_level = #{forestGridLevel}
|
|
|
+ and a.forest_grid_level = #{forestGridLevel}
|
|
|
</if>
|
|
|
${params.dataScope}
|
|
|
</where>
|
|
@@ -163,7 +163,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCarCount" parameterType="CenterdataTForestCar" resultType="Map">
|
|
|
- select count(a.id) value, b.dict_label name from centerdata_t_forest_car a
|
|
|
+ select count(a.id) value, b.dict_label name from centerdata_t_forest_car a
|
|
|
left join ${database_system}.sys_dict_data b on a.forest_brand = b.dict_value
|
|
|
left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
|
|
|
<where>
|
|
@@ -198,8 +198,14 @@
|
|
|
from centerdata_t_forest_plan ) a, (select sum(area) as totalarea from centerdata_t_forest_afforestationarea) b
|
|
|
</select>
|
|
|
|
|
|
- <select id="queryTaskArea" resultType="String" parameterType="String">
|
|
|
- select area from centerdata_t_afforestation_task WHERE task_status = #{status}
|
|
|
+ <select id="queryTaskArea" resultType="map">
|
|
|
+ SELECT d.ancestors ,a.dept_id deptId,
|
|
|
+ SUM(CASE WHEN task_status = 1 THEN 1 ELSE 0 END) AS begin,
|
|
|
+ SUM(CASE WHEN task_status = 2 THEN 1 ELSE 0 END) AS notbegin,
|
|
|
+ SUM(CASE WHEN task_status = 3 THEN 1 ELSE 0 END) AS success
|
|
|
+ FROM centerdata_t_afforestation_task a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
|
|
|
+ GROUP BY a.dept_id
|
|
|
</select>
|
|
|
|
|
|
<select id="linLeaderCount" resultType="map">
|
|
@@ -226,12 +232,14 @@
|
|
|
|
|
|
|
|
|
<select id="focusOnFire" resultType="map">
|
|
|
- SELECT SUM(a.plots_area) as area ,COUNT(DISTINCT a.forest_species)as species,a.dept_name as deptName FROM `centerdata_t_forest_keyfireproofplots` a
|
|
|
- left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
|
|
|
- <where>
|
|
|
- ${params.dataScope}
|
|
|
- </where>
|
|
|
- GROUP BY deptName
|
|
|
+ SELECT d.ancestors,
|
|
|
+ a.dept_id AS deptId,
|
|
|
+ COALESCE(MAX(CASE WHEN a.forest_species = 'dominant_tree_species0' THEN a.plots_area END), 0) AS dominant_tree_species0,
|
|
|
+ COALESCE(MAX(CASE WHEN a.forest_species = 'dominant_tree_species1' THEN a.plots_area END), 0) AS dominant_tree_species1
|
|
|
+ FROM centerdata_t_forest_keyfireproofplots a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
|
|
|
+ WHERE a.forest_species IN ('dominant_tree_species0', 'dominant_tree_species1')
|
|
|
+ GROUP BY d.ancestors, a.dept_id;
|
|
|
</select>
|
|
|
|
|
|
<select id="selectResourcesAreaCount" resultType="java.util.Map">
|
|
@@ -251,7 +259,7 @@
|
|
|
from centerdata_t_forest_grid_level a
|
|
|
left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
|
|
|
<where>
|
|
|
- and a.forest_grid_level = "3"
|
|
|
+ and a.forest_grid_level = "3"
|
|
|
${params.dataScope}
|
|
|
</where>
|
|
|
group by a.dept_id
|