hanfucheng 11 miesięcy temu
rodzic
commit
0d9f5a47fe

+ 8 - 8
src/main/resources/mapper/digitalforest/ForestViewNewMapper.xml

@@ -189,45 +189,45 @@
 
     <select id="selectYlwcList" parameterType="CenterdataTForestYlscsjj" resultType="map">
         SELECT
-            "当年人工造林" NAME,
+            "当年人工更新" 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}
+            a.`year` = YEAR ( CURRENT_DATE )
             ${params.dataScope}
         UNION ALL
         SELECT
-            "当年人工更新" NAME,
+            "当年人工造林" 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}
+            and a.`year` = YEAR ( CURRENT_DATE )
             ${params.dataScope}
         UNION ALL
         SELECT
-            "上年人工造林" NAME,
+            "上年人工更新" 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
+            a.`year` = YEAR ( CURRENT_DATE )-1
             ${params.dataScope}
         UNION ALL
         SELECT
-            "上年人工更新" NAME,
+            "上年人工造林" 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
+            and a.`year` = YEAR ( CURRENT_DATE ) -1
             ${params.dataScope}
     </select>