he2802 3 vuotta sitten
vanhempi
commit
86db024066

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/exam/ExamBeforeApplyController.java

@@ -49,7 +49,7 @@ public class ExamBeforeApplyController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<ExamBeforeApplyVo> list(ExamBeforeApplyQueryBo bo) {
         startPage();
-        List<ExamBeforeApplyVo> list = iExamBeforeApplyService.queryList(bo);
+        List<ExamBeforeApplyVo> list = iExamBeforeApplyService.getList(bo);
         return getDataTable(list);
     }
 

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyQueryBo.java

@@ -113,4 +113,7 @@ public class ExamApplyQueryBo extends BaseEntity {
 
 	@ApiModelProperty("订单商品ID")
 	private Long orderGoodsId;
+
+	@ApiModelProperty("关键词")
+	private String searchKey;
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamBeforeApplyMapper.java

@@ -1,7 +1,11 @@
 package com.zhongzheng.modules.exam.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.exam.bo.ExamBeforeApplyQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamBeforeApply;
+import com.zhongzheng.modules.exam.vo.ExamBeforeApplyVo;
+
+import java.util.List;
 
 /**
  * 前培绑定考试计划Mapper接口
@@ -10,5 +14,6 @@ import com.zhongzheng.modules.exam.domain.ExamBeforeApply;
  * @date 2022-05-19
  */
 public interface ExamBeforeApplyMapper extends BaseMapper<ExamBeforeApply> {
+    List<ExamBeforeApplyVo> getList(ExamBeforeApplyQueryBo bo);
 
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamBeforeApplyService.java

@@ -28,6 +28,8 @@ public interface IExamBeforeApplyService extends IService<ExamBeforeApply> {
 	 */
 	List<ExamBeforeApplyVo> queryList(ExamBeforeApplyQueryBo bo);
 
+	List<ExamBeforeApplyVo> getList(ExamBeforeApplyQueryBo bo);
+
 	/**
 	 * 根据新增业务对象插入前培绑定考试计划
 	 * @param bo 前培绑定考试计划新增业务对象

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamBeforeApplyServiceImpl.java

@@ -47,6 +47,11 @@ public class ExamBeforeApplyServiceImpl extends ServiceImpl<ExamBeforeApplyMappe
         return entity2Vo(this.list(lqw));
     }
 
+    @Override
+    public List<ExamBeforeApplyVo> getList(ExamBeforeApplyQueryBo bo) {
+        return baseMapper.getList(bo);
+    }
+
     /**
     * 实体类转化成视图对象
     *

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamBeforeApplyVo.java

@@ -32,4 +32,29 @@ public class ExamBeforeApplyVo {
 	@Excel(name = "考试ID")
 	@ApiModelProperty("考试ID")
 	private Long applyId;
+	@ApiModelProperty("教育名称")
+	private String educationName;
+	@ApiModelProperty("项目名称")
+	private String projectName;
+	@ApiModelProperty("业务名称")
+	private String businessName;
+	/** 考试编码 */
+	@ApiModelProperty("考试编码")
+	private String code;
+	/** 开始日期 */
+	@Excel(name = "开始日期")
+	@ApiModelProperty("开始日期")
+	private Long applyStartTime;
+	/** 结束日期 */
+	@Excel(name = "结束日期")
+	@ApiModelProperty("结束日期")
+	private Long applyEndTime;
+	/** 考试标题 */
+	@Excel(name = "考试标题")
+	@ApiModelProperty("考试标题")
+	private String applyName;
+	/** 1非补考学员 2补考学员 3都有 */
+	@Excel(name = "1非补考学员 2补考学员 ")
+	@ApiModelProperty("1非补考学员 2补考学员 ")
+	private String applyStatus;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamBeforeVo.java

@@ -96,4 +96,7 @@ public class ExamBeforeVo {
 
 	@ApiModelProperty("报考ID")
 	private Long subscribeId;
+
+	@ApiModelProperty("绑定考试数量")
+	private Integer applyNum;
 }

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml

@@ -216,6 +216,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 #{item}
             </foreach>
         </if>
+        <if test="searchKey != null and searchKey != ''">
+            and (ea.apply_name like concat('%', #{searchKey}, '%') or ea.code like concat('%', #{searchKey}, '%'))
+        </if>
         order by ea.create_time desc
     </select>
 

+ 26 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamBeforeApplyMapper.xml

@@ -12,5 +12,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="applyId" column="apply_id"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.exam.vo.ExamBeforeApplyVo" id="ExamBeforeApplyVoResult">
+        <result property="id" column="id"/>
+        <result property="beforeId" column="before_id"/>
+        <result property="applyId" column="apply_id"/>
+        <result property="applyName" column="apply_name"/>
+        <result property="code" column="code"/>
+        <result property="applyStatus" column="apply_status"/>
+        <result property="applyStartTime" column="apply_start_time"/>
+        <result property="applyEndTime" column="apply_end_time"/>
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="businessName" column="business_name"/>
+        <result property="applyName" column="apply_name"/>
+    </resultMap>
 
+    <select id="getList" parameterType="com.zhongzheng.modules.exam.bo.ExamBeforeApplyQueryBo" resultMap="ExamBeforeApplyVoResult">
+        SELECT
+            ea.*,
+            (select cet.education_name FROM course_education_type cet where ea.education_type_id= cet.id) as education_name,
+            (select cpt.project_name FROM course_project_type cpt where ea.project_id= cpt.id) as project_name,
+            (select cb.business_name FROM course_business cb where ea.business_id= cb.id) as business_name
+        FROM
+            exam_before_apply eba
+                LEFT JOIN exam_apply ea ON eba.apply_id = ea.apply_id
+        WHERE
+            eba.before_id = #{beforeId}
+    </select>
 </mapper>

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamBeforeMapper.xml

@@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="people" column="people"/>
         <result property="businessName" column="business_name"/>
         <result property="subscribeId" column="subscribe_id"/>
+        <result property="applyNum" column="apply_num"/>
     </resultMap>
 
 
@@ -159,7 +160,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             (select cet.education_name FROM course_education_type cet where eb.education_type_id= cet.id) as education_name,
             (select cpt.project_name FROM course_project_type cpt where eb.project_id= cpt.id) as project_name,
             (select cb.business_name FROM course_business cb where eb.business_id= cb.id) as business_name,
-            (SELECT COUNT(us.apply_id) FROM user_subscribe us where us.before_id = eb.before_id and us.before_status = 1) as people
+            (SELECT COUNT(us.apply_id) FROM user_subscribe us where us.before_id = eb.before_id and us.before_status = 1) as people,
+            (SELECT COUNT(eba.apply_id) FROM exam_before_apply eba where eba.before_id = eb.before_id) as apply_num
         FROM
             exam_before eb
                 LEFT JOIN exam_before_url ebu on eb.before_url=ebu.before_url_id