试卷题目管理

This commit is contained in:
flower 2019-01-09 22:31:08 +08:00
parent e65b566012
commit f5c20d727f
6 changed files with 77 additions and 2 deletions

View File

@ -25,6 +25,11 @@
<artifactId>ruoyi-framework</artifactId> <artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version> <version>${ruoyi.version}</version>
</dependency> </dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.19</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -0,0 +1,35 @@
package com.ruoyi.exam.controller;
import com.ruoyi.exam.domain.ExamPractice;
import com.ruoyi.exam.service.IExamPracticeService;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* Created by flower on 2019/1/9.
*/
@Api("练习")
@RestController
@RequestMapping("/api/practice")
public class ApiPracticeController extends BaseController {
@Autowired
private IExamPracticeService examPracticeService;
@PostMapping("/list")
public TableDataInfo list(ExamPractice examPractice) {
List<ExamPractice> list = examPracticeService.selectListFromWeb(examPractice);
return getDataTable( list );
}
}

View File

@ -20,5 +20,6 @@ public interface ExamPracticeMapper extends MyMapper<ExamPractice>
* @return 练习集合 * @return 练习集合
*/ */
public List<ExamPractice> selectExamPracticeList(ExamPractice examPractice); public List<ExamPractice> selectExamPracticeList(ExamPractice examPractice);
List<ExamPractice> selectListFromWeb(ExamPractice examPractice);
} }

View File

@ -29,4 +29,10 @@ public interface IExamPracticeService extends AbstractBaseService<ExamPractice>
public List<ExamPractice> selectExamPracticeList(ExamPractice examPractice); public List<ExamPractice> selectExamPracticeList(ExamPractice examPractice);
/**
* 前台页面调用API
* @param examPractice
* @return
*/
List<ExamPractice> selectListFromWeb(ExamPractice examPractice);
} }

View File

@ -34,6 +34,11 @@ public class ExamPracticeServiceImpl extends AbstractBaseServiceImpl<ExamPractic
return examPracticeMapper.selectExamPracticeList(examPractice); return examPracticeMapper.selectExamPracticeList(examPractice);
} }
@Override
public List<ExamPractice> selectListFromWeb(ExamPractice examPractice) {
startPage();
return examPracticeMapper.selectListFromWeb(examPractice);
}
/** /**

View File

@ -43,6 +43,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if> <if test="delFlag != null and delFlag != '' "> and del_flag = #{delFlag}</if>
</where> </where>
</select> </select>
<select id="selectListFromWeb" parameterType="ExamPractice" resultMap="ExamPracticeResult">
select
<include refid="selectExamPracticeVo"/>
from exam_practice
<where>
((enable_control_time = '1' and end_time > NOW() and start_time < NOW())
or enable_control_time = '0')
<if test="id != null "> and id = #{id}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="name != null and name != '' "> and name = #{name}</if>
<if test="enableControlTime != null and enableControlTime != '' "> and enable_control_time = #{enableControlTime}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="practiceUserLimit != null and practiceUserLimit != '' "> and practice_user_limit = #{practiceUserLimit}</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> </mapper>