练习页面

This commit is contained in:
flower 2019-01-10 02:42:08 +08:00
parent a1e04c113a
commit e550222618
10 changed files with 402 additions and 0 deletions

View File

@ -0,0 +1,152 @@
package com.ruoyi.exam.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
import javax.persistence.Id;
import java.util.Date;
/**
* 我的错题表 exam_user_error_question
*
* @author zhujj
* @date 2019-01-10
*/
public class ExamUserErrorQuestion
{
private static final long serialVersionUID = 1L;
/** 练习对象 */
@Id
private Integer id;
/** 会员代码 */
private Integer vipUserId;
/** 练习题代码 */
private Integer examQuestionId;
/** 创建者 */
private String createBy;
/** 创建时间 */
private Date createDate;
/** 更新者 */
private String updateBy;
/** 更新时间 */
private Date updateDate;
/** 备注信息 */
private String remarks;
/** 删除标记 */
private String delFlag;
/** 设置练习对象 */
public void setId(Integer id)
{
this.id = id;
}
/** 获取练习对象 */
public Integer getId()
{
return id;
}
/** 设置会员代码 */
public void setVipUserId(Integer vipUserId)
{
this.vipUserId = vipUserId;
}
/** 获取会员代码 */
public Integer getVipUserId()
{
return vipUserId;
}
/** 设置练习题代码 */
public void setExamQuestionId(Integer examQuestionId)
{
this.examQuestionId = examQuestionId;
}
/** 获取练习题代码 */
public Integer getExamQuestionId()
{
return examQuestionId;
}
/** 设置创建者 */
public void setCreateBy(String createBy)
{
this.createBy = createBy;
}
/** 获取创建者 */
public String getCreateBy()
{
return createBy;
}
/** 设置创建时间 */
public void setCreateDate(Date createDate)
{
this.createDate = createDate;
}
/** 获取创建时间 */
public Date getCreateDate()
{
return createDate;
}
/** 设置更新者 */
public void setUpdateBy(String updateBy)
{
this.updateBy = updateBy;
}
/** 获取更新者 */
public String getUpdateBy()
{
return updateBy;
}
/** 设置更新时间 */
public void setUpdateDate(Date updateDate)
{
this.updateDate = updateDate;
}
/** 获取更新时间 */
public Date getUpdateDate()
{
return updateDate;
}
/** 设置备注信息 */
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
/** 获取备注信息 */
public String getRemarks()
{
return remarks;
}
/** 设置删除标记 */
public void setDelFlag(String delFlag)
{
this.delFlag = delFlag;
}
/** 获取删除标记 */
public String getDelFlag()
{
return delFlag;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("vipUserId", getVipUserId())
.append("examQuestionId", getExamQuestionId())
.append("createBy", getCreateBy())
.append("createDate", getCreateDate())
.append("updateBy", getUpdateBy())
.append("updateDate", getUpdateDate())
.append("remarks", getRemarks())
.append("delFlag", getDelFlag())
.toString();
}
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.exam.domain;
/**
* Created by flower on 2019/1/10.
*/
public class ExamUserErrorQuestionVO extends ExamUserErrorQuestion {
private ExamQuestion question;
public ExamQuestion getQuestion() {
return question;
}
public void setQuestion(ExamQuestion question) {
this.question = question;
}
}

View File

@ -66,4 +66,6 @@ public interface ExamQuestionMapper extends MyMapper<ExamQuestion>
List<ExamQuestion> selectListBycategory(ExamQuestion examQuestion);
List<ExamQuestionVO> selectQuestionListByPracticeId(Map<String, Object> map);
ExamQuestionVO selectQuestionDetail(String questionId);
}

View File

@ -0,0 +1,27 @@
package com.ruoyi.exam.mapper;
import com.ruoyi.exam.domain.ExamUserErrorQuestion;
import java.util.List;
import com.ruoyi.exam.domain.ExamUserErrorQuestionVO;
import com.ruoyi.framework.web.base.MyMapper;
/**
* 我的错题 数据层
*
* @author zhujj
* @date 2019-01-10
*/
public interface ExamUserErrorQuestionMapper extends MyMapper<ExamUserErrorQuestion>
{
/**
* 查询我的错题列表
*
* @param examUserErrorQuestion 我的错题信息
* @return 我的错题集合
*/
public List<ExamUserErrorQuestion> selectExamUserErrorQuestionList(ExamUserErrorQuestion examUserErrorQuestion);
List<ExamUserErrorQuestionVO> selectExamUserErrorQuestionDetailPage(ExamUserErrorQuestion examUserErrorQuestion);
}

View File

@ -66,4 +66,6 @@ public interface IExamQuestionService extends AbstractBaseService<ExamQuestion>
List<ExamQuestion> selectListBycategory(ExamQuestion examQuestion);
List<ExamQuestionVO> selectQuestionListByPracticeId(Map<String, Object> map);
ExamQuestionVO selectQuestionDetail(String questionId);
}

View File

@ -0,0 +1,33 @@
package com.ruoyi.exam.service;
import com.ruoyi.exam.domain.ExamUserErrorQuestion;
import java.util.List;
import com.ruoyi.exam.domain.ExamUserErrorQuestionVO;
import com.ruoyi.framework.web.base.AbstractBaseService;
/**
* 我的错题 服务层
*
* @author zhujj
* @date 2019-01-10
*/
public interface IExamUserErrorQuestionService extends AbstractBaseService<ExamUserErrorQuestion>
{
/**
* 查询我的错题分页列表
*
* @param examUserErrorQuestion 我的错题信息
* @return 我的错题集合
*/
public List<ExamUserErrorQuestion> selectExamUserErrorQuestionPage(ExamUserErrorQuestion examUserErrorQuestion);
/**
* 查询我的错题列表
*
* @param examUserErrorQuestion 我的错题信息
* @return 我的错题集合
*/
public List<ExamUserErrorQuestion> selectExamUserErrorQuestionList(ExamUserErrorQuestion examUserErrorQuestion);
List<ExamUserErrorQuestionVO> selectExamUserErrorQuestionDetailPage(ExamUserErrorQuestion examUserErrorQuestion);
}

View File

@ -170,4 +170,9 @@ public class ExamQuestionServiceImpl extends AbstractBaseServiceImpl<ExamQuestio
}
@Override
public ExamQuestionVO selectQuestionDetail(String questionId) {
return examQuestionMapper.selectQuestionDetail(questionId);
}
}

View File

@ -0,0 +1,56 @@
package com.ruoyi.exam.service.impl;
import java.util.List;
import com.ruoyi.exam.domain.ExamUserErrorQuestionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.exam.mapper.ExamUserErrorQuestionMapper;
import com.ruoyi.exam.domain.ExamUserErrorQuestion;
import com.ruoyi.exam.service.IExamUserErrorQuestionService;
import com.ruoyi.framework.web.base.AbstractBaseServiceImpl;
/**
* 我的错题 服务层实现
*
* @author zhujj
* @date 2019-01-10
*/
@Service
public class ExamUserErrorQuestionServiceImpl extends AbstractBaseServiceImpl<ExamUserErrorQuestionMapper,ExamUserErrorQuestion> implements IExamUserErrorQuestionService
{
@Autowired
private ExamUserErrorQuestionMapper examUserErrorQuestionMapper;
/**
* 查询我的错题列表
*
* @param examUserErrorQuestion 我的错题信息
* @return 我的错题集合
*/
@Override
public List<ExamUserErrorQuestion> selectExamUserErrorQuestionList(ExamUserErrorQuestion examUserErrorQuestion)
{
return examUserErrorQuestionMapper.selectExamUserErrorQuestionList(examUserErrorQuestion);
}
@Override
public List<ExamUserErrorQuestionVO> selectExamUserErrorQuestionDetailPage(ExamUserErrorQuestion examUserErrorQuestion) {
startPage();
return examUserErrorQuestionMapper.selectExamUserErrorQuestionDetailPage(examUserErrorQuestion);
}
/**
* 查询我的错题分页列表
*
* @param examUserErrorQuestion 我的错题信息
* @return 我的错题集合
*/
@Override
public List<ExamUserErrorQuestion> selectExamUserErrorQuestionPage(ExamUserErrorQuestion examUserErrorQuestion)
{
startPage();
return examUserErrorQuestionMapper.selectExamUserErrorQuestionList(examUserErrorQuestion);
}
}

View File

@ -109,6 +109,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by epq.order_num
</select>
<select id="selectQuestionDetail" resultMap="ExamQuestionResultVO">
select eq.id, eq.title, eq.answer, eq.type, eq.label, eq.category_id,
eq.create_by, eq.create_date, eq.update_by, eq.update_date, eq.remarks, eq.del_flag ,
eqi.id AS item_id,
eqi.content AS item_content,
eqi.number AS item_number,
eqi.exam_question_id AS item_exam_question_id,
eqi.remarks AS item_remarks
from exam_question eq
INNER JOIN exam_question_item eqi ON eqi.exam_question_id = eq.id
where eq.id = #{questionId}
</select>
<insert id="insertExamQuestion" keyProperty="id" useGeneratedKeys="true" parameterType="ExamQuestion">
insert into exam_question
<trim prefix="(" suffix=")" suffixOverrides=",">

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.exam.mapper.ExamUserErrorQuestionMapper">
<resultMap type="ExamUserErrorQuestion" id="ExamUserErrorQuestionResult">
<result property="id" column="id" />
<result property="vipUserId" column="vip_user_id" />
<result property="examQuestionId" column="exam_question_id" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="remarks" column="remarks" />
<result property="delFlag" column="del_flag" />
</resultMap>
<resultMap type="ExamUserErrorQuestionVO" id="ExamUserErrorQuestionResultVO">
<result property="id" column="id" />
<result property="vipUserId" column="vip_user_id" />
<result property="examQuestionId" column="exam_question_id" />
<result property="createBy" column="create_by" />
<result property="createDate" column="create_date" />
<result property="updateBy" column="update_by" />
<result property="updateDate" column="update_date" />
<result property="remarks" column="remarks" />
<result property="delFlag" column="del_flag" />
<association property="question" javaType="com.ruoyi.exam.domain.ExamQuestion">
<result property="id" column="eq_id" />
<result property="title" column="eq_title" />
<result property="answer" column="eq_answer" />
<result property="type" column="eq_type" />
<result property="label" column="eq_label" />
<result property="categoryId" column="eq_category_id" />
<result property="createBy" column="eq_create_by" />
<result property="createDate" column="eq_create_date" />
<result property="updateBy" column="eq_update_by" />
<result property="updateDate" column="eq_update_date" />
<result property="remarks" column="eq_remarks" />
<result property="delFlag" column="eq_del_flag" />
</association>
</resultMap>
<sql id="selectExamUserErrorQuestionVo">
euq.id, euq.vip_user_id, euq.exam_question_id, euq.create_by, euq.create_date, euq.update_by, euq.update_date, euq.remarks, euq.del_flag </sql>
<select id="selectExamUserErrorQuestionList" parameterType="ExamUserErrorQuestion" resultMap="ExamUserErrorQuestionResult">
select
<include refid="selectExamUserErrorQuestionVo"/>
from exam_user_error_question
<where>
<if test="id != null "> and id = #{id}</if>
<if test="vipUserId != null "> and vip_user_id = #{vipUserId}</if>
<if test="examQuestionId != null "> and exam_question_id = #{examQuestionId}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="remarks != null and remarks != '' "> and remarks = #{remarks}</if>
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
</where>
</select>
<select id="selectExamUserErrorQuestionDetailPage" resultMap="ExamUserErrorQuestionResultVO">
select
<include refid="selectExamUserErrorQuestionVo"/>,
eq.id as eq_id,
eq.title as eq_title,
eq.answer as eq_answer,
eq.type as eq_type,
eq.label as eq_label,
eq.category_id as eq_category_id,
eq.create_by as eq_create_by,
eq.create_date as eq_create_date,
eq.update_by as eq_update_by,
eq.update_date as eq_update_date,
eq.remarks as eq_remarks,
eq.del_flag as eq_del_flag
from exam_user_error_question euq
INNER JOIN exam_question eq ON eq.id = euq.exam_question_id
<where>
<if test="id != null "> and id = #{id}</if>
<if test="vipUserId != null "> and vip_user_id = #{vipUserId}</if>
<if test="examQuestionId != null "> and exam_question_id = #{examQuestionId}</if>
<if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateBy != null and updateBy != '' "> and update_by = #{updateBy}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
<if test="remarks != null and remarks != '' "> and remarks = #{remarks}</if>
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
</where>
</select>
</mapper>