|
|
|
@ -172,7 +172,7 @@ public class BaseModel {
|
|
|
|
|
* @param type_id
|
|
|
|
|
* @param sort_id
|
|
|
|
|
*/
|
|
|
|
|
public void addScheme(String scheme_name, int stage_id, int subject_id, int b_use, String owner_id, int type_id, int sort_id) {
|
|
|
|
|
public void addScheme(String scheme_name, int stage_id, int subject_id, int b_use, int owner_id, int type_id, int sort_id) {
|
|
|
|
|
Record record = new Record();
|
|
|
|
|
record.set("scheme_name", scheme_name);
|
|
|
|
|
record.set("stage_id", stage_id);
|
|
|
|
@ -181,7 +181,9 @@ public class BaseModel {
|
|
|
|
|
record.set("owner_id", owner_id);
|
|
|
|
|
record.set("type_id", type_id);
|
|
|
|
|
record.set("sort_id", sort_id);
|
|
|
|
|
Db.save("t_resource_scheme","scheme_id", record);
|
|
|
|
|
Db.save("t_resource_scheme", "scheme_id", record);
|
|
|
|
|
//需要同步增加t_resource_structure表中的数据
|
|
|
|
|
addResourceStructure(scheme_name, -1, record.getInt("id"), 1, owner_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -192,6 +194,9 @@ public class BaseModel {
|
|
|
|
|
public void delScheme(int scheme_id) {
|
|
|
|
|
String sql = "update t_resource_scheme set b_use=0 where scheme_id=?";
|
|
|
|
|
Db.update(sql, scheme_id);
|
|
|
|
|
//同步删除t_resource_structure表中的数据
|
|
|
|
|
sql = "update t_resource_structure set b_use=0 where scheme_id=?";
|
|
|
|
|
Db.update(sql, scheme_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -204,9 +209,12 @@ public class BaseModel {
|
|
|
|
|
* @param type_id
|
|
|
|
|
* @param sort_id
|
|
|
|
|
*/
|
|
|
|
|
public void updateScheme(int scheme_id, String scheme_name, int stage_id, int subject_id, int type_id, int sort_id) {
|
|
|
|
|
public void updateScheme(int scheme_id, String scheme_name, int stage_id, int subject_id, int type_id, int sort_id) {
|
|
|
|
|
String sql = "update t_resource_scheme set scheme_name=?,stage_id=?,subject_id=?,type_id=?,sort_id=? where scheme_id=?";
|
|
|
|
|
Db.update(sql, scheme_name, stage_id, subject_id, type_id, sort_id, scheme_id);
|
|
|
|
|
Db.update(sql, scheme_name, stage_id, subject_id, type_id, sort_id, scheme_id);
|
|
|
|
|
//同步修改t_resource_structure表中的数据
|
|
|
|
|
sql = "update t_resource_structure set structure_name=? where scheme_id=? and parent_id=-1";
|
|
|
|
|
Db.update(sql, scheme_name, scheme_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -241,66 +249,68 @@ public class BaseModel {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
增加
|
|
|
|
|
* @param structure_name 章节目录名称
|
|
|
|
|
* @param parent_id 上级目录ID
|
|
|
|
|
* @param scheme_id 版本ID
|
|
|
|
|
* @param sort_id 排序号
|
|
|
|
|
* @param owern_id 1:东师理想提供结构,2:用户自定义结构
|
|
|
|
|
* 增加
|
|
|
|
|
*
|
|
|
|
|
* @param structure_name 章节目录名称
|
|
|
|
|
* @param parent_id 上级目录ID
|
|
|
|
|
* @param scheme_id 版本ID
|
|
|
|
|
* @param sort_id 排序号
|
|
|
|
|
* @param owner_id 1:东师理想提供结构,2:用户自定义结构
|
|
|
|
|
*/
|
|
|
|
|
public void addResourceStructure(String structure_name , int parent_id , int scheme_id , int sort_id , int owern_id){
|
|
|
|
|
public void addResourceStructure(String structure_name, int parent_id, int scheme_id, int sort_id, int owner_id) {
|
|
|
|
|
Record record = new Record();
|
|
|
|
|
record.set("structure_name", structure_name);
|
|
|
|
|
record.set("parent_id", parent_id);
|
|
|
|
|
record.set("scheme_id", scheme_id);
|
|
|
|
|
record.set("sort_id", sort_id);
|
|
|
|
|
record.set("owern_id", owern_id);
|
|
|
|
|
Db.save("t_resource_structure","structure_id",record);
|
|
|
|
|
record.set("owner_id", owner_id);
|
|
|
|
|
Db.save("t_resource_structure", "structure_id", record);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
删除
|
|
|
|
|
@param structure_id 主键
|
|
|
|
|
* 删除
|
|
|
|
|
*
|
|
|
|
|
* @param structure_id 主键
|
|
|
|
|
*/
|
|
|
|
|
public void delResourceStructureById(int structure_id){
|
|
|
|
|
String sql="delete from t_resource_structure where structure_id =?";
|
|
|
|
|
Db.update(sql,structure_id);
|
|
|
|
|
public void delResourceStructureById(int structure_id) {
|
|
|
|
|
String sql = "delete from t_resource_structure where structure_id =?";
|
|
|
|
|
Db.update(sql, structure_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
修改
|
|
|
|
|
* @param structure_id 主键
|
|
|
|
|
* @param structure_name 章节目录名称
|
|
|
|
|
* @param parent_id 上级目录ID
|
|
|
|
|
* @param scheme_id 版本ID
|
|
|
|
|
* @param sort_id 排序号
|
|
|
|
|
* @param owern_id 1:东师理想提供结构,2:用户自定义结构
|
|
|
|
|
* 修改
|
|
|
|
|
*
|
|
|
|
|
* @param structure_id 主键
|
|
|
|
|
* @param structure_name 章节目录名称
|
|
|
|
|
* @param parent_id 上级目录ID
|
|
|
|
|
* @param scheme_id 版本ID
|
|
|
|
|
* @param sort_id 排序号
|
|
|
|
|
* @param owner_id 1:东师理想提供结构,2:用户自定义结构
|
|
|
|
|
*/
|
|
|
|
|
public void updateResourceStructureById(int structure_id,String structure_name , int parent_id , int scheme_id , int sort_id , int owern_id){
|
|
|
|
|
String sql="update t_resource_structure set structure_name =?, parent_id =?, scheme_id =?, sort_id =?, owern_id =? where structure_id =?";
|
|
|
|
|
Db.update(sql,structure_name , parent_id , scheme_id , sort_id , owern_id ,structure_id);
|
|
|
|
|
public void updateResourceStructureById(int structure_id, String structure_name, int parent_id, int scheme_id, int sort_id, int owner_id) {
|
|
|
|
|
String sql = "update t_resource_structure set structure_name =?, parent_id =?, scheme_id =?, sort_id =?, owner_id =? where structure_id =?";
|
|
|
|
|
Db.update(sql, structure_name, parent_id, scheme_id, sort_id, owner_id, structure_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
单条查询
|
|
|
|
|
* 单条查询
|
|
|
|
|
*
|
|
|
|
|
* @param structure_id 主键
|
|
|
|
|
*/
|
|
|
|
|
public Record getResourceStructureById(int structure_id){
|
|
|
|
|
String sql="select * from t_resource_structure where structure_id =?";
|
|
|
|
|
return Db.findFirst(sql,structure_id);
|
|
|
|
|
public Record getResourceStructureById(int structure_id) {
|
|
|
|
|
String sql = "select * from t_resource_structure where structure_id =?";
|
|
|
|
|
return Db.findFirst(sql, structure_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
分页查询
|
|
|
|
|
* @param pageNum 当前页码
|
|
|
|
|
* @param pageSize 每页显示条数
|
|
|
|
|
* 根据版本号获取章节目录信息
|
|
|
|
|
*
|
|
|
|
|
* @param scheme_id 版本号
|
|
|
|
|
* @return 结构信息
|
|
|
|
|
*/
|
|
|
|
|
public Page<Record> getResourceStructureList(int pageNum, int pageSize){
|
|
|
|
|
String sql1="select * ";
|
|
|
|
|
String sql2=" from t_resource_structure";
|
|
|
|
|
return Db.paginate(pageNum, pageSize, sql1,sql2);
|
|
|
|
|
public Record getResourceStructureBySchemeId(int scheme_id) {
|
|
|
|
|
//
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|