IndexViewMapper.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.sooka.sponest.data.index.mapper.IndexViewMapper">
  6. <resultMap id="MenuInfoResultMap" type="com.sooka.sponest.data.index.domain.MenuInfo">
  7. <result property="subclassS" column="subclassS"/>
  8. <result property="tableNameAndType" column="tableNameAndType"/>
  9. </resultMap>
  10. <select id="getBasicDataList" parameterType="String" resultMap="MenuInfoResultMap">
  11. SELECT
  12. SUBSTRING_INDEX(center_type, ':', 1) AS subclassS,
  13. SUBSTRING_INDEX(center_type, ':', -1) AS tableNameAndType
  14. FROM
  15. ${database_system}.sys_menu
  16. WHERE
  17. menu_type = 'C'
  18. AND status = 0
  19. AND front_type = 'front_type_data'
  20. AND center_type IS NOT NULL;
  21. </select>
  22. <select id="getBasicDataCount" parameterType="MenuInfo" resultType="Long">
  23. SELECT count(*) FROM
  24. ${tableName}
  25. <where>
  26. <if test="type != null and type != ''">and type = #{type}</if>
  27. </where>
  28. </select>
  29. <!--一网通办统计数据-->
  30. <select id="getOneTongData" resultType="Map">
  31. SELECT SUM(t2.hall_processing_total_number) AS totalProcessing,
  32. SUM(t1.legal_person_completion_number) AS completionNumber,
  33. SUM(t1.legal_person_processing_number) AS processingNumber,
  34. SUM(t1.natural_person_completion_number) AS naturalCompletionNumber,
  35. SUM(t1.natural_person_processing_number) AS naturalProcessingNumber
  36. FROM centerdata_t_forest_networkprocessing t1
  37. INNER JOIN (SELECT dept_id,
  38. MAX(time) AS max_time,
  39. SUM(hall_processing_total_number) AS hall_processing_total_number
  40. FROM centerdata_t_forest_networkprocessing
  41. WHERE dept_id IN ( 365, 369,370,371,372,373 )
  42. GROUP BY dept_id ) t2
  43. ON t1.dept_id = t2.dept_id AND t1.time = t2.max_time;
  44. </select>
  45. <select id="getForestry" resultType="java.util.Map">
  46. select '水源渠道' name ,count(*) value from centerdata_t_forest_channel a
  47. union all
  48. select '森林防火队' name ,count(*) value from centerdata_t_forest_fireteam a
  49. union all
  50. select '珍稀古树' name ,count(*) value from centerdata_t_forest_trees a
  51. </select>
  52. <select id="getAgriculture" resultType="java.util.Map">
  53. select '农民合作社' name ,count(*) value from centerdata_t_farm_agricultural_cooperatives a
  54. union all
  55. select '农业推广总站' name ,count(*) value from centerdata_t_farm_botany_protect_info a
  56. union all
  57. select '备案畜禽规模养殖场' name ,count(*) value from centerdata_t_farm_filings_livestock a
  58. union all
  59. select '种畜禽养殖场' name ,count(*) value from centerdata_t_farm_livestock a
  60. union all
  61. select '区域性粪污处置中心' name ,count(*) value from centerdata_t_farm_excrement_dispose a
  62. union all
  63. select '肉牛基层繁改站' name ,count(*) value from centerdata_t_farm_complex_modification a
  64. union all
  65. select '棚膜信息' name ,count(*) value from centerdata_t_farm_greenhouse_film a
  66. </select>
  67. <select id="getEnvironmental" resultType="java.util.Map">
  68. select '重点企业' name ,count(*) value from centerdata_t_environment_key_enterprise a
  69. union all
  70. select '排污口' name ,count(*) value from centerdata_t_environment_sewage_outlet a
  71. </select>
  72. <select id="getEmergency" resultType="java.util.Map">
  73. select '应急仓库' name ,count(*) value from centerdata_t_emergency_warehouse a
  74. union all
  75. select '应急队伍' name ,count(*) value from centerdata_t_emergency_team a
  76. union all
  77. select '危化企业' name ,count(*) value from centerdata_t_emergency_idlh_enterprises a
  78. </select>
  79. <select id="getTraffic" resultType="java.util.Map">
  80. select '桥梁' name ,count(*) value from centerdata_t_traffic_bridge a
  81. union all
  82. select '涵洞' name ,count(*) value from centerdata_t_traffic_culvert a
  83. union all
  84. select '警示牌' name ,count(*) value from centerdata_t_traffic_warning_sign a
  85. </select>
  86. <select id="getResources" resultType="java.util.Map">
  87. select '矿产' name ,count(*) value from centerdata_t_resources_deposit a
  88. union all
  89. select '地质灾害点' name ,count(*) value from centerdata_t_resources_geologic_hazard a
  90. </select>
  91. <select id="getFire" resultType="java.util.Map">
  92. select '取水口' name ,count(*) value from centerdata_t_forest_waterintake a
  93. union all
  94. select '水鹤' name ,count(*) value from centerdata_t_forest_watercrane a
  95. union all
  96. select '消防力量' name ,count(*) value from centerdata_t_firecontrol_fire_force a
  97. union all
  98. select '重点场所' name ,count(*) value from centerdata_t_firecontrol_fire_key_places a
  99. union all
  100. select '基本联动力量' name ,count(*) value from centerdata_t_firecontrol_basic_linkage_force a
  101. union all
  102. select '其他联动力量' name ,count(*) value from centerdata_t_firecontrol_other_linkage_force a
  103. union all
  104. select '泡沫液' name ,count(*) value from centerdata_t_firecontrol_foam_liquid a
  105. union all
  106. select '专职站' name ,count(*) value from centerdata_t_firecontrol_fulltime_station a
  107. union all
  108. select '地上消火栓' name ,count(*) value from centerdata_t_forest_firehydrant a where firehydrant_type = 'firehydrant_1'
  109. </select>
  110. <select id="getNum" resultType="java.lang.Integer">
  111. select sum(a.value)
  112. from(
  113. select count(id) value from centerdata_t_forest_channel a
  114. union all
  115. select count(id) value from centerdata_t_forest_fireteam a
  116. union all
  117. select count(id) value from centerdata_t_forest_trees a
  118. union all
  119. select count(id) value from centerdata_t_farm_agricultural_cooperatives a
  120. union all
  121. select count(id) value from centerdata_t_farm_botany_protect_info a
  122. union all
  123. select count(id) value from centerdata_t_farm_filings_livestock a
  124. union all
  125. select count(id) value from centerdata_t_farm_livestock a
  126. union all
  127. select count(id) value from centerdata_t_farm_excrement_dispose a
  128. union all
  129. select count(id) value from centerdata_t_farm_complex_modification a
  130. union all
  131. select count(id) value from centerdata_t_farm_greenhouse_film a
  132. union all
  133. select count(id) value from centerdata_t_environment_key_enterprise a
  134. union all
  135. select count(id) value from centerdata_t_environment_sewage_outlet a
  136. union all
  137. select count(id) value from centerdata_t_emergency_warehouse a
  138. union all
  139. select count(id) value from centerdata_t_emergency_team a
  140. union all
  141. select count(id) value from centerdata_t_emergency_idlh_enterprises a
  142. union all
  143. select count(id) value from centerdata_t_traffic_bridge a
  144. union all
  145. select count(id) value from centerdata_t_traffic_culvert a
  146. union all
  147. select count(id) value from centerdata_t_traffic_warning_sign a
  148. union all
  149. select count(id) value from centerdata_t_resources_deposit a
  150. union all
  151. select count(id) value from centerdata_t_resources_geologic_hazard a
  152. union all
  153. select count(id) value from centerdata_t_forest_waterintake a
  154. union all
  155. select count(id) value from centerdata_t_forest_watercrane a
  156. union all
  157. select count(id) value from centerdata_t_firecontrol_fire_force a
  158. union all
  159. select count(id) value from centerdata_t_firecontrol_fire_key_places a
  160. union all
  161. select count(id) value from centerdata_t_firecontrol_basic_linkage_force a
  162. union all
  163. select count(id) value from centerdata_t_firecontrol_other_linkage_force a
  164. union all
  165. select count(id) value from centerdata_t_firecontrol_foam_liquid a
  166. union all
  167. select count(id) value from centerdata_t_firecontrol_fulltime_station a
  168. union all
  169. select count(id) value from centerdata_t_forest_firehydrant a where firehydrant_type = 'firehydrant_1'
  170. ) a
  171. </select>
  172. <select id="getSiZhangData" resultType="Map">
  173. select '河长' name, 'hezhang' nickname,count(distinct (user_id))
  174. value from centerdata_t_hydraulic_river_length
  175. where type ='2'
  176. union all
  177. select '路长' name,'luzhang',count(distinct (user_id))
  178. from centerdata_t_hydraulic_river_length
  179. where type ='3'
  180. union all
  181. select '田长' name,'tianzhang',count(distinct (user_id))
  182. from centerdata_t_hydraulic_river_length
  183. where type ='6'
  184. union all
  185. select '林长' name,'linzhang',count(distinct user_id)
  186. from centerdata_t_forest_linleader
  187. where lin_job != 'forest_lin_jy'
  188. </select>
  189. <select id="getAllData" resultType="map">
  190. select '林业林块' name,count(*) value from centerdata_t_supermap_level
  191. where type ='1'
  192. union all
  193. select '水利河段' name,count(*) value from centerdata_t_supermap_level
  194. where type ='2'
  195. union all
  196. select '交通路段' name,count(*) value from centerdata_t_supermap_level
  197. where type ='3'
  198. union all
  199. select '农业田块' name,count(*) value from centerdata_t_supermap_level
  200. where type ='6'
  201. </select>
  202. <select id="keyMonitoringAreas" resultType="java.util.Map">
  203. select '重点工程' name,count(*) value from centerdata_t_key_projects
  204. union all
  205. select b.dict_label name,count(a.project_type) num from onest_data.centerdata_t_forest_importarea a
  206. left join onest_system.sys_dict_data b on a.project_type = b.dict_value where b.dict_type = 'area_type'
  207. and (b.dict_value = 'area_type0' or b.dict_value = 'area_type3' or b.dict_value = 'area_type2' or b.dict_value = 'area_type4' )
  208. GROUP BY a.project_type
  209. </select>
  210. <select id="getMessage" resultType="java.util.Map">
  211. select 'forestChannel' name ,count(*) num from centerdata_t_forest_channel a
  212. union all
  213. select 'forestFireteam' name ,count(*) num from centerdata_t_forest_fireteam a
  214. union all
  215. select 'forestTrees' name ,count(*) num from centerdata_t_forest_trees a
  216. union all
  217. select 'farmAgriculturalCooperatives' name ,count(*) num from centerdata_t_farm_agricultural_cooperatives a
  218. union all
  219. select 'farmBotanyProtectInfo' name ,count(*) num from centerdata_t_farm_botany_protect_info a
  220. union all
  221. select 'farmFilingsLivestock' name ,count(*) num from centerdata_t_farm_filings_livestock a
  222. union all
  223. select 'farmLivestock' name ,count(*) num from centerdata_t_farm_livestock a
  224. union all
  225. select 'farmExcrementDispose' name ,count(*) num from centerdata_t_farm_excrement_dispose a
  226. union all
  227. select 'farmComplexModification' name ,count(*) num from centerdata_t_farm_complex_modification a
  228. union all
  229. select 'farmGreenhouseFilm' name ,count(*) num from centerdata_t_farm_greenhouse_film a
  230. union all
  231. select 'environmentKeyEnterprise' name ,count(*) num from centerdata_t_environment_key_enterprise a
  232. union all
  233. select 'environmentSewageOutlet' name ,count(*) num from centerdata_t_environment_sewage_outlet a
  234. union all
  235. select 'emergencyWarehouse' name ,count(*) num from centerdata_t_emergency_warehouse a
  236. union all
  237. select 'emergencyTeam' name ,count(*) num from centerdata_t_emergency_team a
  238. union all
  239. select 'emergencyIdlhEnterprises' name ,count(*) num from centerdata_t_emergency_idlh_enterprises a
  240. union all
  241. select 'trafficBridge' name ,count(*) num from centerdata_t_traffic_bridge a
  242. union all
  243. select 'trafficCulvert' name ,count(*) num from centerdata_t_traffic_culvert a
  244. union all
  245. select 'trafficWarningSign' name ,count(*) num from centerdata_t_traffic_warning_sign a
  246. union all
  247. select 'resourcesDeposit' name ,count(*) num from centerdata_t_resources_deposit a
  248. union all
  249. select 'resourcesGeologicHazard' name ,count(*) num from centerdata_t_resources_geologic_hazard a
  250. union all
  251. select 'forestWaterintake' name ,count(*) num from centerdata_t_forest_waterintake a
  252. union all
  253. select 'forestWatercrane' name ,count(*) num from centerdata_t_forest_watercrane a
  254. union all
  255. select 'firecontrolFireForce' name ,count(*) num from centerdata_t_firecontrol_fire_force a
  256. union all
  257. select 'firecontrolFireKeyPlaces' name ,count(*) num from centerdata_t_firecontrol_fire_key_places a
  258. union all
  259. select 'firecontrolBasicLinkageForce' name ,count(*) num from centerdata_t_firecontrol_basic_linkage_force a
  260. union all
  261. select 'firecontrolOtherLinkageForce' name ,count(*) num from centerdata_t_firecontrol_other_linkage_force a
  262. union all
  263. select 'firecontrolFoamLiquid' name ,count(*) num from centerdata_t_firecontrol_foam_liquid a
  264. union all
  265. select 'firecontrolFulltimeStation' name ,count(*) num from centerdata_t_firecontrol_fulltime_station a
  266. union all
  267. select 'forestFirehydrant' name ,count(*) num from centerdata_t_forest_firehydrant a where firehydrant_type = 'firehydrant_1'
  268. union all
  269. select 'keyProjects' name,count(*) num from centerdata_t_key_projects
  270. union all
  271. select REPLACE(b.dict_value, '_', '') name,count(a.id) num from onest_system.sys_dict_data b
  272. left join onest_data.centerdata_t_forest_importarea a on a.project_type = b.dict_value
  273. where b.dict_type = 'area_type' and (b.dict_value = 'area_type0' or b.dict_value = 'area_type3' or b.dict_value = 'area_type2' or b.dict_value = 'area_type4' )
  274. group by b.dict_value
  275. union all
  276. select 'KeyMonitoringAreas' name ,sum(a.num) num from
  277. (select 'keyProjects' name,count(*) num from centerdata_t_key_projects
  278. union all
  279. select REPLACE(b.dict_value, '_', '') name,count(a.project_type) num from onest_data.centerdata_t_forest_importarea a
  280. left join onest_system.sys_dict_data b on a.project_type = b.dict_value where b.dict_type = 'area_type'
  281. and (b.dict_value = 'area_type0' or b.dict_value = 'area_type3' or b.dict_value = 'area_type2' or b.dict_value = 'area_type4' )
  282. GROUP BY a.project_type) a
  283. union all
  284. select 'VariousResourceData' name , sum(a.num) from (
  285. select 'forestChannel' name ,count(*) num from centerdata_t_forest_channel a
  286. union all
  287. select 'forestFireteam' name ,count(*) num from centerdata_t_forest_fireteam a
  288. union all
  289. select 'forestTrees' name ,count(*) num from centerdata_t_forest_trees a
  290. union all
  291. select 'farmAgriculturalCooperatives' name ,count(*) num from centerdata_t_farm_agricultural_cooperatives a
  292. union all
  293. select 'farmBotanyProtectInfo' name ,count(*) num from centerdata_t_farm_botany_protect_info a
  294. union all
  295. select 'farmFilingsLivestock' name ,count(*) num from centerdata_t_farm_filings_livestock a
  296. union all
  297. select 'farmLivestock' name ,count(*) num from centerdata_t_farm_livestock a
  298. union all
  299. select 'farmExcrementDispose' name ,count(*) num from centerdata_t_farm_excrement_dispose a
  300. union all
  301. select 'farmComplexModification' name ,count(*) num from centerdata_t_farm_complex_modification a
  302. union all
  303. select 'farmGreenhouseFilm' name ,count(*) num from centerdata_t_farm_greenhouse_film a
  304. union all
  305. select 'environmentKeyEnterprise' name ,count(*) num from centerdata_t_environment_key_enterprise a
  306. union all
  307. select 'environmentSewageOutlet' name ,count(*) num from centerdata_t_environment_sewage_outlet a
  308. union all
  309. select 'emergencyWarehouse' name ,count(*) num from centerdata_t_emergency_warehouse a
  310. union all
  311. select 'emergencyTeam' name ,count(*) num from centerdata_t_emergency_team a
  312. union all
  313. select 'emergencyIdlhEnterprises' name ,count(*) num from centerdata_t_emergency_idlh_enterprises a
  314. union all
  315. select 'trafficBridge' name ,count(*) num from centerdata_t_traffic_bridge a
  316. union all
  317. select 'trafficCulvert' name ,count(*) num from centerdata_t_traffic_culvert a
  318. union all
  319. select 'trafficWarningSign' name ,count(*) num from centerdata_t_traffic_warning_sign a
  320. union all
  321. select 'resourcesDeposit' name ,count(*) num from centerdata_t_resources_deposit a
  322. union all
  323. select 'resourcesGeologicHazard' name ,count(*) num from centerdata_t_resources_geologic_hazard a
  324. union all
  325. select 'forestWaterintake' name ,count(*) num from centerdata_t_forest_waterintake a
  326. union all
  327. select 'forestWatercrane' name ,count(*) num from centerdata_t_forest_watercrane a
  328. union all
  329. select 'firecontrolFireForce' name ,count(*) num from centerdata_t_firecontrol_fire_force a
  330. union all
  331. select 'firecontrolFireKeyPlaces' name ,count(*) num from centerdata_t_firecontrol_fire_key_places a
  332. union all
  333. select 'firecontrolBasicLinkageForce' name ,count(*) num from centerdata_t_firecontrol_basic_linkage_force a
  334. union all
  335. select 'firecontrolOtherLinkageForce' name ,count(*) num from centerdata_t_firecontrol_other_linkage_force a
  336. union all
  337. select 'firecontrolFoamLiquid' name ,count(*) num from centerdata_t_firecontrol_foam_liquid a
  338. union all
  339. select 'firecontrolFulltimeStation' name ,count(*) num from centerdata_t_firecontrol_fulltime_station a
  340. union all
  341. select 'forestFirehydrant' name ,count(*) num from centerdata_t_forest_firehydrant a where firehydrant_type = 'firehydrant_1')a
  342. </select>
  343. </mapper>