change 3 سال پیش
والد
کامیت
8e87d003e0

+ 4 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseBusinessController.java

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -41,6 +42,9 @@ public class CourseBusinessController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CourseBusinessVo> list(CourseBusinessQueryBo bo) {
         startPage();
+        List<Integer> status = new ArrayList<>();
+        status.add(1);
+        bo.setStatus(status);
         List<CourseBusinessVo> list = iCourseBusinessService.queryList(bo);
         return getDataTable(list);
     }

+ 4 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseEducationTypeController.java

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -41,6 +42,9 @@ public class CourseEducationTypeController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CourseEducationTypeVo> list(CourseEducationTypeQueryBo bo) {
         startPage();
+        List<Integer> status = new ArrayList<>();
+        status.add(1);
+        bo.setStatus(status);
         List<CourseEducationTypeVo> list = iCourseEducationTypeService.queryList(bo);
         return getDataTable(list);
     }

+ 4 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseProjectTypeController.java

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -41,6 +42,9 @@ public class CourseProjectTypeController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CourseProjectTypeVo> list(CourseProjectTypeQueryBo bo) {
         startPage();
+        List<Integer> status = new ArrayList<>();
+        status.add(1);
+        bo.setStatus(status);
         List<CourseProjectTypeVo> list = iCourseProjectTypeService.queryList(bo);
         return getDataTable(list);
     }

+ 4 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseSubjectController.java

@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -41,6 +42,9 @@ public class CourseSubjectController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CourseSubjectVo> list(CourseSubjectQueryBo bo) {
         startPage();
+        List<Integer> status = new ArrayList<>();
+        status.add(1);
+        bo.setStatus(status);
         List<CourseSubjectVo> list = iCourseSubjectService.queryList(bo);
         return getDataTable(list);
     }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyMapper.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.exam.mapper;
 
+import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamApply;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -30,4 +31,6 @@ public interface ExamApplyMapper extends BaseMapper<ExamApply> {
     List<ExamApplySiteTimeVo> addressTimeExam(Long id);
 
     ExamApplyVo selectByApply(Long applyId);
+
+    List<ExamApplyVo> queryExam(ExamApplyQueryBo bo);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamBeforeMapper.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.exam.mapper;
 
+import com.zhongzheng.modules.exam.bo.ExamBeforeQueryBo;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamBefore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -21,4 +22,6 @@ public interface ExamBeforeMapper extends BaseMapper<ExamBefore> {
     List<ExamNumberGoodsVo> examNumberGoodsVos(Long beforeId);
 
     ExamBeforeVo selectByBefore(Long beforeId);
+
+    List<ExamBeforeVo> queryBefore(ExamBeforeQueryBo bo);
 }

+ 2 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -59,15 +59,8 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
 
     @Override
     public List<ExamApplyVo> queryList(ExamApplyQueryBo bo) {
-        LambdaQueryWrapper<ExamApply> lqw = Wrappers.lambdaQuery();
-        lqw.eq(StrUtil.isNotBlank(bo.getApplyUrl()), ExamApply::getApplyUrl, bo.getApplyUrl());
-        lqw.like(StrUtil.isNotBlank(bo.getApplyName()), ExamApply::getApplyName, bo.getApplyName());
-        lqw.eq(StrUtil.isNotBlank(bo.getApplyIntroduce()), ExamApply::getApplyIntroduce, bo.getApplyIntroduce());
-        lqw.eq(bo.getApplyStatus() != null, ExamApply::getApplyStatus, bo.getApplyStatus());
-        lqw.eq(bo.getApplyStartTime() != null, ExamApply::getApplyStartTime, bo.getApplyStartTime());
-        lqw.eq(bo.getApplyEndTime() != null, ExamApply::getApplyEndTime, bo.getApplyEndTime());
-        lqw.in(bo.getStatus() != null, ExamApply::getStatus, bo.getStatus());
-        return entity2Vo(this.list(lqw));
+
+        return baseMapper.queryExam(bo);
     }
 
     /**

+ 1 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamBeforeServiceImpl.java

@@ -40,15 +40,7 @@ public class ExamBeforeServiceImpl extends ServiceImpl<ExamBeforeMapper, ExamBef
 
     @Override
     public List<ExamBeforeVo> queryList(ExamBeforeQueryBo bo) {
-        LambdaQueryWrapper<ExamBefore> lqw = Wrappers.lambdaQuery();
-        lqw.eq(StrUtil.isNotBlank(bo.getCode()), ExamBefore::getCode, bo.getCode());
-        lqw.like(StrUtil.isNotBlank(bo.getBeforeName()), ExamBefore::getBeforeName, bo.getBeforeName());
-        lqw.eq(bo.getBeforeStartTime() != null, ExamBefore::getBeforeStartTime, bo.getBeforeStartTime());
-        lqw.eq(bo.getBeforeEndTime() != null, ExamBefore::getBeforeEndTime, bo.getBeforeEndTime());
-        lqw.eq(bo.getBeforeStatus() != null, ExamBefore::getBeforeStatus, bo.getBeforeStatus());
-        lqw.eq(bo.getBeforeUrl() != null, ExamBefore::getBeforeUrl, bo.getBeforeUrl());
-        lqw.in(bo.getStatus() != null, ExamBefore::getStatus, bo.getStatus());
-        return entity2Vo(this.list(lqw));
+        return baseMapper.queryBefore(bo);
     }
 
     /**

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyVo.java

@@ -75,6 +75,12 @@ public class ExamApplyVo {
 	@ApiModelProperty("业务名称")
 	private String businessName;
 
+	@ApiModelProperty("取消人次")
+	private Long cancelPeople;
+
+	@ApiModelProperty("正常人次")
+	private Long people;
+
 
 	/** 考试编码 */
 	@ApiModelProperty("考试编码")

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

@@ -85,6 +85,9 @@ public class ExamBeforeVo {
 	@ApiModelProperty("业务名称")
 	private String businessName;
 
+	@ApiModelProperty("正常人次")
+	private Long people;
+
 	@ApiModelProperty("商品")
 	private List<ExamNumberGoodsVo> examNumberGoods;
 

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

@@ -29,6 +29,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="educationName" column="education_name"/>
         <result property="projectName" column="project_name"/>
         <result property="businessName" column="business_name"/>
+        <result property="cancelPeople" column="cancel_people"/>
+        <result property="people" column="people"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
@@ -143,4 +145,23 @@ and (SELECT COUNT(eay.apply_id) FROM exam_apply eay LEFT JOIN exam_apply_goods e
         where 1=1
           and ea.apply_id = #{applyId}
     </select>
+
+    <select id="queryExam" parameterType="com.zhongzheng.modules.exam.bo.ExamApplyQueryBo" resultMap="ExamApplyVo">
+        SELECT
+        * ,
+        (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,
+        (SELECT COUNT(us.apply_id) FROM user_subscribe us where us.apply_id = ea.apply_id and us.subscribe_status = 1) as people,
+        (SELECT COUNT(us.apply_id) FROM user_subscribe us where us.apply_id = ea.apply_id and us.subscribe_status = 2) as cancel_people
+        FROM
+        exam_apply ea
+        where 1=1
+        <if test="status != null and status.size()!=0 ">
+            AND ea.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+    </select>
 </mapper>

+ 15 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamBeforeMapper.xml

@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="url" column="url"/>
         <result property="educationName" column="education_name"/>
         <result property="projectName" column="project_name"/>
+        <result property="people" column="people"/>
         <result property="businessName" column="business_name"/>
     </resultMap>
 
@@ -99,4 +100,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where 1=1
           and eb.before_id = #{beforeId}
     </select>
+
+    <select id="queryBefore" parameterType="com.zhongzheng.modules.exam.bo.ExamBeforeQueryBo" resultMap="ExamBeforeVo">
+        SELECT
+            *,
+            (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.apply_id = ea.apply_id and us.before_status = 1) as people
+        FROM
+            exam_before eb
+                LEFT JOIN exam_before_url ebu on eb.before_url=ebu.before_url_id
+        where 1=1
+          and eb.before_id = #{beforeId}
+    </select>
 </mapper>