|
@@ -176,9 +176,9 @@
|
|
|
c.cycle_frequency cycleFrequency,
|
|
|
a.patrol_trajectory patrolTrajectory
|
|
|
FROM centerdata_t_hydraulic_patrol_task a
|
|
|
- LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
- LEFT JOIN centerdata_t_hydraulic_patrol_plan_record b ON a.id = b.task_id
|
|
|
- LEFT JOIN centerdata_t_hydraulic_patrol_plan c ON a.plan_id = c.id
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ LEFT JOIN centerdata_t_hydraulic_patrol_plan_record b ON a.id = b.task_id
|
|
|
+ LEFT JOIN centerdata_t_hydraulic_patrol_plan c ON a.plan_id = c.id
|
|
|
WHERE a.type = #{type}
|
|
|
AND b.user_id = #{userId}
|
|
|
${params.dataScope}
|
|
@@ -186,4 +186,74 @@
|
|
|
ORDER BY
|
|
|
a.create_time DESC
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectYlwcList" parameterType="CenterdataTForestYlscsjj" resultType="map">
|
|
|
+ SELECT
|
|
|
+ "当年人工造林" NAME,
|
|
|
+ IFNULL(sum(a.rggx_area) ,0) area
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_ylscsjj a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.`year` = #{year}
|
|
|
+ ${params.dataScope}
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ "当年人工更新" NAME,
|
|
|
+ IFNULL(sum( a.area ),0) area
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_forestation_area a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.forestation_type = '1'
|
|
|
+ and a.`year` = #{year}
|
|
|
+ ${params.dataScope}
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ "上年人工造林" NAME,
|
|
|
+ IFNULL(a.rggx_area ,0) area
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_ylscsjj a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.`year` = #{year}-1
|
|
|
+ ${params.dataScope}
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ "上年人工更新" NAME,
|
|
|
+ IFNULL(sum( a.area ),0) area
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_forestation_area a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.forestation_type = '1'
|
|
|
+ and a.`year` = #{year} -1
|
|
|
+ ${params.dataScope}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectZszlArea" parameterType="CenterdataTForestForestationArea" resultType="map">
|
|
|
+ SELECT a.time 'produc', CAST( IFNULL(b.rggxArea,0) AS CHAR ) as '人工造林',CAST( IFNULL(c.area,0) AS CHAR ) '人工更新'
|
|
|
+ FROM (SELECT YEAR (DATE_SUB(CURDATE(), INTERVAL 4 YEAR)) time
|
|
|
+ UNION
|
|
|
+ SELECT YEAR (DATE_SUB(CURDATE(), INTERVAL 3 YEAR)) time
|
|
|
+ UNION
|
|
|
+ SELECT YEAR (DATE_SUB(CURDATE(), INTERVAL 2 YEAR)) time
|
|
|
+ UNION
|
|
|
+ SELECT YEAR (DATE_SUB(CURDATE(), INTERVAL 1 YEAR)) time
|
|
|
+ UNION
|
|
|
+ SELECT YEAR (NOW()) time) a
|
|
|
+ left join
|
|
|
+ (SELECT a.year, IFNULL(sum(a.rggx_area), 0) rggxArea
|
|
|
+ FROM centerdata_t_forest_ylscsjj a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE 1 = 1 ${params.dataScope}
|
|
|
+ GROUP BY a.year) b on a.time = b.year
|
|
|
+ left join
|
|
|
+ (SELECT a.year, IFNULL(sum(a.area), 0) area
|
|
|
+ FROM centerdata_t_forest_forestation_area a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE 1 = 1 ${params.dataScope}
|
|
|
+ GROUP BY a.year) c on a.time = c.year
|
|
|
+ order by a.time
|
|
|
+ </select>
|
|
|
</mapper>
|