According to statistics the number of regional, if not displayed as 0

// Controller layer
/ **
* @Description
* Search Area The user information
* @author luying
*
* /

@RequestMapping (value = "/ toShiCountPage")
@ResponseBody
public ModelAndView toShiCountPage (CID Integer) {
ModelAndView Music Videos new new ModelAndView = ( "ADMIN / tosignup / toShiCountPage");
// query to the number of all the municipal statistics
the Map <String, Object> areaPersonMap = toSignUpService.areaPersonNum (cid);
mv.addObject ( "cid", cid);
mv.addObject ( "areaPersonMap", areaPersonMap);
return Music Videos;
}


// service layer

/ **
* @Description
*
* The statistics for the number of persons area
* @author luying
*
* /
public the Map <String, Object> areaPersonNum (CID Integer) {
List <ApplyParticipants> areaNum = null;
the Map = new new mapArea HashMap <> ();

mapArea.put ( "Guilin", "0");
mapArea.put ( "Beihai", "0");
mapArea.put ( "Wuzhou", "0");
mapArea. put ( "Guigang", "0");
mapArea.put ( "Yulin", "0");
mapArea.put ( "Hechi", "0");
mapArea.put ( "Baise City," " 0 ");
mapArea.put (" Qinzhou "," 0 ");
mapArea.put (" Chongzuo, ""0 ");
mapArea.put (" Liuzhou "," 0 ");
mapArea.put (" Hezhou "," 0 ");
mapArea.put (" Fangchenggang City "," 0 ");
mapArea.put ( "Laibin", "0");
try {
areaNum=participantsMapper.countArea(cid);
for(ApplyParticipants applyParticipants:areaNum){
mapArea.put(applyParticipants.getArea(),applyParticipants.getNum());
}

} catch (Exception e) {
e.printStackTrace();
}
return mapArea;
}

Guess you like

Origin www.cnblogs.com/luYing666/p/11590646.html