| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | DesktopLayoutService desktopLayoutService; |
| | | |
| | | private static final Logger logger = LoggerFactory.getLogger(ScreenController.class); |
| | | @Autowired |
| | | private JdbcTemplate jdbcTemplate; |
| | | |
| | | |
| | | @RequestMapping |
| | |
| | | // 获取条件搜索的柱状图数据 |
| | | @RequestMapping("/getSearchConditionEchartsHistogram") |
| | | @ResponseBody |
| | | public Object getSearchConditionEchartsHistogram() { |
| | | public Object getSearchConditionEchartsHistogram(String columnName) { |
| | | String Sql="select "+columnName+",count("+columnName+") as num FROM cat_item_yswjxx where "+columnName+" is not null group by "+columnName; |
| | | List<Map<String,Object>> list=jdbcTemplate.queryForList(Sql); |
| | | List<String> xAxisData = new ArrayList<String>(); |
| | | xAxisData.add("海洋区域地质调查"); |
| | | xAxisData.add("海岸带地质矿产调查"); |
| | | xAxisData.add("大陆架地质矿产调查"); |
| | | xAxisData.add("国际海底地质矿产调查"); |
| | | xAxisData.add("极地地质调查"); |
| | | xAxisData.add("其他海洋地质调查"); |
| | | xAxisData.add("水工环地质勘查"); |
| | | xAxisData.add("地质科学研究"); |
| | | xAxisData.add("技术方法研究"); |
| | | List<JSONObject> seriesList = new ArrayList<JSONObject>(); |
| | | List<Object> yList = new ArrayList<Object>(); |
| | | yList.add(10); |
| | | yList.add(20); |
| | | yList.add(80); |
| | | yList.add(0); |
| | | yList.add(30); |
| | | yList.add(10); |
| | | yList.add(40); |
| | | yList.add(50); |
| | | yList.add(60); |
| | | |
| | | for (Map<String,Object> map:list){ |
| | | xAxisData.add(map.get(columnName).toString()); |
| | | yList.add(map.get("num")); |
| | | } |
| | | List<JSONObject> seriesList = new ArrayList<JSONObject>(); |
| | | JSONObject job = new JSONObject(); |
| | | job.put("name", "档案数量"); |
| | | job.put("type", "bar"); |