Authored by jimi.ji

add sql 查询

... ... @@ -420,6 +420,7 @@ public class HttpUriContants {
public static final String SQLOPERATE_QUERY_DBLIST = "/sqlOperate/queryDbList";
public static final String SQLOPERATE_QUERY = "/sqlOperate/query";
public static final String SQLOPERATE_QUERY_FOR_EXCEL = "/sqlOperate/queryForExcel";
public static final String SQLOPERATE_LOGS_QUERY = "/sqlOperate/queryLogs";
/**
... ...
... ... @@ -67,6 +67,16 @@ public class SqlOperateCtrl {
return res;
}
@RequestMapping("/queryForExcel")
@ResponseBody
public BaseResponse queryForExcel( HttpSession session,SqlOperateModel sqlOperateModel){
User u = (User) session.getAttribute("user");
sqlOperateModel.setUserId(u.getId());
sqlOperateModel.setUserName(u.getName());
BaseResponse res = httpClient.defaultPost(HttpUriContants.SQLOPERATE_QUERY_FOR_EXCEL, sqlOperateModel, BaseResponse.class);
return res;
}
@RequestMapping("/sqlLogs")
public ModelAndView sqlOperateLogs(){
ModelAndView mv = new ModelAndView("sqloperate/sqlOperateLogs");
... ...
... ... @@ -55,6 +55,7 @@
<script src="<%=basePath %>js/jstree/jstree.min.js"></script>
<script src="<%=basePath %>js/jquery.toaster.js"></script>
<script src="<%=basePath %>js/jquery-plugin/jquery.cookies.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/tableExport.min.js" charset="UTF-8" type="text/javascript"></script>
<script>
var contextPath = '<%=basePath %>';
</script>
... ... @@ -135,6 +136,12 @@
<button class="btn btn-primary" onclick="queryFromBtn()" style="margin-top: 50px;">提交查询</button>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-primary" onclick="queryForExcel()" style="margin-top: 50px;">下载查询结果</button>
</div>
</div>
</div>
... ... @@ -308,6 +315,11 @@
}
function queryForExcel(){
$("#jobsTable").tableExport({type:'csv',escape:'false'});
}
/**
* 发送请求,并构造返回结果
*/
... ...