Merge branch 'youxilong_2.26_院后第一增量' of http://192.168.16.64:3000/jihan/PostDischargePatientManage into youxilong_2.26_院后第一增量
This commit is contained in:
commit
70733b7d71
@ -42,6 +42,25 @@ public class AgencyController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询机构信息列表 - 不分页
|
||||
*/
|
||||
@GetMapping("/selectAgencyList")
|
||||
public AjaxResult selectAgencyByIdList(Agency agency) {
|
||||
return agencyService.selectAgencyByIdList(agency);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询院区机构信息列表
|
||||
*/
|
||||
@GetMapping("/subordinateAgencyList")
|
||||
public AjaxResult subordinateAgencyList(Agency agency) {
|
||||
if (Objects.isNull(agency) || Objects.isNull(agency.getParentId())) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return agencyService.subordinateAgencyList(agency);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出机构信息列表
|
||||
*/
|
||||
|
||||
@ -44,11 +44,22 @@ public class DepartmentController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询科室信息列表 不分页
|
||||
*/
|
||||
@GetMapping("/getDepartmentList")
|
||||
public AjaxResult getDepartmentList(Department department) {
|
||||
return AjaxResult.success(departmentService.selectDepartmentList(department));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询科室或病区信息列表 不分页
|
||||
*/
|
||||
@GetMapping("/selectDepartmentList")
|
||||
public AjaxResult selectDepartmentByAgencyIdList(Department department) {
|
||||
return departmentService.selectDepartmentByAgencyIdList(department);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出科室信息列表
|
||||
*/
|
||||
|
||||
@ -8,12 +8,15 @@ import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 问卷基本信息Controller
|
||||
@ -65,8 +68,11 @@ public class QuestionInfoController extends BaseController {
|
||||
@PreAuthorize("@ss.hasPermi('system:question:add')")
|
||||
@Log(title = "问卷基本信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QuestionInfo questionInfo) {
|
||||
return toAjax(questionInfoService.insertQuestionInfo(questionInfo));
|
||||
public AjaxResult add(@RequestBody QuestionVO questionInfo) {
|
||||
if (Objects.isNull(questionInfo) || StringUtils.isBlank(questionInfo.getQuestionnaireName())) {
|
||||
return AjaxResult.error("请添加问卷信息!");
|
||||
}
|
||||
return questionInfoService.insertQuestionInfo(questionInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -18,7 +18,7 @@ public interface QuestionInfoMapper {
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 问卷基本信息
|
||||
*/
|
||||
public QuestionInfo selectQuestionInfoById(Long id);
|
||||
QuestionInfo selectQuestionInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询问卷基本信息列表
|
||||
@ -26,7 +26,7 @@ public interface QuestionInfoMapper {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 问卷基本信息集合
|
||||
*/
|
||||
public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
|
||||
List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 新增问卷基本信息
|
||||
@ -34,7 +34,7 @@ public interface QuestionInfoMapper {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQuestionInfo(QuestionInfo questionInfo);
|
||||
int insertQuestionInfo(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 修改问卷基本信息
|
||||
@ -42,7 +42,7 @@ public interface QuestionInfoMapper {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQuestionInfo(QuestionInfo questionInfo);
|
||||
int updateQuestionInfo(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 删除问卷基本信息
|
||||
@ -50,7 +50,7 @@ public interface QuestionInfoMapper {
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQuestionInfoById(Long id);
|
||||
int deleteQuestionInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除问卷基本信息
|
||||
@ -58,5 +58,5 @@ public interface QuestionInfoMapper {
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQuestionInfoByIds(Long[] ids);
|
||||
int deleteQuestionInfoByIds(Long[] ids);
|
||||
}
|
||||
|
||||
@ -59,4 +59,11 @@ public interface QuestionSubjectMapper {
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteQuestionSubjectByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param questionSubjectList
|
||||
* @return
|
||||
*/
|
||||
int insertQuestionSubjectList(List<QuestionSubject> questionSubjectList);
|
||||
}
|
||||
|
||||
@ -31,6 +31,22 @@ public interface IAgencyService {
|
||||
*/
|
||||
List<Agency> selectAgencyList(Agency agency);
|
||||
|
||||
/**
|
||||
* 查询机构信息列表
|
||||
*
|
||||
* @param agency 机构信息
|
||||
* @return 机构信息集合
|
||||
*/
|
||||
AjaxResult selectAgencyByIdList(Agency agency);
|
||||
|
||||
/**
|
||||
* 查询院区机构信息列表
|
||||
*
|
||||
* @param agency 机构信息
|
||||
* @return 机构信息集合
|
||||
*/
|
||||
AjaxResult subordinateAgencyList(Agency agency);
|
||||
|
||||
/**
|
||||
* 新增机构信息
|
||||
*
|
||||
|
||||
@ -78,6 +78,30 @@ public class AgencyServiceImpl implements IAgencyService {
|
||||
return agencyMapper.selectAgencyList(agency);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询机构信息列表
|
||||
*
|
||||
* @param agency 机构信息
|
||||
* @return 机构信息
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectAgencyByIdList(Agency agency) {
|
||||
return AjaxResult.success(agencyMapper.selectAgencyList(agency));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询院区机构信息列表
|
||||
*
|
||||
* @param agency 机构信息
|
||||
* @return 机构信息
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult subordinateAgencyList(Agency agency) {
|
||||
return AjaxResult.success(agencyMapper.selectAgencyList(agency));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增机构信息
|
||||
*
|
||||
|
||||
@ -32,6 +32,14 @@ public interface IDepartmentService {
|
||||
*/
|
||||
List<Department> selectDepartmentList(Department department);
|
||||
|
||||
/**
|
||||
* 查询科室或病区信息列表 不分页
|
||||
*
|
||||
* @param department 科室信息
|
||||
* @return 科室信息集合
|
||||
*/
|
||||
AjaxResult selectDepartmentByAgencyIdList(Department department);
|
||||
|
||||
/**
|
||||
* 新增科室信息
|
||||
*
|
||||
|
||||
@ -61,6 +61,20 @@ public class DepartmentServiceImpl implements IDepartmentService {
|
||||
return departmentMapper.selectDepartmentList(department);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询科室或病区信息列表 不分页
|
||||
*
|
||||
* @param department 科室信息
|
||||
* @return 科室信息
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult selectDepartmentByAgencyIdList(Department department) {
|
||||
if (Objects.isNull(department) || (Objects.isNull(department.getAgencyId()) && Objects.isNull(department.getParentDepartmentId()))) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.success(departmentMapper.selectDepartmentList(department));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增科室信息
|
||||
*
|
||||
@ -69,7 +83,7 @@ public class DepartmentServiceImpl implements IDepartmentService {
|
||||
*/
|
||||
@Override
|
||||
public int insertDepartment(Department department) {
|
||||
if (Objects.isNull(department.getParentDepartmentId())){
|
||||
if (Objects.isNull(department.getParentDepartmentId())) {
|
||||
department.setParentDepartmentId(0L);
|
||||
}
|
||||
department.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.xinelu.manage.service.questioninfo;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -18,7 +20,7 @@ public interface IQuestionInfoService {
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 问卷基本信息
|
||||
*/
|
||||
public QuestionInfo selectQuestionInfoById(Long id);
|
||||
QuestionInfo selectQuestionInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询问卷基本信息列表
|
||||
@ -26,7 +28,7 @@ public interface IQuestionInfoService {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 问卷基本信息集合
|
||||
*/
|
||||
public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
|
||||
List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 新增问卷基本信息
|
||||
@ -34,7 +36,7 @@ public interface IQuestionInfoService {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQuestionInfo(QuestionInfo questionInfo);
|
||||
AjaxResult insertQuestionInfo(QuestionVO questionInfo);
|
||||
|
||||
/**
|
||||
* 修改问卷基本信息
|
||||
@ -42,7 +44,7 @@ public interface IQuestionInfoService {
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQuestionInfo(QuestionInfo questionInfo);
|
||||
int updateQuestionInfo(QuestionInfo questionInfo);
|
||||
|
||||
/**
|
||||
* 批量删除问卷基本信息
|
||||
@ -50,7 +52,7 @@ public interface IQuestionInfoService {
|
||||
* @param ids 需要删除的问卷基本信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQuestionInfoByIds(Long[] ids);
|
||||
int deleteQuestionInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除问卷基本信息信息
|
||||
@ -58,5 +60,5 @@ public interface IQuestionInfoService {
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQuestionInfoById(Long id);
|
||||
int deleteQuestionInfoById(Long id);
|
||||
}
|
||||
|
||||
@ -1,13 +1,25 @@
|
||||
package com.xinelu.manage.service.questioninfo.impl;
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.SecurityUtils;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.domain.questionsubject.QuestionSubject;
|
||||
import com.xinelu.manage.domain.questionsubjectoption.QuestionSubjectOption;
|
||||
import com.xinelu.manage.mapper.questioninfo.QuestionInfoMapper;
|
||||
import com.xinelu.manage.mapper.questionsubject.QuestionSubjectMapper;
|
||||
import com.xinelu.manage.service.questioninfo.IQuestionInfoService;
|
||||
import com.xinelu.manage.vo.questionInfo.QuestionVO;
|
||||
import com.xinelu.manage.vo.questionsubject.QuestionSubjectVO;
|
||||
import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 问卷基本信息Service业务层处理
|
||||
@ -15,17 +27,15 @@ import java.util.List;
|
||||
* @author xinelu
|
||||
* @date 2024-02-28
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class QuestionInfoServiceImpl implements IQuestionInfoService {
|
||||
@Resource
|
||||
private QuestionInfoMapper questionInfoMapper;
|
||||
@Resource
|
||||
private QuestionSubjectMapper questionSubjectMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 查询问卷基本信息
|
||||
*
|
||||
* @param id 问卷基本信息主键
|
||||
* @return 问卷基本信息
|
||||
*/
|
||||
@Override
|
||||
public QuestionInfo selectQuestionInfoById(Long id) {
|
||||
return questionInfoMapper.selectQuestionInfoById(id);
|
||||
@ -45,13 +55,49 @@ public class QuestionInfoServiceImpl implements IQuestionInfoService {
|
||||
/**
|
||||
* 新增问卷基本信息
|
||||
*
|
||||
* @param questionInfo 问卷基本信息
|
||||
* @param question 问卷基本信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertQuestionInfo(QuestionInfo questionInfo) {
|
||||
public AjaxResult insertQuestionInfo(QuestionVO question) {
|
||||
QuestionInfo questionInfo = new QuestionInfo();
|
||||
BeanUtils.copyBeanProp(questionInfo, question);
|
||||
questionInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return questionInfoMapper.insertQuestionInfo(questionInfo);
|
||||
questionInfo.setCreateBy(SecurityUtils.getUsername());
|
||||
int questionCount = questionInfoMapper.insertQuestionInfo(questionInfo);
|
||||
if (questionCount <= 0) {
|
||||
log.info("新增问卷表失败," + questionInfo);
|
||||
throw new SecurityException("新增问卷失败!请联系管理员!");
|
||||
}
|
||||
List<QuestionSubjectVO> questionSubjectList = question.getQuestionSubjectList();
|
||||
List<QuestionSubject> questionSubjects = new ArrayList<>();
|
||||
List<QuestionSubjectOptionVO> questionSubjectOptions = new ArrayList<>();
|
||||
QuestionSubject saveQuestionSubject = new QuestionSubject();
|
||||
for (QuestionSubjectVO questionSubject : questionSubjectList) {
|
||||
BeanUtils.copyBeanProp(saveQuestionSubject, questionSubject);
|
||||
saveQuestionSubject.setQuestionInfoId(questionInfo.getId());
|
||||
saveQuestionSubject.setCreateTime(DateUtils.getNowDate());
|
||||
saveQuestionSubject.setCreateBy(SecurityUtils.getUsername());
|
||||
questionSubjects.add(saveQuestionSubject);
|
||||
questionSubjectOptions.addAll(questionSubject.getQuestionSubjectOptionList());
|
||||
}
|
||||
int questionSubjectCount = questionSubjectMapper.insertQuestionSubjectList(questionSubjects);
|
||||
if (questionSubjectCount <= 0) {
|
||||
log.info("新增问卷题目表失败," + questionSubjects);
|
||||
throw new SecurityException("新增问卷失败!请联系管理员!");
|
||||
}
|
||||
ArrayList<QuestionSubjectOption> saveQuestionSubjectOptions = new ArrayList<>();
|
||||
QuestionSubjectOption saveQuestionSubjectOption = new QuestionSubjectOption();
|
||||
for (QuestionSubjectOptionVO questionSubjectOption : questionSubjectOptions) {
|
||||
BeanUtils.copyBeanProp(saveQuestionSubjectOption, questionSubjectOption);
|
||||
QuestionSubject questionSubject = questionSubjects.stream().filter(Objects::nonNull).filter(item -> Objects.nonNull(item.getQuestionNumber()) && questionSubjectOption.getQuestionNumber().equals(item.getQuestionNumber())).findFirst().orElse(new QuestionSubject());
|
||||
questionSubjectOption.setQuestionnaireSubjectId(questionSubject.getId());
|
||||
saveQuestionSubjectOption.setCreateTime(DateUtils.getNowDate());
|
||||
saveQuestionSubjectOption.setCreateBy(SecurityUtils.getUsername());
|
||||
saveQuestionSubjectOptions.add(questionSubjectOption);
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
package com.xinelu.manage.vo.questionInfo;
|
||||
|
||||
|
||||
import com.xinelu.manage.domain.questioninfo.QuestionInfo;
|
||||
import com.xinelu.manage.vo.questionsubject.QuestionSubjectVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 问卷基本信息VO
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-28
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class QuestionVO extends QuestionInfo {
|
||||
|
||||
/**
|
||||
* 题目信息
|
||||
*/
|
||||
private List<QuestionSubjectVO> questionSubjectList;
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package com.xinelu.manage.vo.questionsubject;
|
||||
|
||||
import com.xinelu.manage.domain.questionsubject.QuestionSubject;
|
||||
import com.xinelu.manage.vo.questionsubjectoption.QuestionSubjectOptionVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 问卷题目信息对象 question_subject
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-29
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class QuestionSubjectVO extends QuestionSubject {
|
||||
|
||||
/**
|
||||
* 选项信信息
|
||||
*/
|
||||
private List<QuestionSubjectOptionVO> questionSubjectOptionList;
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
package com.xinelu.manage.vo.questionsubjectoption;
|
||||
|
||||
import com.xinelu.manage.domain.questionsubjectoption.QuestionSubjectOption;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 问卷题目选项答案对象 question_subject_option
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-02-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class QuestionSubjectOptionVO extends QuestionSubjectOption {
|
||||
|
||||
/**
|
||||
* 题号
|
||||
*/
|
||||
private Integer questionNumber;
|
||||
}
|
||||
@ -5,262 +5,286 @@
|
||||
<mapper namespace="com.xinelu.manage.mapper.questionsubject.QuestionSubjectMapper">
|
||||
|
||||
<resultMap type="QuestionSubject" id="QuestionSubjectResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="questionInfoId" column="question_info_id"/>
|
||||
<result property="questionNumber" column="question_number"/>
|
||||
<result property="questionType" column="question_type"/>
|
||||
<result property="questionName" column="question_name"/>
|
||||
<result property="questionDescription" column="question_description"/>
|
||||
<result property="writeDescription" column="write_description"/>
|
||||
<result property="fillBlanksAnswer" column="fill_blanks_answer"/>
|
||||
<result property="optionCount" column="option_count"/>
|
||||
<result property="whetherScore" column="whether_score"/>
|
||||
<result property="scoringMethod" column="scoring_method"/>
|
||||
<result property="scoringDescription" column="scoring_description"/>
|
||||
<result property="questionScore" column="question_score"/>
|
||||
<result property="customTriggerCondition" column="custom_trigger_condition"/>
|
||||
<result property="propagandaInfoId" column="propaganda_info_id"/>
|
||||
<result property="propagandaTitle" column="propaganda_title"/>
|
||||
<result property="questionSort" column="question_sort"/>
|
||||
<result property="questionRemark" column="question_remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="id" column="id"/>
|
||||
<result property="questionInfoId" column="question_info_id"/>
|
||||
<result property="questionNumber" column="question_number"/>
|
||||
<result property="questionType" column="question_type"/>
|
||||
<result property="questionName" column="question_name"/>
|
||||
<result property="questionDescription" column="question_description"/>
|
||||
<result property="writeDescription" column="write_description"/>
|
||||
<result property="fillBlanksAnswer" column="fill_blanks_answer"/>
|
||||
<result property="optionCount" column="option_count"/>
|
||||
<result property="whetherScore" column="whether_score"/>
|
||||
<result property="scoringMethod" column="scoring_method"/>
|
||||
<result property="scoringDescription" column="scoring_description"/>
|
||||
<result property="questionScore" column="question_score"/>
|
||||
<result property="customTriggerCondition" column="custom_trigger_condition"/>
|
||||
<result property="propagandaInfoId" column="propaganda_info_id"/>
|
||||
<result property="propagandaTitle" column="propaganda_title"/>
|
||||
<result property="questionSort" column="question_sort"/>
|
||||
<result property="questionRemark" column="question_remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectQuestionSubjectVo">
|
||||
select id, question_info_id, question_number, question_type, question_name, question_description, write_description, fill_blanks_answer, option_count, whether_score, scoring_method, scoring_description, question_score, custom_trigger_condition, propaganda_info_id, propaganda_title, question_sort, question_remark, create_by, create_time, update_by, update_time from question_subject
|
||||
select id,
|
||||
question_info_id,
|
||||
question_number,
|
||||
question_type,
|
||||
question_name,
|
||||
question_description,
|
||||
write_description,
|
||||
fill_blanks_answer,
|
||||
option_count,
|
||||
whether_score,
|
||||
scoring_method,
|
||||
scoring_description,
|
||||
question_score,
|
||||
custom_trigger_condition,
|
||||
propaganda_info_id,
|
||||
propaganda_title,
|
||||
question_sort,
|
||||
question_remark,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from question_subject
|
||||
</sql>
|
||||
|
||||
<select id="selectQuestionSubjectList" parameterType="QuestionSubject" resultMap="QuestionSubjectResult">
|
||||
<include refid="selectQuestionSubjectVo"/>
|
||||
<where>
|
||||
<if test="questionInfoId != null ">
|
||||
and question_info_id = #{questionInfoId}
|
||||
</if>
|
||||
<if test="questionNumber != null ">
|
||||
and question_number = #{questionNumber}
|
||||
</if>
|
||||
<if test="questionType != null and questionType != ''">
|
||||
and question_type = #{questionType}
|
||||
</if>
|
||||
<if test="questionName != null and questionName != ''">
|
||||
and question_name like concat('%', #{questionName}, '%')
|
||||
</if>
|
||||
<if test="questionDescription != null and questionDescription != ''">
|
||||
and question_description = #{questionDescription}
|
||||
</if>
|
||||
<if test="writeDescription != null and writeDescription != ''">
|
||||
and write_description = #{writeDescription}
|
||||
</if>
|
||||
<if test="fillBlanksAnswer != null and fillBlanksAnswer != ''">
|
||||
and fill_blanks_answer = #{fillBlanksAnswer}
|
||||
</if>
|
||||
<if test="optionCount != null ">
|
||||
and option_count = #{optionCount}
|
||||
</if>
|
||||
<if test="whetherScore != null ">
|
||||
and whether_score = #{whetherScore}
|
||||
</if>
|
||||
<if test="scoringMethod != null and scoringMethod != ''">
|
||||
and scoring_method = #{scoringMethod}
|
||||
</if>
|
||||
<if test="scoringDescription != null and scoringDescription != ''">
|
||||
and scoring_description = #{scoringDescription}
|
||||
</if>
|
||||
<if test="questionScore != null ">
|
||||
and question_score = #{questionScore}
|
||||
</if>
|
||||
<if test="customTriggerCondition != null and customTriggerCondition != ''">
|
||||
and custom_trigger_condition = #{customTriggerCondition}
|
||||
</if>
|
||||
<if test="propagandaInfoId != null ">
|
||||
and propaganda_info_id = #{propagandaInfoId}
|
||||
</if>
|
||||
<if test="propagandaTitle != null and propagandaTitle != ''">
|
||||
and propaganda_title = #{propagandaTitle}
|
||||
</if>
|
||||
<if test="questionSort != null ">
|
||||
and question_sort = #{questionSort}
|
||||
</if>
|
||||
<if test="questionRemark != null and questionRemark != ''">
|
||||
and question_remark = #{questionRemark}
|
||||
</if>
|
||||
<if test="questionInfoId != null ">
|
||||
and question_info_id = #{questionInfoId}
|
||||
</if>
|
||||
<if test="questionNumber != null ">
|
||||
and question_number = #{questionNumber}
|
||||
</if>
|
||||
<if test="questionType != null and questionType != ''">
|
||||
and question_type = #{questionType}
|
||||
</if>
|
||||
<if test="questionName != null and questionName != ''">
|
||||
and question_name like concat('%', #{questionName}, '%')
|
||||
</if>
|
||||
<if test="questionDescription != null and questionDescription != ''">
|
||||
and question_description = #{questionDescription}
|
||||
</if>
|
||||
<if test="writeDescription != null and writeDescription != ''">
|
||||
and write_description = #{writeDescription}
|
||||
</if>
|
||||
<if test="fillBlanksAnswer != null and fillBlanksAnswer != ''">
|
||||
and fill_blanks_answer = #{fillBlanksAnswer}
|
||||
</if>
|
||||
<if test="optionCount != null ">
|
||||
and option_count = #{optionCount}
|
||||
</if>
|
||||
<if test="whetherScore != null ">
|
||||
and whether_score = #{whetherScore}
|
||||
</if>
|
||||
<if test="scoringMethod != null and scoringMethod != ''">
|
||||
and scoring_method = #{scoringMethod}
|
||||
</if>
|
||||
<if test="scoringDescription != null and scoringDescription != ''">
|
||||
and scoring_description = #{scoringDescription}
|
||||
</if>
|
||||
<if test="questionScore != null ">
|
||||
and question_score = #{questionScore}
|
||||
</if>
|
||||
<if test="customTriggerCondition != null and customTriggerCondition != ''">
|
||||
and custom_trigger_condition = #{customTriggerCondition}
|
||||
</if>
|
||||
<if test="propagandaInfoId != null ">
|
||||
and propaganda_info_id = #{propagandaInfoId}
|
||||
</if>
|
||||
<if test="propagandaTitle != null and propagandaTitle != ''">
|
||||
and propaganda_title = #{propagandaTitle}
|
||||
</if>
|
||||
<if test="questionSort != null ">
|
||||
and question_sort = #{questionSort}
|
||||
</if>
|
||||
<if test="questionRemark != null and questionRemark != ''">
|
||||
and question_remark = #{questionRemark}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectQuestionSubjectById" parameterType="Long"
|
||||
resultMap="QuestionSubjectResult">
|
||||
<include refid="selectQuestionSubjectVo"/>
|
||||
where id = #{id}
|
||||
<include refid="selectQuestionSubjectVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertQuestionSubject" parameterType="QuestionSubject" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into question_subject
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="questionInfoId != null">question_info_id,
|
||||
</if>
|
||||
<if test="questionNumber != null">question_number,
|
||||
</if>
|
||||
<if test="questionType != null">question_type,
|
||||
</if>
|
||||
<if test="questionName != null">question_name,
|
||||
</if>
|
||||
<if test="questionDescription != null">question_description,
|
||||
</if>
|
||||
<if test="writeDescription != null">write_description,
|
||||
</if>
|
||||
<if test="fillBlanksAnswer != null">fill_blanks_answer,
|
||||
</if>
|
||||
<if test="optionCount != null">option_count,
|
||||
</if>
|
||||
<if test="whetherScore != null">whether_score,
|
||||
</if>
|
||||
<if test="scoringMethod != null">scoring_method,
|
||||
</if>
|
||||
<if test="scoringDescription != null">scoring_description,
|
||||
</if>
|
||||
<if test="questionScore != null">question_score,
|
||||
</if>
|
||||
<if test="customTriggerCondition != null">custom_trigger_condition,
|
||||
</if>
|
||||
<if test="propagandaInfoId != null">propaganda_info_id,
|
||||
</if>
|
||||
<if test="propagandaTitle != null">propaganda_title,
|
||||
</if>
|
||||
<if test="questionSort != null">question_sort,
|
||||
</if>
|
||||
<if test="questionRemark != null">question_remark,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
<if test="questionInfoId != null">question_info_id,
|
||||
</if>
|
||||
<if test="questionNumber != null">question_number,
|
||||
</if>
|
||||
<if test="questionType != null">question_type,
|
||||
</if>
|
||||
<if test="questionName != null">question_name,
|
||||
</if>
|
||||
<if test="questionDescription != null">question_description,
|
||||
</if>
|
||||
<if test="writeDescription != null">write_description,
|
||||
</if>
|
||||
<if test="fillBlanksAnswer != null">fill_blanks_answer,
|
||||
</if>
|
||||
<if test="optionCount != null">option_count,
|
||||
</if>
|
||||
<if test="whetherScore != null">whether_score,
|
||||
</if>
|
||||
<if test="scoringMethod != null">scoring_method,
|
||||
</if>
|
||||
<if test="scoringDescription != null">scoring_description,
|
||||
</if>
|
||||
<if test="questionScore != null">question_score,
|
||||
</if>
|
||||
<if test="customTriggerCondition != null">custom_trigger_condition,
|
||||
</if>
|
||||
<if test="propagandaInfoId != null">propaganda_info_id,
|
||||
</if>
|
||||
<if test="propagandaTitle != null">propaganda_title,
|
||||
</if>
|
||||
<if test="questionSort != null">question_sort,
|
||||
</if>
|
||||
<if test="questionRemark != null">question_remark,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="questionInfoId != null">#{questionInfoId},
|
||||
</if>
|
||||
<if test="questionNumber != null">#{questionNumber},
|
||||
</if>
|
||||
<if test="questionType != null">#{questionType},
|
||||
</if>
|
||||
<if test="questionName != null">#{questionName},
|
||||
</if>
|
||||
<if test="questionDescription != null">#{questionDescription},
|
||||
</if>
|
||||
<if test="writeDescription != null">#{writeDescription},
|
||||
</if>
|
||||
<if test="fillBlanksAnswer != null">#{fillBlanksAnswer},
|
||||
</if>
|
||||
<if test="optionCount != null">#{optionCount},
|
||||
</if>
|
||||
<if test="whetherScore != null">#{whetherScore},
|
||||
</if>
|
||||
<if test="scoringMethod != null">#{scoringMethod},
|
||||
</if>
|
||||
<if test="scoringDescription != null">#{scoringDescription},
|
||||
</if>
|
||||
<if test="questionScore != null">#{questionScore},
|
||||
</if>
|
||||
<if test="customTriggerCondition != null">#{customTriggerCondition},
|
||||
</if>
|
||||
<if test="propagandaInfoId != null">#{propagandaInfoId},
|
||||
</if>
|
||||
<if test="propagandaTitle != null">#{propagandaTitle},
|
||||
</if>
|
||||
<if test="questionSort != null">#{questionSort},
|
||||
</if>
|
||||
<if test="questionRemark != null">#{questionRemark},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
<if test="questionInfoId != null">#{questionInfoId},
|
||||
</if>
|
||||
<if test="questionNumber != null">#{questionNumber},
|
||||
</if>
|
||||
<if test="questionType != null">#{questionType},
|
||||
</if>
|
||||
<if test="questionName != null">#{questionName},
|
||||
</if>
|
||||
<if test="questionDescription != null">#{questionDescription},
|
||||
</if>
|
||||
<if test="writeDescription != null">#{writeDescription},
|
||||
</if>
|
||||
<if test="fillBlanksAnswer != null">#{fillBlanksAnswer},
|
||||
</if>
|
||||
<if test="optionCount != null">#{optionCount},
|
||||
</if>
|
||||
<if test="whetherScore != null">#{whetherScore},
|
||||
</if>
|
||||
<if test="scoringMethod != null">#{scoringMethod},
|
||||
</if>
|
||||
<if test="scoringDescription != null">#{scoringDescription},
|
||||
</if>
|
||||
<if test="questionScore != null">#{questionScore},
|
||||
</if>
|
||||
<if test="customTriggerCondition != null">#{customTriggerCondition},
|
||||
</if>
|
||||
<if test="propagandaInfoId != null">#{propagandaInfoId},
|
||||
</if>
|
||||
<if test="propagandaTitle != null">#{propagandaTitle},
|
||||
</if>
|
||||
<if test="questionSort != null">#{questionSort},
|
||||
</if>
|
||||
<if test="questionRemark != null">#{questionRemark},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateQuestionSubject" parameterType="QuestionSubject">
|
||||
update question_subject
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="questionInfoId != null">question_info_id =
|
||||
#{questionInfoId},
|
||||
</if>
|
||||
<if test="questionNumber != null">question_number =
|
||||
#{questionNumber},
|
||||
</if>
|
||||
<if test="questionType != null">question_type =
|
||||
#{questionType},
|
||||
</if>
|
||||
<if test="questionName != null">question_name =
|
||||
#{questionName},
|
||||
</if>
|
||||
<if test="questionDescription != null">question_description =
|
||||
#{questionDescription},
|
||||
</if>
|
||||
<if test="writeDescription != null">write_description =
|
||||
#{writeDescription},
|
||||
</if>
|
||||
<if test="fillBlanksAnswer != null">fill_blanks_answer =
|
||||
#{fillBlanksAnswer},
|
||||
</if>
|
||||
<if test="optionCount != null">option_count =
|
||||
#{optionCount},
|
||||
</if>
|
||||
<if test="whetherScore != null">whether_score =
|
||||
#{whetherScore},
|
||||
</if>
|
||||
<if test="scoringMethod != null">scoring_method =
|
||||
#{scoringMethod},
|
||||
</if>
|
||||
<if test="scoringDescription != null">scoring_description =
|
||||
#{scoringDescription},
|
||||
</if>
|
||||
<if test="questionScore != null">question_score =
|
||||
#{questionScore},
|
||||
</if>
|
||||
<if test="customTriggerCondition != null">custom_trigger_condition =
|
||||
#{customTriggerCondition},
|
||||
</if>
|
||||
<if test="propagandaInfoId != null">propaganda_info_id =
|
||||
#{propagandaInfoId},
|
||||
</if>
|
||||
<if test="propagandaTitle != null">propaganda_title =
|
||||
#{propagandaTitle},
|
||||
</if>
|
||||
<if test="questionSort != null">question_sort =
|
||||
#{questionSort},
|
||||
</if>
|
||||
<if test="questionRemark != null">question_remark =
|
||||
#{questionRemark},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
<if test="questionInfoId != null">question_info_id =
|
||||
#{questionInfoId},
|
||||
</if>
|
||||
<if test="questionNumber != null">question_number =
|
||||
#{questionNumber},
|
||||
</if>
|
||||
<if test="questionType != null">question_type =
|
||||
#{questionType},
|
||||
</if>
|
||||
<if test="questionName != null">question_name =
|
||||
#{questionName},
|
||||
</if>
|
||||
<if test="questionDescription != null">question_description =
|
||||
#{questionDescription},
|
||||
</if>
|
||||
<if test="writeDescription != null">write_description =
|
||||
#{writeDescription},
|
||||
</if>
|
||||
<if test="fillBlanksAnswer != null">fill_blanks_answer =
|
||||
#{fillBlanksAnswer},
|
||||
</if>
|
||||
<if test="optionCount != null">option_count =
|
||||
#{optionCount},
|
||||
</if>
|
||||
<if test="whetherScore != null">whether_score =
|
||||
#{whetherScore},
|
||||
</if>
|
||||
<if test="scoringMethod != null">scoring_method =
|
||||
#{scoringMethod},
|
||||
</if>
|
||||
<if test="scoringDescription != null">scoring_description =
|
||||
#{scoringDescription},
|
||||
</if>
|
||||
<if test="questionScore != null">question_score =
|
||||
#{questionScore},
|
||||
</if>
|
||||
<if test="customTriggerCondition != null">custom_trigger_condition =
|
||||
#{customTriggerCondition},
|
||||
</if>
|
||||
<if test="propagandaInfoId != null">propaganda_info_id =
|
||||
#{propagandaInfoId},
|
||||
</if>
|
||||
<if test="propagandaTitle != null">propaganda_title =
|
||||
#{propagandaTitle},
|
||||
</if>
|
||||
<if test="questionSort != null">question_sort =
|
||||
#{questionSort},
|
||||
</if>
|
||||
<if test="questionRemark != null">question_remark =
|
||||
#{questionRemark},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQuestionSubjectById" parameterType="Long">
|
||||
delete from question_subject where id = #{id}
|
||||
delete
|
||||
from question_subject
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQuestionSubjectByIds" parameterType="String">
|
||||
@ -269,4 +293,51 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertQuestionSubjectList" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into question_subject(
|
||||
question_info_id,
|
||||
question_number,
|
||||
question_type,
|
||||
question_name,
|
||||
question_description,
|
||||
write_description,
|
||||
fill_blanks_answer,
|
||||
option_count,
|
||||
whether_score,
|
||||
scoring_method,
|
||||
scoring_description,
|
||||
question_score,
|
||||
custom_trigger_condition,
|
||||
propaganda_info_id,
|
||||
propaganda_title,
|
||||
question_sort,
|
||||
question_remark,
|
||||
create_by,
|
||||
create_time
|
||||
) values
|
||||
<foreach item="QuestionSubject" index="index" collection="list" separator=",">
|
||||
(
|
||||
#{QuestionSubject.questionInfoId},
|
||||
#{QuestionSubject.questionNumber},
|
||||
#{QuestionSubject.questionType},
|
||||
#{QuestionSubject.questionName},
|
||||
#{QuestionSubject.questionDescription},
|
||||
#{QuestionSubject.writeDescription},
|
||||
#{QuestionSubject.fillBlanksAnswer},
|
||||
#{QuestionSubject.optionCount},
|
||||
#{QuestionSubject.whetherScore},
|
||||
#{QuestionSubject.scoringMethod},
|
||||
#{QuestionSubject.scoringDescription},
|
||||
#{QuestionSubject.questionScore},
|
||||
#{QuestionSubject.customTriggerCondition},
|
||||
#{QuestionSubject.propagandaInfoId},
|
||||
#{QuestionSubject.propagandaTitle},
|
||||
#{QuestionSubject.questionSort},
|
||||
#{QuestionSubject.questionRemark},
|
||||
#{QuestionSubject.createBy},
|
||||
#{QuestionSubject.createTime}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@ -499,7 +499,10 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||
SysUser sysUser = userMapper.selectUserByUserName(userName);
|
||||
pageServiceUtil.startPage();
|
||||
List<AgencyNameVO> agencyList = userMapper.selectAgencyList(agencyName, sysUser.getAgencyId());
|
||||
return pageServiceUtil.getDataTable(agencyList);
|
||||
if (CollectionUtils.isNotEmpty(agencyList)){
|
||||
return pageServiceUtil.getDataTable(agencyList);
|
||||
}
|
||||
return pageServiceUtil.getDataTable(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user