@RequestMapping(value = "getAreaByTypeName.html", method = RequestMethod.GET)
@ResponseBody
public Map<String, Object> getAreaByTypeName(HttpServletRequest request) {
Map<String, Object> map = new HashMap<>();
String name = request.getParameter("name");
String xmb = request.getParameter("xmb");
List<TAreaEntity> entityList = tAreaService.queryAllAreaByPCodeApp(name,xmb);
map.put("code",0);
map.put("msg","查询成功");
map.put("data",entityList);
return map;
}
@Transactional(readOnly = true)
public List<TAreaEntity> queryAllAreaByPCodeApp(String name,String xmb) {
/* String pcode = "";
switch (name) {
case "车行道":
case "人行道(广场)":
case "人行道":
pcode = "B01";
break;
case "桥梁":
pcode = "B02";
break;
case "泵站":
pcode = "B09";
break;
case "路灯":
pcode = "B03";
break;
case "排水":
pcode = "B04";
break;
case "绿化":
case "园林绿化":
pcode = "B07";
break;
default:
pcode = "";
break;
}
if (!StringFacs.isEmpty(pcode)) {
return tAreaDao.queryAllAreaByPcode(pcode);
}*/
return tAreaDao.queryAllAreaByPcodeApp(xmb);
}
相关sql
public List<TAreaEntity> queryAllAreaByPcodeApp(String xmb) {
String hql = "from login.bean.TAreaEntity where isDelete='0' and operationStatue=0 ";
if (!StringFacs.isEmpty(xmb)) {
hql+="and ProDepartment='"+xmb+"'"; }
hql+="order by sortnot";
return jdbcTemplate.getCurrentSession().createQuery(hql).list();
}