问题描述:
前端向后台传送sql语句,如果是单句比如“ oid>'1' ”,后台能够进入函数正常执行,如果是复杂语句比如oid>'1' or dlts>'0',后台就不能进入函数执行。nutz2.0的时候没有问题。请问该如何解决
前端代码:
SQL=oid>'1' or dlts>'0'
$("#div_zhTable").datagrid({
border: true,
url:base+"/complexQuery",
queryParams:{"connStr":connJson,"tableName":tcname,"SQLStr":SQL,"geoStr":geostr,"pipeType":pipeType},
singleSelect:true,//是否单选
pagination:true,//分页控件
loadMsg:"数据读取中。。。",
pageSize: 5,
pageNumber:1,
pageList:[5,10,15],
columns:zhSearchhelp.columnjson,
// onDblClickRow: fly2Line,
loadFilter: function(data){……
}
后台代码:
@At
@AdaptBy(type = JsonAdaptor.class)
@Ok("raw")
public String complexQuery(@Param("connStr") String connStr, @Param("pipeType") String pipeType, @Param("tableName") String tableName, @Param("SQLStr") String SQLStr,@Param("geoStr") String geoStr,@Param("page") int curPage, @Param("rows") int pageSize)
打印信息:
[DEBUG] 2017-06-07 10:40:30,962 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) - Get 'shiroUtil'<class cn.wizzer.framework.util.ShiroUtil>
[DEBUG] 2017-06-07 10:40:30,962 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) - Get 'dateUtil'<class cn.wizzer.framework.util.DateUtil>
[DEBUG] 2017-06-07 10:40:30,962 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) - Get 'stringUtil'<class cn.wizzer.framework.util.StringUtil>
[DEBUG] 2017-06-07 10:40:30,963 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) - Get 'stargisPipeController'<class cn.wizzer.app.web.modules.controllers.stargis.StargisPipeController>
[DEBUG] 2017-06-07 10:40:30,963 cn.wizzer.app.web.commons.processor.XssSqlFilterProcessor.checkParams(XssSqlFilterProcessor.java:57) - [POST]URI=/service/pipe/utils/complexQuery SQL关键字过滤:oid>'1' or dlts>'0'
[DEBUG] 2017-06-07 10:40:30,964 cn.wizzer.app.web.commons.processor.LogTimeProcessor.process(LogTimeProcessor.java:26) - [POST]URI=/service/pipe/utils/complexQuery 2ms