1、JEECG默认不带模糊查询的,但实际开发中会经常用到模糊查询,因此要适当修改(在相应的查询处)。
@RequestMapping(params = "datagrid")
public void datagrid(BaseDevice device, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { String devicecode = device.getDevicecode();
String devicename = device.getDevicename();
String status = device.getStatus(); CriteriaQuery cq = new CriteriaQuery(BaseDevice.class,dataGrid);
if(StringUtils.isNotEmpty(devicecode)){
cq.add(Restrictions.sqlRestriction("devicecode like '%" + devicecode + "%'"));
}
if(StringUtils.isNotEmpty(devicename)){
cq.add(Restrictions.sqlRestriction("devicename like '%" + devicename + "%'"));
}
if(StringUtils.isNotEmpty(status)){
cq.add(Restrictions.sqlRestriction("status like '%" + status + "%'"));
} this.systemService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);
}
2、JEECG引用的解决办法: