main
黄海 9 months ago
parent 8fa40e0042
commit 82f8a30191

@ -821,4 +821,10 @@ public class BaseController extends Controller {
Record record = model.getBureauInfo(bureau_id);
renderJson(record);
}
@Before({GET.class})
public void getData(){
List<Record> list=model.getData();
renderJson(CommonUtil.renderJsonForLayUI(list));
}
}

@ -982,4 +982,10 @@ public class BaseModel {
else record.set("showClassTree", false);
return record;
}
public List<Record> getData(){
String sql="select * from dataease.`excel_报告-教育资源配置发展预测_cbd431c461`";
List<Record> list=Db.find(sql);
return list;
}
}

@ -35,7 +35,7 @@ public class TestDataSet {
* @return
*/
public static List<Record> getTableColumns(String table_name) {
String sql = "desc `" + table_name + "`";
String sql = "desc `dataease." + table_name + "`";
return Db.find(sql);
}
@ -46,7 +46,7 @@ public class TestDataSet {
* @return
*/
public static List<Record> getTableData(String table_name) {
String sql = "select * from `" + table_name+"`";
String sql = "select * from `dataease." + table_name+"`";
return Db.find(sql);
}
@ -77,7 +77,7 @@ public class TestDataSet {
public static void main(String[] args) {
//加载配置文件
String configFile = "application_dataease.yaml";
String configFile = "application_dev.yaml";
Prop PropKit = new YamlProp(configFile);
HikariCpPlugin arpPlugin = new HikariCpPlugin(PropKit.get("mysql.jdbcUrl"), PropKit.get("mysql.user"),
PropKit.get("mysql.password").trim(), PropKit.get("mysql.driverClassName"));

@ -1,45 +0,0 @@
package com.dsideal.base.Tools;
import com.dsideal.base.Plugin.YamlProp;
import com.jfinal.kit.Prop;
import com.jfinal.plugin.activerecord.ActiveRecordPlugin;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.hikaricp.HikariCpPlugin;
import static com.dsideal.base.BaseApplication.getEnvPrefix;
public class ClearDataBase {
public static Prop PropKit;
public static void main(String[] args) {
//1、配置数据库
String configFile = "application_{?}.yaml".replace("{?}", getEnvPrefix());
PropKit = new YamlProp(configFile);
HikariCpPlugin druid = new HikariCpPlugin(PropKit.get("mysql.jdbcUrl"), PropKit.get("mysql.user"),
PropKit.get("mysql.password").trim(), PropKit.get("mysql.driverClassName"));
druid.start();
// 配置ActiveRecord插件
ActiveRecordPlugin arp = new ActiveRecordPlugin(druid);
arp.start();
//2、清空班级表
String sql = "truncate table t_base_class";
Db.update(sql);
sql = "truncate table t_base_organization";
Db.update(sql);
sql = "truncate table t_import_student_by_excel";
Db.update(sql);
sql = "truncate table t_import_teacher_by_excel";
Db.update(sql);
sql = "truncate table t_person_duty_charge";
Db.update(sql);
//3、人员表
sql = "delete from t_sys_loginperson where identity_id not in (1,2,3)";
Db.update(sql);
}
}

@ -1,20 +1,21 @@
#namespace("DataEase")
-- 获取树根
#sql("getTreeRoot")
select * from core_dataset_group where name like '云南省教科院项目';
select * from dataease.core_dataset_group where name like '云南省教科院项目';
#end
-- 获取所有的数据集
#sql("getAllDataSet")
WITH RECURSIVE tree_cte AS (
SELECT *
FROM core_dataset_group
FROM dataease.core_dataset_group
WHERE id = #para(id) -- 根节点的id
UNION ALL
SELECT c.*
FROM core_dataset_group c
FROM dataease.core_dataset_group c
INNER JOIN tree_cte t ON c.pid = t.id
)
SELECT t1.id ,t1.name ,t1.pid,t1.node_type,t2.name as parent_name FROM tree_cte as t1 inner join core_dataset_group as t2
SELECT t1.id ,t1.name ,t1.pid,t1.node_type,t2.name as parent_name FROM tree_cte as t1
inner join dataease.core_dataset_group as t2
on t1.pid=t2.id
#if(dataset)
where t1.node_type='dataset'
@ -22,6 +23,6 @@
#end
-- 获取表名
#sql("getTableName")
select table_name from core_dataset_table where dataset_group_id=#para(dataset_group_id);
select table_name from dataease.core_dataset_table where dataset_group_id=#para(dataset_group_id);
#end
#end
Loading…
Cancel
Save