Pārlūkot izejas kodu

新规则提交

zhangbin 1 gadu atpakaļ
vecāks
revīzija
04bdec8f4a

+ 89 - 0
jpcj-service/src/main/java/com/miaxis/question/domain/TAppExamRuleNew.java

@@ -0,0 +1,89 @@
+package com.miaxis.question.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 考试取题对象 t_app_exam_rule
+ *
+ * @author miaxis
+ * @date 2022-05-23
+ */
+@Data
+@TableName("t_app_exam_rule_new")
+@ApiModel(value = "TAppExamRuleNew", description = "考试取题对象 t_app_exam_rule_new")
+public class TAppExamRuleNew extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @TableField("id")
+    @ApiModelProperty(value = "$column.columnComment")
+    private Long id;
+
+    /** 车型 */
+    @Excel(name = "车型")
+    @TableField("gs")
+    @ApiModelProperty(value = "车型")
+    private String gs;
+
+    /** 科目 */
+    @Excel(name = "科目")
+    @TableField("kemu")
+    @ApiModelProperty(value = "科目")
+    private Integer kemu;
+
+    /** 章节ID */
+    @Excel(name = "章节ID")
+    @TableField("chapter_id")
+    @ApiModelProperty(value = "章节ID")
+    private Integer chapterId;
+
+    /** 总题库 */
+    @Excel(name = "总题库")
+    @TableField("total_count")
+    @ApiModelProperty(value = "总题库")
+    private Integer totalCount;
+
+    /** 判断题数 */
+    @Excel(name = "判断题数")
+    @TableField("judge_count")
+    @ApiModelProperty(value = "判断题数")
+    private Integer judgeCount;
+
+    /** 选择题数 */
+    @Excel(name = "选择题数")
+    @TableField("choice_count")
+    @ApiModelProperty(value = "选择题数")
+    private Integer choiceCount;
+
+    /** 多择题数 */
+    @Excel(name = "多择题数")
+    @TableField("multiple_choice_count")
+    @ApiModelProperty(value = "多择题数")
+    private Integer multipleChoiceCount;
+
+    /** 困难题数 */
+    @Excel(name = "困难题数")
+    @TableField("difficult_count")
+    @ApiModelProperty(value = "困难题数")
+    private Integer difficultCount;
+
+    /** 地区编号 */
+    @Excel(name = "地区编号")
+    @TableField("areacode")
+    @ApiModelProperty(value = "地区编号")
+    private Integer areacode;
+
+    /** 城市ID */
+    @Excel(name = "城市ID")
+    @TableField("city_id")
+    @ApiModelProperty(value = "城市ID")
+    private Integer cityId;
+
+
+}

+ 2 - 0
jpcj-service/src/main/java/com/miaxis/question/mapper/TAppExamRuleMapper.java

@@ -2,6 +2,7 @@ package com.miaxis.question.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.miaxis.question.domain.TAppExamRule;
+import com.miaxis.question.domain.TAppExamRuleNew;
 
 import java.util.List;
 
@@ -20,4 +21,5 @@ public interface TAppExamRuleMapper extends BaseMapper<TAppExamRule> {
      */
     public List<TAppExamRule> selectTAppExamRuleList(TAppExamRule tAppExamRule);
 
+    public List<TAppExamRuleNew> selectTAppExamRuleNewList(TAppExamRuleNew tAppExamRuleNew);
 }

+ 3 - 0
jpcj-service/src/main/java/com/miaxis/question/service/ITAppExamRuleService.java

@@ -2,6 +2,7 @@ package com.miaxis.question.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.miaxis.question.domain.TAppExamRule;
+import com.miaxis.question.domain.TAppExamRuleNew;
 
 import java.util.List;
 
@@ -19,4 +20,6 @@ public interface ITAppExamRuleService extends IService<TAppExamRule>{
      * @return 考试取题集合
      */
     public List<TAppExamRule> selectTAppExamRuleList(TAppExamRule tAppExamRule);
+
+    public List<TAppExamRuleNew> selectTAppExamRuleNewList(TAppExamRuleNew tAppExamRuleNew);
 }

+ 13 - 12
jpcj-service/src/main/java/com/miaxis/question/service/impl/QuestionInfoKtNewServiceImpl.java

@@ -5,6 +5,7 @@ import com.miaxis.common.exception.CustomException;
 import com.miaxis.question.domain.QuestionInfo;
 import com.miaxis.question.domain.QuestionInfoKtNew;
 import com.miaxis.question.domain.TAppExamRule;
+import com.miaxis.question.domain.TAppExamRuleNew;
 import com.miaxis.question.dto.*;
 import com.miaxis.question.mapper.QuestionInfoKtNewMapper;
 import com.miaxis.question.service.IQuestionInfoKtNewService;
@@ -64,12 +65,12 @@ public class QuestionInfoKtNewServiceImpl extends ServiceImpl<QuestionInfoKtNewM
 
         //全题库
         List<QuestionInfoKtNew> allList = new ArrayList<QuestionInfoKtNew>();
-        TAppExamRule tAppExamRule = new TAppExamRule();
-        tAppExamRule.setKemu(qt.getSubject());
-        tAppExamRule.setGs(cx);
-        tAppExamRule.setAreacode(0);
+        TAppExamRuleNew tAppExamRuleNew = new TAppExamRuleNew();
+        tAppExamRuleNew.setKemu(qt.getSubject());
+        tAppExamRuleNew.setGs(cx);
+        tAppExamRuleNew.setAreacode(0);
 
-        List<TAppExamRule> list = appExamRuleService.selectTAppExamRuleList(tAppExamRule);
+        List<TAppExamRuleNew> list = appExamRuleService.selectTAppExamRuleNewList(tAppExamRuleNew);
         if (list.size() == 0) {
             return allList;
         }
@@ -81,7 +82,7 @@ public class QuestionInfoKtNewServiceImpl extends ServiceImpl<QuestionInfoKtNewM
         do {
             shouldRetry = false;
             for (int i = 0; i < list.size(); i++) {
-                TAppExamRule er = list.get(i);
+                TAppExamRuleNew er = list.get(i);
                 int easyJudge = er.getJudgeCount(); //判断
                 int easyChoice = er.getChoiceCount(); //选择
                 int easyMultiple = er.getMultipleChoiceCount(); //多选
@@ -209,12 +210,12 @@ public class QuestionInfoKtNewServiceImpl extends ServiceImpl<QuestionInfoKtNewM
 
         //全题库
         List<QuestionInfoKtNew> allList = new ArrayList<QuestionInfoKtNew>();
-        TAppExamRule tAppExamRule = new TAppExamRule();
-        tAppExamRule.setKemu(qt.getSubject());
-        tAppExamRule.setGs(cx);
-        tAppExamRule.setAreacode(0);
+        TAppExamRuleNew tAppExamRuleNew = new TAppExamRuleNew();
+        tAppExamRuleNew.setKemu(qt.getSubject());
+        tAppExamRuleNew.setGs(cx);
+        tAppExamRuleNew.setAreacode(0);
 
-        List<TAppExamRule> list = appExamRuleService.selectTAppExamRuleList(tAppExamRule);
+        List<TAppExamRuleNew> list = appExamRuleService.selectTAppExamRuleNewList(tAppExamRuleNew);
         if (list.size() == 0) {
             return allList;
         }
@@ -226,7 +227,7 @@ public class QuestionInfoKtNewServiceImpl extends ServiceImpl<QuestionInfoKtNewM
         do {
             shouldRetry = false;
             for (int i = 0; i < list.size(); i++) {
-                TAppExamRule er = list.get(i);
+                TAppExamRuleNew er = list.get(i);
                 int judge = er.getJudgeCount(); //判断
                 int choice = er.getChoiceCount(); //选择
                 int multiple = er.getMultipleChoiceCount(); //多选

+ 14 - 0
jpcj-service/src/main/java/com/miaxis/question/service/impl/TAppExamRuleServiceImpl.java

@@ -2,6 +2,7 @@ package com.miaxis.question.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.miaxis.question.domain.TAppExamRule;
+import com.miaxis.question.domain.TAppExamRuleNew;
 import com.miaxis.question.mapper.TAppExamRuleMapper;
 import com.miaxis.question.service.ITAppExamRuleService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,4 +32,17 @@ public class TAppExamRuleServiceImpl extends ServiceImpl<TAppExamRuleMapper, TAp
     public List<TAppExamRule> selectTAppExamRuleList(TAppExamRule tAppExamRule){
         return tAppExamRuleMapper.selectTAppExamRuleList(tAppExamRule);
     }
+
+
+    /**
+     * 查询考试取题列表
+     *
+     * @param tAppExamRuleNew 考试取题
+     * @return 考试取题
+     */
+    @Override
+    public List<TAppExamRuleNew> selectTAppExamRuleNewList(TAppExamRuleNew tAppExamRuleNew){
+        return tAppExamRuleMapper.selectTAppExamRuleNewList(tAppExamRuleNew);
+    }
+
 }

+ 37 - 0
jpcj-service/src/main/resources/mapper/rule/TAppExamRuleMapper.xml

@@ -18,10 +18,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="cityId"    column="city_id"    />
     </resultMap>
 
+    <resultMap type="TAppExamRuleNew" id="TAppExamRuleNewResult">
+        <result property="id"    column="id"    />
+        <result property="gs"    column="gs"    />
+        <result property="kemu"    column="kemu"    />
+        <result property="chapterId"    column="chapter_id"    />
+        <result property="totalCount"    column="total_count"    />
+        <result property="judgeCount"    column="judge_count"    />
+        <result property="choiceCount"    column="choice_count"    />
+        <result property="multipleChoiceCount"    column="multiple_choice_count"    />
+        <result property="difficultCount"    column="difficult_count"    />
+        <result property="areacode"    column="areacode"    />
+        <result property="cityId"    column="city_id"    />
+    </resultMap>
+
+
     <sql id="selectTAppExamRuleVo">
         select * from t_app_exam_rule
     </sql>
 
+    <sql id="selectTAppExamRuleNewVo">
+        select * from t_app_exam_rule
+    </sql>
+
     <select id="selectTAppExamRuleList" parameterType="TAppExamRule" resultMap="TAppExamRuleResult">
         <include refid="selectTAppExamRuleVo"/>
         <where>
@@ -38,4 +57,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
+
+    <select id="selectTAppExamRuleNewList" parameterType="TAppExamRuleNew" resultMap="TAppExamRuleNewResult">
+        <include refid="selectTAppExamRuleNewVo"/>
+        <where>
+            <if test="gs != null  and gs != ''"> and gs = #{gs}</if>
+            <if test="kemu != null "> and kemu = #{kemu}</if>
+            <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
+            <if test="totalCount != null "> and total_count = #{totalCount}</if>
+            <if test="judgeCount != null "> and judge_count = #{judgeCount}</if>
+            <if test="choiceCount != null "> and choice_count = #{choiceCount}</if>
+            <if test="multipleChoiceCount != null "> and multiple_choice_count = #{multipleChoiceCount}</if>
+            <if test="difficultCount != null "> and difficult_count = #{difficultCount}</if>
+            <if test="areacode != null "> and areacode = #{areacode}</if>
+            <if test="cityId != null "> and city_id = #{cityId}</if>
+        </where>
+    </select>
+
+
 </mapper>