修改测试问题
This commit is contained in:
parent
039b29a8cf
commit
43ac71449a
@ -45,4 +45,10 @@ public class ExamSearchDTO {
|
||||
* */
|
||||
@ApiModelProperty(value = "用户主键", required=true)
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 考试类型(多种类型查询用,拼接)
|
||||
* */
|
||||
@ApiModelProperty(value = "考试类型(1:模拟考试,2:正式考试,3:补考)", required=true)
|
||||
private String examTypes;
|
||||
}
|
||||
|
||||
@ -51,4 +51,11 @@ public interface ExamMapper extends BaseMapper<Exam> {
|
||||
* @return
|
||||
*/
|
||||
List<ExamDTO> getExamList(@Param("query") ExamSearchDTO query);
|
||||
|
||||
/**
|
||||
* 查询可预约考试列表
|
||||
* @param query
|
||||
* @return
|
||||
*/
|
||||
IPage<ExamDTO> getExamPage(Page page, @Param("query") ExamSearchDTO query);
|
||||
}
|
||||
|
||||
@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yf.exam.core.api.dto.PagingReqDTO;
|
||||
import com.yf.exam.modules.exam.dto.ExamDTO;
|
||||
import com.yf.exam.modules.exam.dto.request.ExamSearchDTO;
|
||||
import com.yf.exam.modules.exam.dto.request.ExamSaveReqDTO;
|
||||
import com.yf.exam.modules.exam.dto.request.ExamSearchDTO;
|
||||
import com.yf.exam.modules.exam.dto.response.ExamOnlineRespDTO;
|
||||
import com.yf.exam.modules.exam.dto.response.ExamReviewRespDTO;
|
||||
import com.yf.exam.modules.exam.entity.Exam;
|
||||
@ -71,4 +71,11 @@ public interface ExamService extends IService<Exam> {
|
||||
*/
|
||||
List<ExamDTO> getExamList(ExamSearchDTO reqDTO);
|
||||
|
||||
/**
|
||||
* 分页查询可预约考试列表
|
||||
* @param reqDTO
|
||||
* @return
|
||||
*/
|
||||
IPage<ExamDTO> getExamPage(PagingReqDTO<ExamSearchDTO> reqDTO);
|
||||
|
||||
}
|
||||
|
||||
@ -11,7 +11,9 @@ import com.yf.exam.core.enums.GooodsOrderStatusEnum;
|
||||
import com.yf.exam.core.exception.ServiceException;
|
||||
import com.yf.exam.modules.exam.dto.ExamRegistrationDTO;
|
||||
import com.yf.exam.modules.exam.dto.response.ExamRegistrationVO;
|
||||
import com.yf.exam.modules.exam.entity.Exam;
|
||||
import com.yf.exam.modules.exam.entity.ExamRegistration;
|
||||
import com.yf.exam.modules.exam.mapper.ExamMapper;
|
||||
import com.yf.exam.modules.exam.mapper.ExamRegistrationMapper;
|
||||
import com.yf.exam.modules.exam.service.ExamRegistrationService;
|
||||
import com.yf.exam.modules.paper.enums.ExamFinishState;
|
||||
@ -19,6 +21,7 @@ import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -31,6 +34,9 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class ExamRegistrationServiceImpl extends ServiceImpl<ExamRegistrationMapper, ExamRegistration> implements ExamRegistrationService {
|
||||
|
||||
@Resource
|
||||
private ExamMapper examMapper;
|
||||
|
||||
@Override
|
||||
public String save(ExamRegistrationDTO reqDTO) {
|
||||
if (StringUtils.isBlank(reqDTO.getUserId()) || StringUtils.isBlank(reqDTO.getUserName()) || StringUtils.isBlank(reqDTO.getRealName()) || StringUtils.isBlank(reqDTO.getPhone())) {
|
||||
@ -40,6 +46,8 @@ public class ExamRegistrationServiceImpl extends ServiceImpl<ExamRegistrationMap
|
||||
throw new ServiceException("请选择要报名的考试");
|
||||
}
|
||||
|
||||
Exam exam = examMapper.selectById(reqDTO.getId());
|
||||
|
||||
// 查询考生是否报名过该考试
|
||||
ExamRegistrationDTO examRegistrationDTO = new ExamRegistrationDTO();
|
||||
examRegistrationDTO.setExamId(reqDTO.getExamId());
|
||||
@ -65,7 +73,11 @@ public class ExamRegistrationServiceImpl extends ServiceImpl<ExamRegistrationMap
|
||||
entity.setOrderTime(LocalDateTime.now());
|
||||
entity.setPaymentState(GooodsOrderStatusEnum.WAIT_PAY.getInfo());
|
||||
entity.setFinishState(ExamFinishState.UNFINISH);
|
||||
entity.setExpirationState(true);
|
||||
entity.setExpirationState(false);
|
||||
if (exam != null) {
|
||||
entity.setExpirationDate(exam.getExpirationDate());
|
||||
}
|
||||
|
||||
if (reqDTO.getExamType() == 1) {
|
||||
entity.setRegTime(LocalDate.now());
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
||||
this.calcScore(reqDTO);
|
||||
|
||||
|
||||
if (reqDTO.getTimeLimit() && (reqDTO.getStartDate() == null || reqDTO.getEndDate() == null || reqDTO.getStartTime() == null || reqDTO.getEndTime() == null)) {
|
||||
if ((reqDTO.getTimeLimit() || reqDTO.getExamType() == 2 || reqDTO.getExamType() == 3) && (reqDTO.getStartDate() == null || reqDTO.getEndDate() == null || reqDTO.getStartTime() == null || reqDTO.getEndTime() == null)) {
|
||||
throw new ServiceException(1, "日期时间范围不能为空!");
|
||||
}
|
||||
// 复制基本数据
|
||||
@ -164,7 +164,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询可预约考试列表
|
||||
* 查询可预约的正式考试列表
|
||||
* @param reqDTO
|
||||
* @return
|
||||
*/
|
||||
@ -176,6 +176,17 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements Ex
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ExamDTO> getExamPage(PagingReqDTO<ExamSearchDTO> reqDTO) {
|
||||
// 创建分页对象
|
||||
Page page = new Page(reqDTO.getCurrent(), reqDTO.getSize());
|
||||
|
||||
// 查找分页
|
||||
IPage<ExamDTO> pageData = baseMapper.getExamPage(page, reqDTO.getParams());
|
||||
|
||||
return pageData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算分值
|
||||
* @param reqDTO
|
||||
|
||||
@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yf.exam.core.api.ApiRest;
|
||||
import com.yf.exam.core.api.controller.BaseController;
|
||||
import com.yf.exam.core.api.dto.BaseIdReqDTO;
|
||||
import com.yf.exam.core.api.dto.BaseIdRespDTO;
|
||||
import com.yf.exam.core.api.dto.BaseIdsReqDTO;
|
||||
import com.yf.exam.core.api.dto.PagingReqDTO;
|
||||
import com.yf.exam.core.utils.BeanMapper;
|
||||
import com.yf.exam.modules.paper.dto.PaperDTO;
|
||||
import com.yf.exam.modules.paper.dto.ext.PaperQuDetailDTO;
|
||||
import com.yf.exam.modules.paper.dto.request.PaperAnswerDTO;
|
||||
@ -17,13 +14,11 @@ import com.yf.exam.modules.paper.dto.request.PaperQuQueryDTO;
|
||||
import com.yf.exam.modules.paper.dto.response.ExamDetailRespDTO;
|
||||
import com.yf.exam.modules.paper.dto.response.ExamResultRespDTO;
|
||||
import com.yf.exam.modules.paper.dto.response.PaperListRespDTO;
|
||||
import com.yf.exam.modules.paper.entity.Paper;
|
||||
import com.yf.exam.modules.paper.service.PaperService;
|
||||
import com.yf.exam.modules.paper.vo.PaperStateVO;
|
||||
import com.yf.exam.modules.user.UserUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -68,10 +63,10 @@ public class PaperController extends BaseController {
|
||||
*/
|
||||
@ApiOperation(value = "创建试卷")
|
||||
@RequestMapping(value = "/create-paper", method = { RequestMethod.POST})
|
||||
public ApiRest<BaseIdRespDTO> save(@RequestBody PaperCreateReqDTO reqDTO) {
|
||||
public ApiRest<PaperStateVO> save(@RequestBody PaperCreateReqDTO reqDTO) {
|
||||
//复制参数
|
||||
String paperId = baseService.createPaper(UserUtils.getUserId(), reqDTO.getExamId());
|
||||
return super.success(new BaseIdRespDTO(paperId));
|
||||
PaperStateVO paperStateVO = baseService.createPaper(UserUtils.getUserId(), reqDTO.getExamId(), reqDTO.getExamType());
|
||||
return super.success(paperStateVO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -19,4 +19,10 @@ public class PaperCreateReqDTO extends BaseDTO {
|
||||
@ApiModelProperty(value = "考试ID", required=true)
|
||||
private String examId;
|
||||
|
||||
/**
|
||||
* 考试类型(1:模拟考试,2:正式考试,3:补考)
|
||||
* */
|
||||
@ApiModelProperty(value = "考试类型(1:模拟考试,2:正式考试,3:补考)", required=true)
|
||||
private Integer examType;
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@ -122,4 +123,10 @@ public class Paper extends Model<Paper> {
|
||||
*/
|
||||
@TableField("limit_time")
|
||||
private Date limitTime;
|
||||
|
||||
/**
|
||||
* 考试类型(1:模拟考试,2:正式考试,3:补考)
|
||||
* */
|
||||
@ApiModelProperty(value = "考试类型(1:模拟考试,2:正式考试,3:补考)", required=true)
|
||||
private Integer examType;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import com.yf.exam.modules.paper.dto.response.ExamDetailRespDTO;
|
||||
import com.yf.exam.modules.paper.dto.response.ExamResultRespDTO;
|
||||
import com.yf.exam.modules.paper.dto.response.PaperListRespDTO;
|
||||
import com.yf.exam.modules.paper.entity.Paper;
|
||||
import com.yf.exam.modules.paper.vo.PaperStateVO;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -28,7 +29,7 @@ public interface PaperService extends IService<Paper> {
|
||||
* @param examId
|
||||
* @return
|
||||
*/
|
||||
String createPaper(String userId, String examId);
|
||||
PaperStateVO createPaper(String userId, String examId, Integer examType);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yf.exam.ability.job.enums.JobGroup;
|
||||
import com.yf.exam.ability.job.enums.JobPrefix;
|
||||
import com.yf.exam.ability.job.service.JobService;
|
||||
import com.yf.exam.core.api.ApiError;
|
||||
import com.yf.exam.core.api.dto.PagingReqDTO;
|
||||
import com.yf.exam.core.exception.ServiceException;
|
||||
import com.yf.exam.core.utils.BeanMapper;
|
||||
@ -32,7 +31,6 @@ import com.yf.exam.modules.paper.entity.Paper;
|
||||
import com.yf.exam.modules.paper.entity.PaperQu;
|
||||
import com.yf.exam.modules.paper.entity.PaperQuAnswer;
|
||||
import com.yf.exam.modules.paper.enums.ExamFinishState;
|
||||
import com.yf.exam.modules.paper.enums.ExamState;
|
||||
import com.yf.exam.modules.paper.enums.ExamType;
|
||||
import com.yf.exam.modules.paper.enums.PaperState;
|
||||
import com.yf.exam.modules.paper.job.BreakExamJob;
|
||||
@ -40,6 +38,7 @@ import com.yf.exam.modules.paper.mapper.PaperMapper;
|
||||
import com.yf.exam.modules.paper.service.PaperQuAnswerService;
|
||||
import com.yf.exam.modules.paper.service.PaperQuService;
|
||||
import com.yf.exam.modules.paper.service.PaperService;
|
||||
import com.yf.exam.modules.paper.vo.PaperStateVO;
|
||||
import com.yf.exam.modules.qu.entity.Qu;
|
||||
import com.yf.exam.modules.qu.entity.QuAnswer;
|
||||
import com.yf.exam.modules.qu.enums.QuType;
|
||||
@ -124,19 +123,20 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public String createPaper(String userId, String examId) {
|
||||
public PaperStateVO createPaper(String userId, String examId, Integer examType) {
|
||||
|
||||
// 校验是否有正在考试的试卷
|
||||
QueryWrapper<Paper> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda()
|
||||
.eq(Paper::getUserId, userId)
|
||||
.eq(Paper::getState, PaperState.ING);
|
||||
.eq(Paper::getState, PaperState.ING)
|
||||
.eq(Paper::getExamId, examId);
|
||||
|
||||
int exists = this.count(wrapper);
|
||||
Paper obj = this.getOne(wrapper);
|
||||
|
||||
|
||||
if (exists > 0) {
|
||||
throw new ServiceException(ApiError.ERROR_20010002);
|
||||
if (obj != null) {
|
||||
return PaperStateVO.builder().hasPaper(true).id(obj.getId()).build();
|
||||
}
|
||||
|
||||
// 查找考试
|
||||
@ -146,9 +146,9 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
|
||||
throw new ServiceException(1, "考试不存在!");
|
||||
}
|
||||
|
||||
if(!ExamState.ENABLE.equals(exam.getState())){
|
||||
/*if(!ExamState.ENABLE.equals(exam.getState())){
|
||||
throw new ServiceException(1, "考试状态不正确!");
|
||||
}
|
||||
}*/
|
||||
|
||||
// 考试题目列表
|
||||
List<PaperQu> quList = this.generateByRepo(examId);
|
||||
@ -164,7 +164,7 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
|
||||
String jobName = JobPrefix.BREAK_EXAM + paper.getId();
|
||||
jobService.addCronJob(BreakExamJob.class, jobName, CronUtils.dateToCron(paper.getLimitTime()), paper.getId());
|
||||
|
||||
return paper.getId();
|
||||
return PaperStateVO.builder().hasPaper(false).id(paper.getId()).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -349,6 +349,7 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, Paper> implements
|
||||
paper.setTitle(exam.getTitle());
|
||||
paper.setTotalScore(exam.getTotalScore());
|
||||
paper.setTotalTime(exam.getTotalTime());
|
||||
paper.setExamType(exam.getExamType());
|
||||
paper.setUserScore(0);
|
||||
paper.setUserId(userId);
|
||||
paper.setCreateTime(new Date());
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
package com.yf.exam.modules.paper.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @description: 查询是否有正在进行的考试返回视图类
|
||||
* @author: haown
|
||||
* @create: 2025-08-27 16:29
|
||||
**/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class PaperStateVO {
|
||||
|
||||
/**
|
||||
* 是否有正在进行的考试标识,true:有,false:无
|
||||
*/
|
||||
private Boolean hasPaper;
|
||||
|
||||
/**
|
||||
* 试卷主键
|
||||
*/
|
||||
private String id;
|
||||
}
|
||||
@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* @create: 2025-08-26 16:22
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/monitor/payTask")
|
||||
@RequestMapping("/monitor/regTask")
|
||||
public class ExamRegistrationTaskController {
|
||||
|
||||
}
|
||||
|
||||
@ -10,12 +10,14 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @description: 考试预约定时任务实现类
|
||||
* @author: haown
|
||||
* @create: 2025-08-26 16:31
|
||||
**/
|
||||
@Service
|
||||
public class ExamRegistrationTaskServiceImpl implements ExamRegistrationTaskService {
|
||||
|
||||
@Resource
|
||||
|
||||
@ -85,7 +85,9 @@
|
||||
FROM el_exam ex
|
||||
LEFT JOIN el_exam_depart dept ON ex.id=dept.exam_id AND ex.open_type=2
|
||||
LEFT JOIN sys_user uc ON uc.depart_id=dept.depart_id
|
||||
WHERE ex.state=0 AND (ex.open_type=1 OR ex.open_type=3 OR uc.id='{{userId}}')
|
||||
WHERE
|
||||
-- ex.state=0 AND
|
||||
(ex.open_type=1 OR ex.open_type=3 OR uc.id='{{userId}}')
|
||||
|
||||
<if test="query!=null">
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
@ -104,22 +106,49 @@
|
||||
|
||||
<select id="getExamList" resultMap="OnlineResultMap">
|
||||
SELECT * FROM el_exam
|
||||
where state = 0 and (exam_type = 2 or exam_type = 3)
|
||||
and id not in (select exam_id from el_exam_registration where user_id = #{query.userId} and (payment_state = 'PAY' or payment_state = 'WAIT_REFUND'))
|
||||
where id not in (select exam_id from el_exam_registration where user_id = #{query.userId} and (payment_state = 'PAY' or payment_state = 'WAIT_REFUND'))
|
||||
<if test="query!=null">
|
||||
<if test="query.openType!=null">
|
||||
AND open_type = #{query.openType}
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
<if test="query.examType != null and query.examType != ''">
|
||||
AND exam_type = #{query.examType}
|
||||
</if>
|
||||
<if test="query.startDate!=null">
|
||||
AND start_date <= #{query.startDate}
|
||||
<if test="query.examTypes != null and query.examTypes != ''">
|
||||
AND exam_type in
|
||||
<foreach item = "item" collection="query.examTypes.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!--<if test="query.startDate!=null">
|
||||
AND start_date <= #{query.startDate}
|
||||
</if>-->
|
||||
<if test="query.endDate!=null">
|
||||
AND end_date >= #{query.endDate}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getExamPage" resultMap="OnlineResultMap">
|
||||
SELECT * FROM el_exam
|
||||
where id not in (select exam_id from el_exam_registration where user_id = #{query.userId} and (payment_state = 'PAY' or payment_state = 'WAIT_REFUND') and expiration_state = false)
|
||||
<if test="query!=null">
|
||||
<if test="query.openType!=null">
|
||||
AND open_type = #{query.openType}
|
||||
</if>
|
||||
<if test="query.examType != null and query.examType != ''">
|
||||
AND exam_type = #{query.examType}
|
||||
</if>
|
||||
<if test="query.examTypes != null and query.examTypes != ''">
|
||||
AND exam_type in
|
||||
<foreach item = "item" collection="query.examTypes.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.endDate!=null">
|
||||
AND end_date >= #{query.endDate}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -49,34 +49,35 @@
|
||||
,ex.total_score, ex.total_time, ex.qualify_score, ex.exam_fee, DATEDIFF(ex.start_date, now()) >= 2 as daysAllow, ex.expiration_date
|
||||
FROM el_exam_registration reg
|
||||
left join el_exam ex on reg.exam_id = ex.id
|
||||
WHERE ex.state = 0
|
||||
<if test="query.userId!=null">
|
||||
AND reg.user_id=#{query.userId}
|
||||
</if>
|
||||
<if test="query.finishState!=null">
|
||||
AND reg.finish_state=#{query.finishState}
|
||||
</if>
|
||||
<if test="query.paymentState!=null">
|
||||
AND reg.payment_state=#{query.paymentState}
|
||||
</if>
|
||||
<if test="query.examId!=null">
|
||||
AND reg.exam_id=#{query.examId}
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND ex.exam_type=#{query.examType}
|
||||
</if>
|
||||
<if test="query.examTypes != null and query.examTypes != ''">
|
||||
AND ex.exam_type in
|
||||
<foreach item = "item" collection="query.examTypes.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.paymentStates != null and query.paymentStates != ''">
|
||||
AND reg.payment_state in
|
||||
<foreach item = "item" collection="query.paymentStates.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<where>
|
||||
<if test="query.userId!=null">
|
||||
AND reg.user_id=#{query.userId}
|
||||
</if>
|
||||
<if test="query.finishState!=null">
|
||||
AND reg.finish_state=#{query.finishState}
|
||||
</if>
|
||||
<if test="query.paymentState!=null">
|
||||
AND reg.payment_state=#{query.paymentState}
|
||||
</if>
|
||||
<if test="query.examId!=null">
|
||||
AND reg.exam_id=#{query.examId}
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND ex.exam_type=#{query.examType}
|
||||
</if>
|
||||
<if test="query.examTypes != null and query.examTypes != ''">
|
||||
AND ex.exam_type in
|
||||
<foreach item = "item" collection="query.examTypes.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.paymentStates != null and query.paymentStates != ''">
|
||||
AND reg.payment_state in
|
||||
<foreach item = "item" collection="query.paymentStates.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by reg.payment_date desc, reg.order_time desc
|
||||
</select>
|
||||
|
||||
@ -86,34 +87,35 @@
|
||||
,ex.total_score, ex.total_time, ex.qualify_score, ex.exam_fee, ex.expiration_date
|
||||
FROM el_exam_registration reg
|
||||
left join el_exam ex on reg.exam_id = ex.id
|
||||
WHERE ex.state = 0
|
||||
<if test="query.userId!=null">
|
||||
AND reg.user_id=#{query.userId}
|
||||
</if>
|
||||
<if test="query.finishState!=null">
|
||||
AND reg.finish_state=#{query.finishState}
|
||||
</if>
|
||||
<if test="query.paymentState!=null">
|
||||
AND reg.payment_state=#{query.paymentState}
|
||||
</if>
|
||||
<if test="query.examId!=null">
|
||||
AND reg.exam_id=#{query.examId}
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND ex.exam_type=#{query.examType}
|
||||
</if>
|
||||
<if test="query.examTypes != null and query.examTypes != ''">
|
||||
AND ex.exam_type in
|
||||
<foreach item = "item" collection="query.examTypes.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.paymentStates != null and query.paymentStates != ''">
|
||||
AND reg.payment_state in
|
||||
<foreach item = "item" collection="query.paymentStates.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<where>
|
||||
<if test="query.userId!=null">
|
||||
AND reg.user_id=#{query.userId}
|
||||
</if>
|
||||
<if test="query.finishState!=null">
|
||||
AND reg.finish_state=#{query.finishState}
|
||||
</if>
|
||||
<if test="query.paymentState!=null">
|
||||
AND reg.payment_state=#{query.paymentState}
|
||||
</if>
|
||||
<if test="query.examId!=null">
|
||||
AND reg.exam_id=#{query.examId}
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND ex.exam_type=#{query.examType}
|
||||
</if>
|
||||
<if test="query.examTypes != null and query.examTypes != ''">
|
||||
AND ex.exam_type in
|
||||
<foreach item = "item" collection="query.examTypes.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="query.paymentStates != null and query.paymentStates != ''">
|
||||
AND reg.payment_state in
|
||||
<foreach item = "item" collection="query.paymentStates.split(',')" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
order by reg.payment_date desc, reg.order_time desc
|
||||
</select>
|
||||
|
||||
@ -128,12 +130,13 @@
|
||||
</update>
|
||||
|
||||
<select id="getRegUserList" resultType="com.yf.exam.modules.exam.dto.response.ExamRegistrationVO">
|
||||
SELECT reg.id, reg.user_id as userId, reg.user_name, reg.real_name, reg.phone, reg.payment_state, reg.confirm_refund_status, reg.refund_reason
|
||||
SELECT reg.id, reg.user_id as userId, reg.user_name, reg.real_name, reg.phone, reg.payment_state,reg.payment_date, reg.confirm_refund_status, reg.refund_reason
|
||||
, ex.id as examId, ex.title, ex.content, ex.exam_type, ex.start_date, ex.end_date, ex.start_time, ex.end_time
|
||||
,ex.total_score, ex.total_time, ex.qualify_score, ex.exam_fee
|
||||
FROM el_exam_registration reg
|
||||
left join el_exam ex on reg.exam_id = ex.id
|
||||
WHERE ex.state=0 and (reg.payment_state = 'PAY' or reg.payment_state = 'WAIT_REFUND' or reg.payment_state = 'REFUNDED')
|
||||
WHERE
|
||||
(reg.payment_state = 'PAY' or reg.payment_state = 'WAIT_REFUND' or reg.payment_state = 'REFUNDED')
|
||||
<if test="query!=null">
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND ex.title LIKE CONCAT('%',#{query.title},'%')
|
||||
@ -174,18 +177,19 @@
|
||||
reg.id as id, reg.user_id as userId, reg.user_name, reg.real_name, reg.phone, reg.payment_state, reg.finish_state
|
||||
FROM el_exam ex
|
||||
left join (select * from el_exam_registration where user_id = #{query.userId} and (payment_state = 'PAY' or payment_state = 'WAIT_REFUND') and expiration_state = false) reg on reg.exam_id = ex.id
|
||||
WHERE ex.state=0
|
||||
<if test="query!=null">
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND ex.title LIKE CONCAT('%',#{query.title},'%')
|
||||
<where>
|
||||
<if test="query!=null">
|
||||
<if test="query.title!=null and query.title!=''">
|
||||
AND ex.title LIKE CONCAT('%',#{query.title},'%')
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND ex.exam_type=#{query.examType}
|
||||
</if>
|
||||
<if test="query.paymentEndDate!=null">
|
||||
AND reg.payment_date >= #{query.paymentEndDate}
|
||||
</if>
|
||||
</if>
|
||||
<if test="query.examType!=null">
|
||||
AND ex.exam_type=#{query.examType}
|
||||
</if>
|
||||
<if test="query.paymentEndDate!=null">
|
||||
AND reg.payment_date >= #{query.paymentEndDate}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
order by ex.start_date
|
||||
</select>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user