小么熊🐻 2 anni fa
parent
commit
6369683516

+ 32 - 4
jsjp-admin/src/main/java/com/miaxis/app/controller/tms/TmsStudentInfoController.java

@@ -5,10 +5,7 @@ import com.miaxis.common.constant.Constants;
 import com.miaxis.common.core.controller.BaseController;
 import com.miaxis.common.core.domain.Response;
 import com.miaxis.common.core.page.ResponsePageInfo;
-import com.miaxis.tms.dto.TmsStudentInfoDTO;
-import com.miaxis.tms.dto.TmsStudentInfoIdDTO;
-import com.miaxis.tms.dto.TmsStudentInfoQrDTO;
-import com.miaxis.tms.dto.TmsStudentInfoTempDTO;
+import com.miaxis.tms.dto.*;
 import com.miaxis.tms.service.ITmsStudentInfoService;
 import com.miaxis.tms.vo.*;
 import io.swagger.annotations.Api;
@@ -119,6 +116,37 @@ public class TmsStudentInfoController extends BaseController {
         return Response.success(studentInfoService.upStuAppCoachIdById(studentInfoQrDTO));
     }
 
+
+
+
+    /**
+     * 根据驾校ID查询当日报名情况
+     */
+    @GetMapping("/getDayStuCountBySchoolId")
+    @ApiOperation("根据ID获取学员员详细信息")
+    public Response<TmsBmCountVo> getDayStuCountBySchoolId(TmsBmCountDTO bmCountDTO) {
+        return Response.success(studentInfoService.getDayStuCountBySchoolId(bmCountDTO));
+    }
+
+
+    /**
+     * 根据驾校ID查询当月报名情况
+     */
+    @GetMapping("/getMonthStuCountBySchoolId")
+    @ApiOperation("根据驾校ID查询当月报名情况")
+    public Response<TmsBmCountVo> getMonthStuCountBySchoolId(TmsBmCountDTO bmCountDTO) {
+        return Response.success(studentInfoService.getMonthStuCountBySchoolId(bmCountDTO));
+    }
+
+    /**
+     * 根据驾校ID查询当年报名情况
+     */
+    @GetMapping("/getYearStuCountBySchoolId")
+    @ApiOperation("根据驾校ID查询当年报名情况")
+    public Response<TmsBmCountVo> getYearStuCountBySchoolId(TmsBmCountDTO bmCountDTO) {
+        return Response.success(studentInfoService.getYearStuCountBySchoolId(bmCountDTO));
+    }
+
 }
 
 

+ 28 - 0
jsjp-service/src/main/java/com/miaxis/tms/dto/TmsBmCountDTO.java

@@ -0,0 +1,28 @@
+package com.miaxis.tms.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value = "TmsBmCountDTO", description = "查询报名人数DTO")
+public class TmsBmCountDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @ApiModelProperty(value = "驾校ID")
+    private Long schoolId;
+
+    @ApiModelProperty(value = "城市编号")
+    private String city;
+
+    @ApiModelProperty(value = "查询是日时为天,月和年的单时为月, “-1”上个月,“-12”去年")
+    private Integer vDay;
+
+}

+ 7 - 4
jsjp-service/src/main/java/com/miaxis/tms/mapper/TmsStudentInfoMapper.java

@@ -1,10 +1,7 @@
 package com.miaxis.tms.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.miaxis.tms.dto.TmsStudentInfoDTO;
-import com.miaxis.tms.dto.TmsStudentInfoIdDTO;
-import com.miaxis.tms.dto.TmsStudentInfoQrDTO;
-import com.miaxis.tms.dto.TmsStudentInfoTempDTO;
+import com.miaxis.tms.dto.*;
 import com.miaxis.tms.vo.*;
 
 import java.util.List;
@@ -31,4 +28,10 @@ public interface TmsStudentInfoMapper extends BaseMapper<TmsStudentInfoVo> {
     List<TmsSignVo> getTmsSignListByStuId(TmsStudentInfoIdDTO studentInfoIdDTO);
 
     List<TmsStudentInfoTempVo> getTmsStudentInfoTempList(TmsStudentInfoTempDTO studentInfoDto);
+
+    TmsBmCountVo getDayStuCountBySchoolId(TmsBmCountDTO bmCountDTO);
+
+    TmsBmCountVo getMonthStuCountBySchoolId(TmsBmCountDTO bmCountDTO);
+
+    TmsBmCountVo getYearStuCountBySchoolId(TmsBmCountDTO bmCountDTO);
 }

+ 17 - 4
jsjp-service/src/main/java/com/miaxis/tms/service/ITmsStudentInfoService.java

@@ -1,10 +1,7 @@
 package com.miaxis.tms.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.miaxis.tms.dto.TmsStudentInfoDTO;
-import com.miaxis.tms.dto.TmsStudentInfoIdDTO;
-import com.miaxis.tms.dto.TmsStudentInfoQrDTO;
-import com.miaxis.tms.dto.TmsStudentInfoTempDTO;
+import com.miaxis.tms.dto.*;
 import com.miaxis.tms.vo.*;
 
 import java.util.List;
@@ -33,4 +30,20 @@ public interface ITmsStudentInfoService extends IService<TmsStudentInfoVo> {
 
     List<TmsSignVo> getTmsSignListByStuId(TmsStudentInfoIdDTO studentInfoIdDTO);
 
+    TmsBmCountVo getDayStuCountBySchoolId(TmsBmCountDTO bmCountDTO);
+
+    TmsBmCountVo getMonthStuCountBySchoolId(TmsBmCountDTO bmCountDTO);
+
+    TmsBmCountVo getYearStuCountBySchoolId(TmsBmCountDTO bmCountDTO);
+
+
+
+
+
+
+
+
+
+
+
 }

+ 16 - 4
jsjp-service/src/main/java/com/miaxis/tms/service/impl/TmsStudentInfoServiceImpl.java

@@ -3,10 +3,7 @@ package com.miaxis.tms.service.impl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.miaxis.common.annotation.DataSource;
 import com.miaxis.common.enums.DataSourceTypeEnum;
-import com.miaxis.tms.dto.TmsStudentInfoDTO;
-import com.miaxis.tms.dto.TmsStudentInfoIdDTO;
-import com.miaxis.tms.dto.TmsStudentInfoQrDTO;
-import com.miaxis.tms.dto.TmsStudentInfoTempDTO;
+import com.miaxis.tms.dto.*;
 import com.miaxis.tms.mapper.TmsStudentInfoMapper;
 import com.miaxis.tms.service.ITmsStudentInfoService;
 import com.miaxis.tms.vo.*;
@@ -64,5 +61,20 @@ public class TmsStudentInfoServiceImpl extends ServiceImpl<TmsStudentInfoMapper,
         return mapper.getTmsSignListByStuId(studentInfoIdDTO);
     }
 
+    @Override
+    public TmsBmCountVo getDayStuCountBySchoolId(TmsBmCountDTO bmCountDTO) {
+        return mapper.getDayStuCountBySchoolId(bmCountDTO);
+    }
+
+    @Override
+    public TmsBmCountVo getMonthStuCountBySchoolId(TmsBmCountDTO bmCountDTO) {
+        return mapper.getMonthStuCountBySchoolId(bmCountDTO);
+    }
+
+    @Override
+    public TmsBmCountVo getYearStuCountBySchoolId(TmsBmCountDTO bmCountDTO) {
+        return mapper.getYearStuCountBySchoolId(bmCountDTO);
+    }
+
 
 }

+ 35 - 0
jsjp-service/src/main/java/com/miaxis/tms/vo/TmsBmCountVo.java

@@ -0,0 +1,35 @@
+package com.miaxis.tms.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 用户对象 user_info
+ *
+ * @author miaxis
+ * @date 2021-01-11
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value = "TmsLogFaceVo", description = "照片比对VO")
+public class TmsBmCountVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @ApiModelProperty(value = "时间")
+    private String dateTime;
+
+    @ApiModelProperty(value = "报名人数")
+    private Integer stuCount;
+
+
+
+
+}

+ 38 - 1
jsjp-service/src/main/resources/mapper/tms/TmsStudentInfoMapper.xml

@@ -108,7 +108,7 @@
             <if test="coachId!=null" > AND t1.TSO_COACHID = #{coachId,jdbcType=NUMERIC } </if>
             <if test="appCoachId!=null" > AND t1.TSO_APP_COACH_ID = #{appCoachId,jdbcType=NUMERIC } </if>
             <if test="field != null  and field != ''"> AND (t1.Tso_Name like '%' || #{field,jdbcType=VARCHAR} || '%' or t1.TSO_IDCARD like '%' || #{field,jdbcType=VARCHAR} || '%' or t1.Tso_Phone like '%' || #{field,jdbcType=VARCHAR} || '%') </if>
-            <if test="schoolId != null "> and t1.TSO_SCHOOL_ID = #{schoolId,,jdbcType=NUMERIC} </if>
+            <if test="schoolId != null "> and t1.TSO_SCHOOL_ID = #{schoolId,jdbcType=NUMERIC} </if>
             <if test="state != null  and state != ''"> AND t1.TSO_STATE = #{state,jdbcType=VARCHAR }</if>
         </where>
         ORDER BY t1.TSO_ID desc
@@ -202,6 +202,43 @@
 
 
 
+    <select id="getDayStuCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo"  >
+        select trunc(t.tso_applydate) as dateTime,count(1) as stuNum
+        from tms_student_info@tms${city} t
+        where 1=1
+          and t.tso_school_id = #{schoolId}
+          and trunc(t.tso_applydate) = trunc(sysdate #{vDay})
+        group by trunc(t.tso_applydate)
+    </select>
+
+
+    <select id="getMonthStuCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo" >
+        select to_char(tso_applydate, 'yyyy-MM') as dateTime,count(1) as stuNum
+        from tms_student_info@tms${city} t
+        where 1=1
+          and t.tso_school_id = #{schoolId}
+          and trunc(t.tso_applydate,'MONTH') = ADD_MONTHS(TRUNC(SYSDATE, 'MONTH'), #{vDay})
+        group by to_char(tso_applydate, 'yyyy-MM')
+        order by to_char(tso_applydate, 'yyyy-MM')
+    </select>
+
+
+    <select id="getYearStuCountBySchoolId" parameterType="com.miaxis.tms.dto.TmsStudentInfoIdDTO" resultType="com.miaxis.tms.vo.TmsBmCountVo" >
+        select to_char(tso_applydate, 'yyyy') as dateTime,count(1) as stuNum
+        from tms_student_info@tms${city} t
+        where 1=1
+          and t.tso_school_id = #{schoolId}
+          and trunc(t.tso_applydate,'MONTH') = ADD_MONTHS(TRUNC(SYSDATE, 'MONTH'), #{vDay})
+        group by to_char(tso_applydate, 'yyyy')
+        order by to_char(tso_applydate, 'yyyy')
+    </select>
+
+
+
+
+
+
+
     <update id="upStuAppCoachIdById" parameterType="com.miaxis.tms.dto.TmsStudentInfoQrDTO">
         update TMS_STUDENT_INFO@tms${city} set tso_app_coach_id = #{appCoachId} where tso_id = #{id}
     </update>