/**
 * 版权所有 ©2021 
 * 工程名：yearBooks
 * 文件名：HomeService.java
 * 创建日期：2021年10月28日 下午3:46:25
 * 作者：duanxiaomingzi
 */
package com.lion.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.lion.dao.HomeDao;

/**
 * 类描述
 * @author duanxiaomingzi
 * @since 2021年10月28日
 */
@Service
public class HomeService {
	@Resource
	private HomeDao dao;
	public Map<String,Object> getNcjjInfo(String year,String orgid){
		Map<String,Object> map=new HashMap<String, Object>();
		//list里面的数据想要组成 map
		List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		map.put("name", "农业总产值");
		map.put("tableName", "ncjj_zcz");
		map.put("url", "nyzcz.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "生产中间消耗");
		map.put("tableName", "ncjj_xh");
		map.put("url", "nyscxh.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "农业增加值");
		map.put("tableName", "ncjj_zjz");
		map.put("url", "nyzjz.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "农村居民收入与支出");
		map.put("tableName", "ncjj_inout");
		map.put("url", "ncjm.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "农产品进出口贸易");
		map.put("tableName", "ncjj_jck");
		map.put("url", "ncp.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "汇总村级经济联合社");
		map.put("tableName", "ncjj_lhs");
		map.put("url", "nylhs.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "集体经济收益");
		map.put("tableName", "ncjj_sy");
		map.put("url", "nysy.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "汇总农户数");
		map.put("tableName", "ncjj_nhs");
		map.put("url", "nynhs.html");
		list.add(map);
		for(Map<String,Object> ma:list){
			List<Map<String,Object>> listData=dao.getWcInfo(year, orgid, ma.get("tableName").toString());
			ma.put("count", listData.size());
			ma.put("info",listData);
			if(orgid.length()>2){//说明是县级的人员
				ma.put("bj",0);
			}else{//市级的人员
				ma.put("bj",1);//是否需要显示县名称 1是 0否
			}
		}
		map=new HashMap<String, Object>();
		map.put("list", list);//农村与农村经济
		map.put("success", "true");
		return map;
	}
	public Map<String,Object> getNyzbInfo(String year,String orgid){
		Map<String,Object> map=new HashMap<String, Object>();
		//list里面的数据想要组成 map
		List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		map.put("name", "农业机械年末拥有量");
		map.put("tableName", "nyzb_njzl");
		map.put("url", "nyjx.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "用电与农业化学");
		map.put("tableName", "nyzb_ydhxh");
		map.put("url", "nyyd.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "农机社会化组织及人员");
		map.put("tableName", "nyzb_user");
		map.put("url", "nyzbuser.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "农业机械作业情况");
		map.put("tableName", "nyzb_zyqk");
		map.put("url", "nyzbzyqk.html");
		list.add(map);
		for(Map<String,Object> ma:list){
			List<Map<String,Object>> listData=dao.getWcInfo(year, orgid, ma.get("tableName").toString());
			ma.put("count", listData.size());
			ma.put("info",listData);
			if(orgid.length()>2){//说明是县级的人员
				ma.put("bj",0);
			}else{//市级的人员
				ma.put("bj",1);//是否需要显示县名称 1是 0否
			}
		}
		map=new HashMap<String, Object>();
		map.put("list", list);
		map.put("success", "true");
		return map;
	}
	public Map<String,Object> getNckjInfo(String year,String orgid){
		Map<String,Object> map=new HashMap<String, Object>();
		//list里面的数据想要组成 map
		List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		map.put("name", "专业技术协会");
		map.put("tableName", "nckj_zyjs");
		map.put("url", "nckjzyjs.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "科普示范基地");
		map.put("tableName", "nckj_sfjd");
		map.put("url", "nckjsfjd.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "科普示范区(村)");
		map.put("tableName", "nckj_sfq");
		map.put("url", "nckjsfq.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "科普示范户");
		map.put("tableName", "nckj_sfh");
		map.put("url", "nckjsfh.html");
		list.add(map);
		for(Map<String,Object> ma:list){
			List<Map<String,Object>> listData=dao.getWcInfo(year, orgid, ma.get("tableName").toString());
			ma.put("count", listData.size());
			ma.put("info",listData);
			if(orgid.length()>2){//说明是县级的人员
				ma.put("bj",0);
			}else{//市级的人员
				ma.put("bj",1);//是否需要显示县名称 1是 0否
			}
		}
		map=new HashMap<String, Object>();
		map.put("list", list);
		map.put("success", "true");
		return map;
	}
	public Map<String,Object> getZzyInfo(String year,String orgid){
		Map<String,Object> map=new HashMap<String, Object>();
		//list里面的数据想要组成 map
		List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		map.put("name", "粮食作物统计");
		map.put("tableName", "zzy_lszw");
		map.put("url", "lszwtj.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "蔬菜类统计");
		map.put("tableName", "zzy_scl");
		map.put("url", "zzyscl.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "水果类统计");
		map.put("tableName", "zzy_sg");
		map.put("url", "zzysg.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "主要经济作物");
		map.put("tableName", "zzy_jjzw");
		map.put("url", "zzyjjzw.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "作物灾害统计");
		map.put("tableName", "zzy_zwzh");
		map.put("url", "zzyzwzh.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "主要农产品人均占有量");
		map.put("tableName", "zzy_ncpzy");
		map.put("url", "zzyncpzy.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "耕地面积");
		map.put("tableName", "zzy_gdmj");
		map.put("url", "zzygdmj.html");
		list.add(map);
		for(Map<String,Object> ma:list){
			List<Map<String,Object>> listData=dao.getWcInfo(year, orgid, ma.get("tableName").toString());
			ma.put("count", listData.size());
			ma.put("info",listData);
			if(orgid.length()>2){//说明是县级的人员
				ma.put("bj",0);
			}else{//市级的人员
				ma.put("bj",1);//是否需要显示县名称 1是 0否
			}
		}
		map=new HashMap<String, Object>();
		map.put("list", list);
		map.put("success", "true");
		return map;
	}
	public Map<String,Object> getXmyInfo(String year,String orgid){
		Map<String,Object> map=new HashMap<String, Object>();
		//list里面的数据想要组成 map
		List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		map.put("name", "年末存栏量");
		map.put("tableName", "xmy_nmcl");
		map.put("url", "xmynmcl.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "当年出栏量");
		map.put("tableName", "xmy_dncl");
		map.put("url", "xmydncl.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "产品产量");
		map.put("tableName", "xmy_cpcl");
		map.put("url", "xmycpcl.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "畜牧饲料");
		map.put("tableName", "xmy_sl");
		map.put("url", "xmysl.html");
		list.add(map);
		for(Map<String,Object> ma:list){
			List<Map<String,Object>> listData=dao.getWcInfo(year, orgid, ma.get("tableName").toString());
			ma.put("count", listData.size());
			ma.put("info",listData);
			if(orgid.length()>2){//说明是县级的人员
				ma.put("bj",0);
			}else{//市级的人员
				ma.put("bj",1);//是否需要显示县名称 1是 0否
			}
		}
		map=new HashMap<String, Object>();
		map.put("list", list);
		map.put("success", "true");
		return map;
	}
	public Map<String,Object> getYyInfo(String year,String orgid){
		Map<String,Object> map=new HashMap<String, Object>();
		//list里面的数据想要组成 map
		List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		map.put("name", "海水养殖与捕捞");
		map.put("tableName", "yyzb_hsyzbl");
		map.put("url", "yyzbhsyzbl.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "淡水养殖与捕捞");
		map.put("tableName", "yyzb_dsyzbl");
		map.put("url", "yyzbdsyzbl.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "水产加工");
		map.put("tableName", "yy_scjg");
		map.put("url", "yyscjg.html");
		list.add(map);
		map=new HashMap<String, Object>();
		map.put("name", "渔业从业人员");
		map.put("tableName", "yy_user");
		map.put("url", "yyuser.html");
		list.add(map);
		for(Map<String,Object> ma:list){
			List<Map<String,Object>> listData=dao.getWcInfo(year, orgid, ma.get("tableName").toString());
			ma.put("count", listData.size());
			ma.put("info",listData);
			if(orgid.length()>2){//说明是县级的人员
				ma.put("bj",0);
			}else{//市级的人员
				ma.put("bj",1);//是否需要显示县名称 1是 0否
			}
		}
		map=new HashMap<String, Object>();
		map.put("list", list);
		map.put("success", "true");
		return map;
	}
}
