|
@@ -21,7 +21,17 @@ public class ViewController extends Controller {
|
|
|
/**
|
|
|
* 在被连接数据库执行sql语句
|
|
|
*/
|
|
|
- public void executeSql() {
|
|
|
+ public void executeSql(String sqlStr) {
|
|
|
+ try {
|
|
|
+ List<Record> d = Db.use("connected").find(this.getPara("sqlStr"));
|
|
|
+ this.renderJson(d);
|
|
|
+ } catch (Exception e) {
|
|
|
+ // TODO: handle exception
|
|
|
+ this.renderText(e.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void testTask() {
|
|
|
try {
|
|
|
//List<Record> d = Db.use("connected").find(this.getPara("sqlStr"));
|
|
|
List<Exams> exams = Exams.dao.use("zskk").find("SELECT * FROM pacsonline.exams where exam_status=3 and institution_id=73090001 order by createdAt desc limit 50");
|