|
@@ -0,0 +1,168 @@
|
|
|
+<?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.sooka.sponest.data.digitalforest.mapper.ForestViewNewMapper">
|
|
|
+ <select id="selectYlscsjjList" parameterType="CenterdataTForestYlscsjj" resultType="map">
|
|
|
+ SELECT
|
|
|
+ CAST(IFNULL(sum( jdgx_area ),0) AS CHAR) jdgxArea,
|
|
|
+ CAST(IFNULL(sum( rggx_area ),0) AS CHAR) rggxArea,
|
|
|
+ CAST(IFNULL(sum( dclgz_area ),0) AS CHAR) dclgzArea,
|
|
|
+ CAST(IFNULL(sum( ym_area ),0) AS CHAR) ymArea,
|
|
|
+ CAST(IFNULL(sum( fs_area ),0) AS CHAR) fsArea,
|
|
|
+ CAST(IFNULL(sum( slgh_area ),0) AS CHAR) slghArea,
|
|
|
+ CAST(IFNULL(sum( zylfu_area ),0) AS CHAR) zylfuArea
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_ylscsjj a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.`year` = YEAR(CURRENT_DATE)
|
|
|
+ ${params.dataScope}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectZylcpclList" parameterType="CenterdataTForestZylcpcl" resultType="map">
|
|
|
+ SELECT
|
|
|
+ CAST(IFNULL(sum( zylcp_yield ),0) AS CHAR) zylcpYield,
|
|
|
+ CAST(IFNULL(sum( mc_yield ),0) AS CHAR) mcYield,
|
|
|
+ CAST(IFNULL(sum( jc_yield ),0) AS CHAR) jcYield,
|
|
|
+ CAST(IFNULL(sum( rzb_yield ),0) AS CHAR) rzbYield,
|
|
|
+ CAST(IFNULL(sum( sx_yield ),0) AS CHAR) sxYield
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_zylcpcl a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.`year` = YEAR(CURRENT_DATE)
|
|
|
+ ${params.dataScope}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectGdzcwcList" parameterType="CenterdataTForestZylcpcl" resultType="map">
|
|
|
+ SELECT
|
|
|
+ CAST(IFNULL(sum( gj_invest ),0) AS CHAR) gjInvest,
|
|
|
+ CAST(IFNULL(sum( gz_invest ),0) AS CHAR) gzInvest,
|
|
|
+ CAST(IFNULL(sum( zyczzx_invest ),0) AS CHAR) zyczzxInvest,
|
|
|
+ CAST(IFNULL(sum( jbjs_invest ),0) AS CHAR) jbjsInvest,
|
|
|
+ CAST(IFNULL(sum( gxgz_invest ),0) AS CHAR) gxgzInvest
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_gdzcwc a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.`year` = YEAR(CURRENT_DATE)
|
|
|
+ <choose>
|
|
|
+ <when test="deptId != null">
|
|
|
+ and FIND_IN_SET( #{deptId}, CONCAT( d.ancestors, ",", d.dept_id) )
|
|
|
+ </when>
|
|
|
+ <otherwise>${params.dataScope}</otherwise>
|
|
|
+ </choose>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectForestAreaList" parameterType="CenterdataTForestForestationArea" resultType="map">
|
|
|
+ SELECT
|
|
|
+ b.dict_label name,
|
|
|
+ CAST( IFNULL( sum( a.area ), 0 ) AS CHAR ) area
|
|
|
+ FROM
|
|
|
+ ${database_system}.sys_dict_data b
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ a.forestation_type,
|
|
|
+ a.area
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_forestation_area a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.`year` = YEAR ( CURRENT_DATE )
|
|
|
+ ${params.dataScope}
|
|
|
+ ) a ON a.forestation_type = b.dict_value
|
|
|
+ WHERE
|
|
|
+ b.dict_type = 'centerdata_forestation_type'
|
|
|
+ GROUP BY b.dict_value
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getYearAll" parameterType="CenterdataTForestForestationArea" resultType="map">
|
|
|
+ SELECT
|
|
|
+ '造林面积' name,
|
|
|
+ CAST( IFNULL( sum( a.area ), 0 ) AS CHAR ) 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}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getYear" parameterType="CenterdataTForestForestationArea" resultType="map">
|
|
|
+ SELECT
|
|
|
+ '当年造林面积' name,
|
|
|
+ CAST( IFNULL( sum( a.area ), 0 ) AS CHAR ) area
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_forestation_area a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ where
|
|
|
+ a.`year` = YEAR ( CURRENT_DATE )
|
|
|
+ ${params.dataScope}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectForestType" parameterType="CenterdataTForestForestationArea" resultType="map">
|
|
|
+ SELECT
|
|
|
+ b.dict_label NAME,
|
|
|
+ CAST( IFNULL( sum( a.area ), 0 ) AS CHAR ) area
|
|
|
+ FROM
|
|
|
+ ${database_system}.sys_dict_data b
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ a.forest_type,
|
|
|
+ a.area
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_forestation_area a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.`year` = YEAR ( CURRENT_DATE )
|
|
|
+ ${params.dataScope}
|
|
|
+ ) a ON a.forest_type = b.dict_value
|
|
|
+ WHERE
|
|
|
+ b.dict_type = 'centerdata_forest_type'
|
|
|
+ GROUP BY
|
|
|
+ b.dict_value
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectLycyzczList" parameterType="CenterdataTForestLycyzcz" resultType="map">
|
|
|
+ SELECT
|
|
|
+ a.id id,
|
|
|
+ a.`name` name,
|
|
|
+ a.`level` level,
|
|
|
+ a.parent_id parentId,
|
|
|
+ IFNULL(b.industry_sum,0) industrySum
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_dict a
|
|
|
+ LEFT JOIN (
|
|
|
+ SELECT
|
|
|
+ a.industry_type,
|
|
|
+ CAST( IFNULL( sum( a.industry_sum ), 0 ) AS CHAR ) industry_sum
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_lycyzcz a
|
|
|
+ LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.`year` = YEAR ( CURRENT_DATE )
|
|
|
+ ${params.dataScope}
|
|
|
+ GROUP BY
|
|
|
+ a.industry_type
|
|
|
+ ) b ON a.id = b.industry_type
|
|
|
+ WHERE
|
|
|
+ a.type = 'forest_cyzcz'
|
|
|
+ ORDER BY a.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectCyryList" parameterType="CenterdataTForestCyry" resultType="map">
|
|
|
+ SELECT
|
|
|
+ count(name) count,
|
|
|
+ CAST( IFNULL( sum( cyry_num ), 0 ) AS CHAR ) cyryNum,
|
|
|
+ CAST( IFNULL( sum( zgzg_num ), 0 ) AS CHAR ) zgzgNum,
|
|
|
+ CAST( IFNULL( sum( zgjsry_num ), 0 ) AS CHAR ) zgjsryNum,
|
|
|
+ CAST( IFNULL( sum( blldgx_num ), 0 ) AS CHAR ) blldgxNum,
|
|
|
+ CAST( IFNULL( sum( ltxry_num ), 0 ) AS CHAR ) ltxryNum,
|
|
|
+ round(CAST( IFNULL( sum( CAST(zgpjrs AS CHAR)*CAST(zgldbc AS CHAR) ), 0 ) AS CHAR )/CAST( IFNULL( sum( zgpjrs ), 0 ) AS CHAR ),2) average
|
|
|
+ FROM
|
|
|
+ centerdata_t_forest_cyry a
|
|
|
+ LEFT JOIN onest_system.sys_dept d ON a.dept_id = d.dept_id
|
|
|
+ WHERE
|
|
|
+ a.`year` = YEAR ( CURRENT_DATE )
|
|
|
+ ${params.dataScope}
|
|
|
+ </select>
|
|
|
+</mapper>
|