Browse Source

'考试成绩'

小么熊🐻 3 years ago
parent
commit
39d12df6fb

+ 109 - 0
jkt-admin/src/main/java/com/miaxis/app/controller/ScoreInfoController.java

@@ -0,0 +1,109 @@
+package com.miaxis.app.controller;
+
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import com.miaxis.score.domain.ScoreInfo;
+import com.miaxis.score.service.IScoreInfoService;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 【模拟考成绩】Controller
+ *
+ * @author miaxis
+ * @date 2021-08-23
+ */
+@RestController
+@RequestMapping("/score/info")
+@Api(tags={"【app-模拟考成绩】"})
+public class ScoreInfoController extends BaseController{
+    @Autowired
+    private IScoreInfoService scoreInfoService;
+
+    /**
+     * 查询模拟考成绩列表
+     */
+    @PreAuthorize("@ss.hasPermi('score:info:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询模拟考成绩列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<ScoreInfo> list(@ModelAttribute ScoreInfo scoreInfo){
+        startPage();
+        List<ScoreInfo> list = scoreInfoService.selectScoreInfoList(scoreInfo);
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 导出模拟考成绩列表
+     */
+    @PreAuthorize("@ss.hasPermi('score:info:export')")
+    @Log(title = "模拟考成绩", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出模拟考成绩列表Excel")
+    public Response<String> export(@ModelAttribute ScoreInfo scoreInfo){
+        List<ScoreInfo> list = scoreInfoService.selectScoreInfoList(scoreInfo);
+        ExcelUtil<ScoreInfo> util = new ExcelUtil<ScoreInfo>(ScoreInfo.class);
+        return util.exportExcel(list, "info");
+    }
+
+    /**
+     * 获取模拟考成绩详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('score:info:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取模拟考成绩详细信息")
+    public Response<ScoreInfo> getInfo(
+            @ApiParam(name = "id", value = "模拟考成绩参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(scoreInfoService.getById(id));
+    }
+
+    /**
+     * 新增模拟考成绩
+     */
+    @PreAuthorize("@ss.hasPermi('score:info:add')")
+    @Log(title = "模拟考成绩", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增模拟考成绩")
+    public Response<Integer> add(@RequestBody ScoreInfo scoreInfo){
+        return toResponse(scoreInfoService.save(scoreInfo) ? 1 : 0);
+    }
+
+    /**
+     * 修改模拟考成绩
+     */
+    @PreAuthorize("@ss.hasPermi('score:info:edit')")
+    @Log(title = "模拟考成绩", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改模拟考成绩")
+    public Response<Integer> edit(@RequestBody ScoreInfo scoreInfo){
+        return toResponse(scoreInfoService.updateById(scoreInfo) ? 1 : 0);
+    }
+
+    /**
+     * 删除模拟考成绩
+     */
+    @PreAuthorize("@ss.hasPermi('score:info:remove')")
+    @Log(title = "模拟考成绩", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{ids}")
+    @ApiOperation("删除模拟考成绩")
+    public  Response<Integer> remove(
+            @ApiParam(name = "ids", value = "模拟考成绩ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return toResponse(scoreInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+    }
+}

+ 104 - 0
jkt-service/src/main/java/com/miaxis/score/domain/ScoreInfo.java

@@ -0,0 +1,104 @@
+package com.miaxis.score.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import lombok.Data;
+/**
+ * 模拟考成绩对象 score_info
+ *
+ * @author miaxis
+ * @date 2021-08-23
+ */
+@Data
+@TableName("score_info")
+@ApiModel(value = "ScoreInfo", description = "模拟考成绩对象 score_info")
+public class ScoreInfo extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    @TableField("user_id")
+    @ApiModelProperty(value = "用户ID")
+    private Long userId;
+
+    /** 考试车型 */
+    @Excel(name = "考试车型")
+    @TableField("type")
+    @ApiModelProperty(value = "考试车型")
+    private String type;
+
+    /** 考试科目 */
+    @Excel(name = "考试科目")
+    @TableField("kskm")
+    @ApiModelProperty(value = "考试科目")
+    private String kskm;
+
+    /** 分数 */
+    @Excel(name = "分数")
+    @TableField("score")
+    @ApiModelProperty(value = "分数")
+    private Long score;
+
+    public void setId(Long id){
+        this.id = id;
+    }
+
+    public Long getId(){
+        return id;
+    }
+    public void setUserId(Long userId){
+        this.userId = userId;
+    }
+
+    public Long getUserId(){
+        return userId;
+    }
+    public void setType(String type){
+        this.type = type;
+    }
+
+    public String getType(){
+        return type;
+    }
+    public void setKskm(String kskm){
+        this.kskm = kskm;
+    }
+
+    public String getKskm(){
+        return kskm;
+    }
+    public void setScore(Long score){
+        this.score = score;
+    }
+
+    public Long getScore(){
+        return score;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("userId", getUserId())
+            .append("type", getType())
+            .append("kskm", getKskm())
+            .append("score", getScore())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 22 - 0
jkt-service/src/main/java/com/miaxis/score/mapper/ScoreInfoMapper.java

@@ -0,0 +1,22 @@
+package com.miaxis.score.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.score.domain.ScoreInfo;
+
+/**
+ * 模拟考成绩Mapper接口
+ *
+ * @author miaxis
+ * @date 2021-08-23
+ */
+public interface ScoreInfoMapper extends BaseMapper<ScoreInfo> {
+    /**
+     * 查询模拟考成绩列表
+     *
+     * @param scoreInfo 模拟考成绩
+     * @return 模拟考成绩集合
+     */
+    public List<ScoreInfo> selectScoreInfoList(ScoreInfo scoreInfo);
+
+}

+ 21 - 0
jkt-service/src/main/java/com/miaxis/score/service/IScoreInfoService.java

@@ -0,0 +1,21 @@
+package com.miaxis.score.service;
+
+import java.util.List;
+import com.miaxis.score.domain.ScoreInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 模拟考成绩Service接口
+ *
+ * @author miaxis
+ * @date 2021-08-23
+ */
+public interface IScoreInfoService extends IService<ScoreInfo>{
+    /**
+     * 查询模拟考成绩列表
+     *
+     * @param scoreInfo 模拟考成绩
+     * @return 模拟考成绩集合
+     */
+    public List<ScoreInfo> selectScoreInfoList(ScoreInfo scoreInfo);
+}

+ 36 - 0
jkt-service/src/main/java/com/miaxis/score/service/impl/ScoreInfoServiceImpl.java

@@ -0,0 +1,36 @@
+package com.miaxis.score.service.impl;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.miaxis.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.commons.lang3.StringUtils;
+import com.miaxis.score.mapper.ScoreInfoMapper;
+import com.miaxis.score.domain.ScoreInfo;
+import com.miaxis.score.service.IScoreInfoService;
+
+/**
+ * 模拟考成绩Service业务层处理
+ *
+ * @author miaxis
+ * @date 2021-08-23
+ */
+@Service
+public class ScoreInfoServiceImpl extends ServiceImpl<ScoreInfoMapper, ScoreInfo> implements IScoreInfoService {
+    @Autowired
+    private ScoreInfoMapper scoreInfoMapper;
+
+    /**
+     * 查询模拟考成绩列表
+     *
+     * @param scoreInfo 模拟考成绩
+     * @return 模拟考成绩
+     */
+    @Override
+    public List<ScoreInfo> selectScoreInfoList(ScoreInfo scoreInfo){
+        return scoreInfoMapper.selectScoreInfoList(scoreInfo);
+    }
+}

+ 31 - 0
jkt-service/src/main/resources/mapper/score/ScoreInfoMapper.xml

@@ -0,0 +1,31 @@
+<?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.miaxis.score.mapper.ScoreInfoMapper">
+
+    <resultMap type="ScoreInfo" id="ScoreInfoResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="type"    column="type"    />
+        <result property="kskm"    column="kskm"    />
+        <result property="score"    column="score"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectScoreInfoVo">
+        select * from score_info
+    </sql>
+
+    <select id="selectScoreInfoList" parameterType="ScoreInfo" resultMap="ScoreInfoResult">
+        <include refid="selectScoreInfoVo"/>
+        <where>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="kskm != null  and kskm != ''"> and kskm = #{kskm}</if>
+            <if test="score != null "> and score = #{score}</if>
+        </where>
+    </select>
+
+</mapper>