* @return
*/
@RequestMapping(params = "departgrid")
@ResponseBody
public List<TreeGrid> departgrid(TSDepart tSDepart,HttpServletRequest request, HttpServletResponse response, TreeGrid treegrid) {
CriteriaQuery cq = new CriteriaQuery(TSDepart.class);
if("yes".equals(request.getParameter("isSearch"))){
treegrid.setId(null);
tSDepart.setId(null);
}
if(null != tSDepart.getDepartname()){
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, tSDepart);
}
if (treegrid.getId() != null) {
cq.eq("TSPDepart.id", treegrid.getId());
}
if (treegrid.getId() == null) {
cq.isNull("TSPDepart");
}
cq.add();
List<TreeGrid> departList =null;
departList=systemService.getListByCriteriaQuery(cq, false);
if(departList.size()==0&&tSDepart.getDepartname()!=null){
cq = new CriteriaQuery(TSDepart.class);
TSDepart parDepart = new TSDepart();
tSDepart.setTSPDepart(parDepart);
org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, tSDepart);
departList =systemService.getListByCriteriaQuery(cq, false);
}