查询资源归属课程

beetlsql3-dev
Mlxa0324 2 years ago
parent 6f877a3f1f
commit 66b1849c24

@ -28,6 +28,10 @@ public class CourseInfo extends BaseEntity{
@AutoID
private Long courseInfoId ;
// 全路径ID
private String courseInfoFullId;
//名称(课程名 或 章名 或 节名)
@ -333,4 +337,11 @@ public class CourseInfo extends BaseEntity{
public String toString() {
return JSONUtil.toJsonStr(this);
}
public void setCourseInfoFullId(String courseInfoFullId) {
this.courseInfoFullId = courseInfoFullId;
}
public String getCourseInfoFullId() {
return this.courseInfoFullId;
}
}

@ -108,6 +108,24 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
return ret;
}
/**
* ID
* @param courseInfo
* @return
*/
public String getCourseInfoFullId(CourseInfo courseInfo) {
Long courseInfoId = courseInfo.getCourseInfoId();
Long courseInfoParentId = courseInfo.getCourseInfoParentId();
if (courseInfoParentId != null && !courseInfoParentId.equals(courseInfoId)) {
CourseInfo parentCi = getById(courseInfoParentId);
return getCourseInfoFullId(parentCi) + "_" + courseInfoId;
}
return courseInfoId.toString();
}
public CourseInfo add(CourseInfoQuery courseInfoQuery){
@ -132,6 +150,13 @@ public class CourseInfoService extends CoreBaseService<CourseInfo>{
}
}
// 更新全路径ID
String courseInfoFullId = getCourseInfoFullId(courseInfo);
CourseInfo model = new CourseInfo();
model.setCourseInfoId(courseInfo.getCourseInfoId());
model.setCourseInfoFullId(courseInfoFullId);
updateTemplate(model);
return courseInfo;
}

@ -12,6 +12,8 @@ import java.util.Date;
public class CourseInfoQuery extends PageParam {
@Query(name = "ID", display = false)
private Long courseInfoId;
@Query(name = "全路径ID", display = false)
private String courseInfoFullId;
@Query(name = "名称", display = true)
private String courseInfoName;
@Query(name = "课程缩略图", display = false)
@ -184,6 +186,7 @@ public class CourseInfoQuery extends PageParam {
public CourseInfo pojo(){
CourseInfo pojo = new CourseInfo();
pojo.setCourseInfoId(this.getCourseInfoId());
pojo.setCourseInfoFullId(this.getCourseInfoFullId());
pojo.setCourseInfoName(this.getCourseInfoName());
pojo.setCourseInfoThumbnail(this.getCourseInfoThumbnail());
pojo.setCourseLabelId(this.getCourseLabelId());
@ -308,4 +311,12 @@ public class CourseInfoQuery extends PageParam {
public void setCourseInfoIdPlural(String courseInfoIdPlural) {
this.courseInfoIdPlural = courseInfoIdPlural;
}
public String getCourseInfoFullId() {
return courseInfoFullId;
}
public void setCourseInfoFullId(String courseInfoFullId) {
this.courseInfoFullId = courseInfoFullId;
}
}

@ -40,6 +40,11 @@ public class ResourcesInfoQuery extends PageParam {
private String courseInfoIds;
private String orgIdPlural;
/**
*
*/
private String courseInfoFullId;
public Long getResourcesInfoId(){
return resourcesInfoId;
}
@ -154,4 +159,12 @@ public class ResourcesInfoQuery extends PageParam {
public String getOrgIdPlural() {
return orgIdPlural;
}
public String getCourseInfoFullId() {
return courseInfoFullId;
}
public void setCourseInfoFullId(String courseInfoFullId) {
this.courseInfoFullId = courseInfoFullId;
}
}

@ -28,6 +28,9 @@ queryByCondition
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}
@ -107,6 +110,9 @@ queryByConditionQuery
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}
@ -331,6 +337,9 @@ getCourseInfoValues
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}
@ -491,6 +500,9 @@ getValues
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}
@ -556,6 +568,9 @@ getValuesQuery
@if(!isEmpty(courseInfoId)){
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(courseInfoFullId)){
and t.course_info_full_id =#courseInfoFullId#
@}
@if(!isEmpty(courseInfoIdPlural)){
and find_in_set(t.course_info_id, #courseInfoIdPlural#)
@}

@ -39,6 +39,9 @@ queryByCondition
@if(!isEmpty(orgIdPlural)){
and find_in_set(t.org_id, #orgIdPlural#)
@}
@if(!isEmpty(courseInfoFullId)){
and a.course_info_full_id like #courseInfoFullId+"%"#
@}
@if(!isEmpty(addType)){
and t.add_type =#addType#
@}
@ -67,6 +70,7 @@ getValuesByQuery
select t.*
from resources_info t
left join course_info a on a.course_info_id = t.course_info_id
where 1=1
@if(!isEmpty(resourcesInfoIds)){
and find_in_set(t.resources_info_id,#resourcesInfoIds#)
@ -95,6 +99,9 @@ getValuesByQuery
@if(!isEmpty(addType)){
and t.add_type =#addType#
@}
@if(!isEmpty(courseInfoFullId)){
and a.course_info_full_id like #courseInfoFullId+"%"#
@}
@if(isEmpty(seeSelf) && !isEmpty(userId)){
and t.user_id =#userId#
@}

@ -577,7 +577,7 @@ type="course_info.course_info_name.course_info_status!=3,course_info_type=1,find
/*资源表格搜索*/
function searchList() {
var param = {
"courseInfoId_0": $("#edit_dialog select[name='courseInfoId_1']").val(),
"courseInfoFullId": $("#edit_dialog select[name='courseInfoId_1']").val(),
"resourcesInfoName": $("#edit_dialog input[name = 'resourcesInfoName']").val()
};
resourcesTable.reload({

Loading…
Cancel
Save