main
黄海 1 year ago
parent f070e40467
commit cc90547a43

@ -5,6 +5,7 @@ import com.dsideal.QingLong.Util.CommonUtil;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;
import java.util.ArrayList;
import java.util.List;
@ -16,8 +17,8 @@ public class TestPgRole {
* @param user_name
*/
public static void delUser(String user_name) {
String sql = "DROP USER ?";
Db.update(sql, user_name);
String sql = "DROP USER " + user_name;
Db.update(sql);
}
/**
@ -27,8 +28,8 @@ public class TestPgRole {
* @param pwd
*/
public static void createUser(String user_name, String pwd) {
String sql = "CREATE USER ? WITH PASSWORD ?";
Db.update(sql, user_name, pwd);
String sql = "CREATE USER " + user_name + " WITH PASSWORD '" + pwd + "'";
Db.update(sql);
}
/**
@ -50,7 +51,6 @@ public class TestPgRole {
//综合素质评价系统 数据库访问用户名zhszpj,密码:随机生成, 表名前缀(建议,非强制要求)zhszpj
String user_name = "zhszpj";
String pwd = CommonUtil.getSixRandom();
if (isExistUser(user_name)) {
System.out.println("用户名" + user_name + "已存在,将删除!");
delUser(user_name);
@ -60,6 +60,12 @@ public class TestPgRole {
createUser(user_name, pwd);
System.out.println("用户名" + user_name + "已创建,密码为:" + pwd);
//综合素质评价的表集合
List<String> tableList = new ArrayList<>();
tableList.add("temp_school");
//PG数据库权限概念 角色,用户,权限
}

@ -533,6 +533,7 @@ public class BaseController extends Controller {
*/
@Before({GET.class})
@IsLoginInterface({})
@LayUiPageInfoInterface({"page", "limit"})
public void listDaKa(int term_id, int flag, int page, int limit) {
//当前登录人员所在单位
String identity_id = SessionKit.get(getRequest(), getResponse(), "identity_id");//当前登录人

@ -545,20 +545,19 @@ public class BaseModel {
*/
public Page<Record> listDaKa(int term_id, int flag, int identity_id, String city_id, String area_id, int page, int limit) {
Kv kv = Kv.by("term_id", term_id);
switch (identity_id) {
case 2:
kv.set("city_id", city_id);
break;
case 3:
kv.set("city_id", city_id);
kv.set("area_id", area_id);
break;
if (identity_id == 2) {
kv.set("city_id", city_id);
} else {
kv.set("city_id", city_id);
kv.set("area_id", area_id);
}
if (flag == 0) {//查询所有未打卡学校
kv.set("not_action", 1);
if (flag == 1) {//查询已打卡学校
SqlPara sqlPara = Db.getSqlPara("Base.listDaKa", kv);
return Db.paginate(page, limit, sqlPara);
} else {//查询未打卡学校
SqlPara sqlPara = Db.getSqlPara("Base.listNoDaKa", kv);
return Db.paginate(page, limit, sqlPara);
}
SqlPara sqlPara = Db.getSqlPara("Base.listDaKa", kv);
return Db.paginate(page, limit, sqlPara);
}
/**

@ -172,19 +172,27 @@
and t1.entry_year=#(batch_year);
#end
#end
-- 打卡
#sql("listDaKa")
select * from t_base_organization as t1 where t1.b_use=1 and t1.org_id=t1.bureau_id and org_type_id in (8,9,15,16)
-- 未打卡
#sql("listNoDaKa")
select t1.org_id as bureau_id,t1.org_name as bureau_name,'--' as teacher_count,'--' as student_count,'--' as class_count,'--' as wait_teacher_count,'--' as wait_student_count
from t_base_organization as t1 where t1.b_use=1 and t1.org_id=t1.bureau_id and org_type_id in (8,9,15,16)
#if(city_id)
and t1.city_id=#para(city_id)
#end
#if(area_id)
and t1.area_id=#para(area_id)
#end
and t1.bureau_id
#if(not_action)
not
and t1.bureau_id not in (select bureau_id from t_base_daka where term_id=#para(term_id) and b_use=1) order by t1.school_type_id,t1.area_id
#end
-- 已打卡 -- 未打卡
#sql("listDaKa")
select t1.*,t2.org_name as bureau_name from t_base_daka as t1 inner join t_base_organization as t2 on t1.bureau_id=t2.org_id where t1.term_id=#para(term_id) and t1.b_use=1
#if(city_id)
and t2.city_id=#para(city_id)
#end
#if(area_id)
and t2.area_id=#para(area_id)
#end
in (select bureau_id from t_base_daka where term_id=#para(term_id) and b_use=1) order by t1.school_type_id,t1.area_id
order by t2.school_type_id
#end
#end
Loading…
Cancel
Save