回复:FastChar
回复:188****5007@163.com
哦,如果你使用的是FastChar-ExtJs 那么这个你可以把自己定义的参数追加到store里,如下代码:
Ext.apply(dataStore.proxy.extraParams, {
"where[^searchKeyA]": form.getFieldValue("searchKeyA"),
"where[^searchKeyB]": form.getFieldValue("searchKeyB")
}); //开始重新加载数据
dataStore.loadPage(1);
然后在实体类的showList方法获取参数值,然后拼接自己的sql语句,如下代码:
@Override
public FastPage<FcCompanyEntity> showList(int page, int pageSize) {
String searchKeyA=getString("^searchKeyA"); String searchKeyB=getString("^searchKeyB");
String sqlStr = "select t.*" +
" from fc_company as t" +
" where t.companyName = '"+searchKeyA+"' || t.companyName = '"+searchKeyB+"' ";
FastSqlInfo sqlInfo = toSelectSql(sqlStr);
return selectBySql(page, pageSize, sqlInfo.getSql(), sqlInfo.toParams());
}
回复:188****5007@163.com
刚刚代码有点问题,已更新!抱歉回复:FastChar
知道了,谢谢!