統計によると、地域の数は、0と表示されない場合は

//コントローラ層
/ **
* @description
*検索地域のユーザー情報
* @author luying
*
* /

@RequestMapping(値= "/ toShiCountPage")
@ResponseBody
公共のModelAndView toShiCountPage(CID整数){
のModelAndViewミュージックビデオの新しい新しいのModelAndView =( "ADMIN / tosignup / toShiCountPage");
すべての自治体の統計の数に//クエリ
地図<文字列、オブジェクト> areaPersonMap = toSignUpService.areaPersonNum(CID);
mv.addObject( "CID"、CID);
mv.addObject( "areaPersonMap"、areaPersonMap);
ミュージックビデオを返します;
}


//サービス層

/ **
* @description
*
*人物領域の数の統計
* @author luying
*
* /
公共の地図<文字列、オブジェクト> areaPersonNum(CID整数){
一覧<ApplyParticipants> areaNum = NULL;
地図=新しい新しいmapArea HashMapの<>();

mapArea.put( "桂林"、 "0");
mapArea.put( "北海"、 "0");
mapArea.put( "梧州"、 "0");
mapArea。 ( "貴港市"、 "0")を置く;
mapArea.put( "玉林"、 "0");
mapArea.put( "河池市"、 "0");
mapArea.put( "百色市の市、" " 0 ");
mapArea.put("欽州"" 0 ");
mapArea.put("崇左市""0 ");
mapArea.put("柳州"" 0 ");
mapArea.put("賀州市"" 0 ");
mapArea.put("防城港市市"" 0「);
mapArea.put( "来賓市"、 "0")。
{試みる
areaNum = participantsMapper.countArea(CID)。
(ApplyParticipantsのapplyParticipants:areaNum)用{
mapArea.put(applyParticipants.getArea()、applyParticipants.getNum())。
}

}キャッチ(例外e){
e.printStackTrace();
}
mapAreaを返します。
}

おすすめ

転載: www.cnblogs.com/luYing666/p/11590646.html