题目分类接口

beetlsql3-dev
Mlxa0324 2 years ago
parent 60646bc51b
commit 86ca18dbef

@ -356,6 +356,10 @@
/*院校登录logo*/
logoShow();
var data = Common.postAjax("/api/resourcesQuestion/questionTypeGroupInfo.do");
console.log(data)
function logoShow(){
var ret = Common.getAjax('/api/base/getUniInfo.do');
if(!$.isEmpty(ret.data)){

@ -9,6 +9,7 @@ import com.ibeetl.jlw.web.query.CourseInfoQuery;
import com.ibeetl.jlw.web.query.ResourcesQuestionQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.beetl.sql.mapper.BaseMapper;
import org.beetl.sql.mapper.annotation.Param;
import org.beetl.sql.mapper.annotation.SqlResource;
import org.beetl.sql.mapper.annotation.Update;
import org.springframework.stereotype.Repository;
@ -32,10 +33,11 @@ public interface ResourcesQuestionDao extends BaseMapper<ResourcesQuestion>{
List<ResourcesQuestion> getValuesByQueryNotWithPermission(ResourcesQuestionQuery resourcesQuestionQuery);
/**
* ID
* @param courseInfoId
* @param courseInfoQuery
* @param courseLabelTypePlural
* @return
*/
List<QuestionTypeCountVO> getGroupQuestionTypeCount(Long courseInfoId);
List<QuestionTypeCountVO> getGroupQuestionTypeCount(CourseInfoQuery courseInfoQuery, @Param("courseLabelTypePlural") String courseLabelTypePlural);
int checkUnique(ResourcesQuestion question);

@ -43,7 +43,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Nullable;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.*;
@ -787,11 +786,19 @@ public class ResourcesQuestionService extends CoreBaseService<ResourcesQuestion>
/**
* ID
* @param courseInfoId
* @param courseInfoQuery
* @return
*/
public List<QuestionTypeCountVO> getGroupQuestionTypeCount(@Nullable Long courseInfoId) {
List<QuestionTypeCountVO> g = resourcesQuestionDao.getGroupQuestionTypeCount(courseInfoId);
public List<QuestionTypeCountVO> getGroupQuestionTypeCount(CourseInfoQuery courseInfoQuery) {
List<QuestionTypeCountVO> g = resourcesQuestionDao.getGroupQuestionTypeCount(courseInfoQuery, null);
dictParser(g);
return g;
}
public List<QuestionTypeCountVO> getTheoryCourseQuestionTypeGroupInfo(String orgIdPlural, String courseLabelTypePlural) {
CourseInfoQuery courseInfoQuery = new CourseInfoQuery();
courseInfoQuery.setOrgIdPlural(orgIdPlural);
List<QuestionTypeCountVO> g = resourcesQuestionDao.getGroupQuestionTypeCount(courseInfoQuery, courseLabelTypePlural);
dictParser(g);
return g;
}
@ -1142,4 +1149,5 @@ public class ResourcesQuestionService extends CoreBaseService<ResourcesQuestion>
}
return res;
}
}

@ -646,14 +646,14 @@ public class ResourcesQuestionController{
/**
*
* @param courseInfoId ID
* @param courseInfoQuery
* @return
*/
@PostMapping(MODEL + "/questionTypeGroupInfo.json")
@Function("resourcesQuestion.query")
@ResponseBody
public JsonResult<List<QuestionTypeCountVO>> questionTypeGroupInfo(@RequestParam(required = false) Long courseInfoId, @SCoreUser CoreUser coreUser) {
return JsonResult.success(resourcesQuestionService.getGroupQuestionTypeCount(courseInfoId));
public JsonResult<List<QuestionTypeCountVO>> questionTypeGroupInfo(CourseInfoQuery courseInfoQuery, @SCoreUser CoreUser coreUser) {
return JsonResult.success(resourcesQuestionService.getGroupQuestionTypeCount(courseInfoQuery));
}
/**
@ -691,4 +691,30 @@ public class ResourcesQuestionController{
return JsonResult.success(resourcesQuestionService.importQuestionByWordTemplateType(fileEntityList, businessType, matchType, coreUser));
}
/**
* ---
* @param courseInfoQuery
* @param coreUser
* @return
*/
@PostMapping(API + "/questionTypeGroupInfo2.do")
@ResponseBody
public JsonResult questionTypeGroupInfo2(CourseInfoQuery courseInfoQuery, @SCoreUser CoreUser coreUser) {
return JsonResult.success(resourcesQuestionService.getGroupQuestionTypeCount(courseInfoQuery));
}
/**
* ---
*
* @param coreUser
* @return
*/
@PostMapping(API + "/questionTypeGroupInfo.do")
@ResponseBody
public JsonResult theoryCourseQuestionTypeGroupInfoDo(@SCoreUser CoreUser coreUser) {
// 查询自己和超管上传的题目
String orgIds = "1," + coreUser.getOrgId().toString();
String courseLabelTypePlural = "理论课程类";
return JsonResult.success(resourcesQuestionService.getTheoryCourseQuestionTypeGroupInfo(orgIds, courseLabelTypePlural));
}
}

@ -72,6 +72,17 @@ public class CourseInfoQuery extends PageParam {
// 课程章节ID多个逗号隔开
private String courseInfoIdPlural;
// 机构IDs
private String orgIdPlural;
public String getOrgIdPlural() {
return orgIdPlural;
}
public void setOrgIdPlural(String orgIdPlural) {
this.orgIdPlural = orgIdPlural;
}
public Long getCourseInfoId(){
return courseInfoId;
}

@ -377,12 +377,72 @@ getGroupQuestionTypeCount
count( 1 ) AS total_count
FROM
resources_question t
left join course_info ta on ta.course_info_id = t.course_info_id
left join course_label tb on tb.course_label_id = ta.course_label_id
WHERE
1 = 1
AND ta.course_info_status = 1
AND t.question_status = 1
@ // 开课ID
AND tb.course_label_status = 1
@if(!isEmpty(courseLabelTypePlural)){
and find_in_set(tb.course_label_type, #courseLabelTypePlural#)
@}
@if(!isEmpty(resourcesQuestionIds)){
and find_in_set(t.resources_question_id,#resourcesQuestionIds#)
@}
@if(!isEmpty(resourcesQuestionId)){
and t.resources_question_id =#resourcesQuestionId#
@}
@if(!isEmpty(courseInfoIds)){
and find_in_set(t.course_info_id,#courseInfoIds#)
@}
@if(!isEmpty(courseInfoId)){
AND t.course_info_id = #courseInfoId#
and t.course_info_id =#courseInfoId#
@}
@if(!isEmpty(questionType)){
and t.question_type =#questionType#
@}
@if(!isEmpty(questionStatus)){
and t.question_status =#questionStatus#
@}
@if(!isEmpty(questionScore)){
and t.question_score =#questionScore#
@}
@if(!isEmpty(questionStem)){
and t.question_stem = #questionStem#
@}
@if(!isEmpty(questionOptionA)){
and t.question_option_a =#questionOptionA#
@}
@if(!isEmpty(questionOptionB)){
and t.question_option_b =#questionOptionB#
@}
@if(!isEmpty(questionOptionC)){
and t.question_option_c =#questionOptionC#
@}
@if(!isEmpty(questionOptionD)){
and t.question_option_d =#questionOptionD#
@}
@if(!isEmpty(questionOptionE)){
and t.question_option_e =#questionOptionE#
@}
@if(!isEmpty(questionAnswer)){
and t.question_answer =#questionAnswer#
@}
@if(!isEmpty(questionAnalysis)){
and t.question_analysis =#questionAnalysis#
@}
@if(!isEmpty(orgId)){
and t.org_id =#orgId#
@}
@if(!isEmpty(orgIdPlural)){
and find_in_set(ifnull(t.org_id, 1), #orgIdPlural#)
@}
@if(!isEmpty(userId)){
and t.user_id =#userId#
@}
@if(!isEmpty(addType)){
and t.add_type =#addType#
@}
GROUP BY
t.question_type

Loading…
Cancel
Save