From 5a25a1c39acf6d4a007dbfe127bfe236f5b83c8c Mon Sep 17 00:00:00 2001 From: haown <454902499@qq.com> Date: Tue, 17 Oct 2023 16:08:37 +0800 Subject: [PATCH] =?UTF-8?q?update=3D=3D=3D>:=E4=BF=AE=E6=94=B9=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=8C=BB=E7=94=9F=E6=8E=92=E7=8F=AD=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=A1=A8=E6=9F=A5=E8=AF=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppletSchedulePlanController.java | 47 ++++++++++ .../AppletSchedulePlanController.java | 35 -------- .../dto/scheduleplan/SchedulePlanDTO.java | 18 ++++ .../impl/HealthConsultationServiceImpl.java | 2 +- .../IAppletSchedulePlanService.java | 15 ++++ .../impl/AppletSchedulePlanServiceImpl.java | 90 +++++++++++++++++++ .../SchedulePlanDetail.java | 3 + .../scheduleplan/ISchedulePlanService.java | 3 +- .../impl/SchedulePlanServiceImpl.java | 41 +++++++++ .../ISchedulePlanDetailService.java | 1 + .../vo/scheduleplan/SchedulePlanVO.java | 38 ++++++++ .../SchedulePlanDetailVO.java | 30 +++++++ .../SchedulePlanDetailMapper.xml | 25 ++++-- 13 files changed, 305 insertions(+), 43 deletions(-) create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplan/AppletSchedulePlanController.java delete mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/scheduleplan/SchedulePlanDTO.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/IAppletSchedulePlanService.java create mode 100644 xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/impl/AppletSchedulePlanServiceImpl.java create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/scheduleplan/SchedulePlanVO.java create mode 100644 xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/scheduleplandetail/SchedulePlanDetailVO.java diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplan/AppletSchedulePlanController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplan/AppletSchedulePlanController.java new file mode 100644 index 0000000..1612dea --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplan/AppletSchedulePlanController.java @@ -0,0 +1,47 @@ +package com.xinelu.applet.controller.appletscheduleplan; + +import com.xinelu.applet.dto.scheduleplan.SchedulePlanDTO; +import com.xinelu.applet.service.scheduleplan.IAppletSchedulePlanService; +import com.xinelu.applet.utils.AppointmentTimeUtil; +import com.xinelu.applet.vo.specialdisease.WeekDaysVO; +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.R; +import com.xinelu.manage.vo.scheduleplan.SchedulePlanVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import java.time.LocalDate; +import java.util.List; +import javax.annotation.Resource; +import org.apache.commons.compress.utils.Lists; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 小程序医生排班计划控制器 + * @author: haown + * @create: 2023-09-22 10:28 + **/ +@Api(tags = "小程序医生排班计划控制器") +@RestController +@RequestMapping("/nurseApplet/schedule/plan") +public class AppletSchedulePlanController extends BaseController { + + @Resource + private IAppletSchedulePlanService appletPlanService; + + @Resource + private AppointmentTimeUtil appointmentTimeUtil; + + @ApiOperation("查询医生排班明细") + @GetMapping("/getListByDoctor") + public R> getListByDoctor(SchedulePlanDTO plan) { + LocalDate nowTime = LocalDate.now(); + List weekDaysList = Lists.newArrayList(); + appointmentTimeUtil.setWeekDayAndWeekDate(nowTime, weekDaysList); + plan.setWeekdays(weekDaysList); + List list = appletPlanService.getListByDoctor(plan); + return R.ok(list); + } + +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java deleted file mode 100644 index 176c43e..0000000 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletscheduleplandetail/AppletSchedulePlanController.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.xinelu.applet.controller.appletscheduleplandetail; - -import com.xinelu.common.core.controller.BaseController; -import com.xinelu.common.core.domain.R; -import com.xinelu.manage.domain.scheduleplandetail.SchedulePlanDetail; -import com.xinelu.manage.service.scheduleplandetail.ISchedulePlanDetailService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import java.util.List; -import javax.annotation.Resource; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description: 小程序医生排班计划控制器 - * @author: haown - * @create: 2023-09-22 10:28 - **/ -@Api(tags = "小程序医生排班计划控制器") -@RestController -@RequestMapping("/nurseApplet/schedule/plandetail") -public class AppletSchedulePlanController extends BaseController { - - @Resource - private ISchedulePlanDetailService planDetailService; - - @ApiOperation("查询医生排班明细") - @GetMapping("/getList") - public R> getList(SchedulePlanDetail planDetail) { - List list = planDetailService.getList(planDetail); - return R.ok(list); - } - -} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/scheduleplan/SchedulePlanDTO.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/scheduleplan/SchedulePlanDTO.java new file mode 100644 index 0000000..fd7be76 --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/scheduleplan/SchedulePlanDTO.java @@ -0,0 +1,18 @@ +package com.xinelu.applet.dto.scheduleplan; + +import com.xinelu.applet.vo.specialdisease.WeekDaysVO; +import java.util.List; +import lombok.Data; + +/** + * @description: 小程序医生排班时间列表查询传输对象 + * @author: haown + * @create: 2023-10-17 10:51 + **/ +@Data +public class SchedulePlanDTO { + + private Long doctorId; + + private List weekdays; +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/healthconsultation/impl/HealthConsultationServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/healthconsultation/impl/HealthConsultationServiceImpl.java index be435a7..f2205c7 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/healthconsultation/impl/HealthConsultationServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/healthconsultation/impl/HealthConsultationServiceImpl.java @@ -135,7 +135,7 @@ public class HealthConsultationServiceImpl implements HealthConsultationService if (Objects.isNull(patientInfo)) { return AjaxResult.error("用户信息不存在,无法预约专家!"); } - //根据id查询当前专家是否存在 + // 根据id查询当前专家是否存在 HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(healthConsultationOrderDTO.getHospitalPersonId()); if (Objects.isNull(hospitalPersonInfo)) { return AjaxResult.error("当前专家信息不存在,请重新预约!"); diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/IAppletSchedulePlanService.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/IAppletSchedulePlanService.java new file mode 100644 index 0000000..dbc20a8 --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/IAppletSchedulePlanService.java @@ -0,0 +1,15 @@ +package com.xinelu.applet.service.scheduleplan; + +import com.xinelu.applet.dto.scheduleplan.SchedulePlanDTO; +import com.xinelu.manage.vo.scheduleplan.SchedulePlanVO; +import java.util.List; + +/** +* @author haown +* @description 针对表【schedule_plan(医生排班计划表)】的数据库操作Service +* @createDate 2023-09-21 17:16:40 +*/ +public interface IAppletSchedulePlanService { + + List getListByDoctor(SchedulePlanDTO schedulePlan); +} diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/impl/AppletSchedulePlanServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/impl/AppletSchedulePlanServiceImpl.java new file mode 100644 index 0000000..ce349e5 --- /dev/null +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/scheduleplan/impl/AppletSchedulePlanServiceImpl.java @@ -0,0 +1,90 @@ +package com.xinelu.applet.service.scheduleplan.impl; + +import com.xinelu.applet.dto.scheduleplan.SchedulePlanDTO; +import com.xinelu.applet.service.scheduleplan.IAppletSchedulePlanService; +import com.xinelu.common.utils.StringUtils; +import com.xinelu.common.utils.bean.BeanUtils; +import com.xinelu.manage.domain.scheduleplandetail.SchedulePlanDetail; +import com.xinelu.manage.mapper.scheduleplandetail.SchedulePlanDetailMapper; +import com.xinelu.manage.vo.scheduleplan.SchedulePlanVO; +import com.xinelu.manage.vo.scheduleplandetail.SchedulePlanDetailVO; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Resource; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; + +/** +* @author haown +* @description 针对表【schedule_plan(医生排班计划表)】的数据库操作Service实现 +* @createDate 2023-09-21 17:16:40 +*/ +@Service +public class AppletSchedulePlanServiceImpl implements IAppletSchedulePlanService { + + @Resource + private SchedulePlanDetailMapper planDetailMapper; + + + @Override public List getListByDoctor(SchedulePlanDTO schedulePlan) { + List retList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(schedulePlan.getWeekdays())) { + for (int i = 0; i < schedulePlan.getWeekdays().size(); i++) { + // 查询排班明细表 + SchedulePlanDetail query = new SchedulePlanDetail(); + query.setDoctorId(schedulePlan.getDoctorId()); + query.setScheduleDate(schedulePlan.getWeekdays().get(i).getHealthConsultationDate()); + query.setAfter(1); + List detailList = planDetailMapper.getList(query); + List morningList = new ArrayList<>(); + List afternoonList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(detailList)) { + detailList.forEach(detail -> { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm"); + if (StringUtils.equals("1", detail.getType())) { + morningList.add(SchedulePlanDetailVO.builder().scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter)) + .status(StringUtils.equals("0", detail.getStatus()) && StringUtils.equals("0", detail.getApplyState())).build()); + } + if (StringUtils.equals("2", detail.getType())) { + afternoonList.add(SchedulePlanDetailVO.builder().scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter)) + .status(StringUtils.equals("0", detail.getStatus()) && StringUtils.equals("0", detail.getApplyState())).build()); + } + }); + } + SchedulePlanVO schedulePlanVO = SchedulePlanVO.builder() + .scheduleDate(schedulePlan.getWeekdays().get(i).getHealthConsultationDate()) + .week(schedulePlan.getWeekdays().get(i).getWeek()) + .morningList(morningList) + .afternoonList(afternoonList).build(); + + retList.add(schedulePlanVO); + } + } + return retList; + } + + /** + * 生成计划明细 + * @param number:人数 + * @param startTime:开始时间 + * @return + */ + private List genPlanDetail(SchedulePlanDetail schedulePlanDetail, int number, LocalTime startTime, int minutesPerPatient) { + List planDetails = new ArrayList<>(); + for (int i = 0; i < number; i++) { + SchedulePlanDetail planDetail = new SchedulePlanDetail(); + BeanUtils.copyBeanProp(planDetail, schedulePlanDetail); + planDetail.setScheduleStartTime(startTime.plusMinutes((long) minutesPerPatient * i)); + planDetail.setScheduleEndTime(startTime.plusMinutes((long) minutesPerPatient * (i + 1))); + planDetail.setApplyState("0"); + planDetails.add(planDetail); + } + return planDetails; + } +} + + + + diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/scheduleplandetail/SchedulePlanDetail.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/scheduleplandetail/SchedulePlanDetail.java index 76e47d3..6008776 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/scheduleplandetail/SchedulePlanDetail.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/domain/scheduleplandetail/SchedulePlanDetail.java @@ -46,6 +46,9 @@ public class SchedulePlanDetail implements Serializable { @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") private LocalDate scheduleDate; + @ApiModelProperty("类型,1:上午,2:下午") + private String type; + /** * 开始时间 */ diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplan/ISchedulePlanService.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplan/ISchedulePlanService.java index d7c52a0..f0490fe 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplan/ISchedulePlanService.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplan/ISchedulePlanService.java @@ -1,6 +1,7 @@ package com.xinelu.manage.service.scheduleplan; import com.xinelu.manage.domain.scheduleplan.SchedulePlan; +import com.xinelu.manage.vo.scheduleplan.SchedulePlanVO; import java.util.List; /** @@ -14,5 +15,5 @@ public interface ISchedulePlanService { int save(SchedulePlan schedulePlan) throws Exception; - + List getListByDoctor(SchedulePlan schedulePlan); } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplan/impl/SchedulePlanServiceImpl.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplan/impl/SchedulePlanServiceImpl.java index b980197..2eed3e9 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplan/impl/SchedulePlanServiceImpl.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplan/impl/SchedulePlanServiceImpl.java @@ -9,12 +9,16 @@ import com.xinelu.manage.mapper.schedule.ScheduleMapper; import com.xinelu.manage.mapper.scheduleplan.SchedulePlanMapper; import com.xinelu.manage.mapper.scheduleplandetail.SchedulePlanDetailMapper; import com.xinelu.manage.service.scheduleplan.ISchedulePlanService; +import com.xinelu.manage.vo.scheduleplan.SchedulePlanVO; +import com.xinelu.manage.vo.scheduleplandetail.SchedulePlanDetailVO; import java.time.LocalDate; import java.time.LocalTime; +import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; import javax.annotation.Resource; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -71,6 +75,7 @@ public class SchedulePlanServiceImpl implements ISchedulePlanService { schedulePlanDetail.setStatus("0"); // 生成上午计划 if (schedule.getForenoonStartTime() != null && schedule.getForenoonEndTime() != null) { + schedulePlanDetail.setType("1"); // 根据时间间隔计算时间段 long forenoonMinutes = ChronoUnit.MINUTES.between(schedule.getForenoonStartTime(), schedule.getForenoonEndTime()); if (forenoonMinutes % schedulePlan.getMinutesPerPatient() == 0) { @@ -84,6 +89,7 @@ public class SchedulePlanServiceImpl implements ISchedulePlanService { // 生成下午计划 if (schedule.getAfternoonStartTime() != null && schedule.getAfternoonEndTime() != null) { // 根据时间间隔计算时间段 + schedulePlanDetail.setType("2"); long afternoonMinutes = ChronoUnit.MINUTES.between(schedule.getAfternoonStartTime(), schedule.getAfternoonEndTime()); if (afternoonMinutes % schedulePlan.getMinutesPerPatient() == 0) { int number = (int) (afternoonMinutes / schedulePlan.getMinutesPerPatient()); @@ -103,6 +109,41 @@ public class SchedulePlanServiceImpl implements ISchedulePlanService { return flag; } + @Override public List getListByDoctor(SchedulePlan schedulePlan) { + List retList = new ArrayList<>(); + LocalDate localDate = LocalDate.now(); + for (int i = 0; i < 6; i++) { + // 查询排班明细表 + SchedulePlanDetail query = new SchedulePlanDetail(); + query.setDoctorId(schedulePlan.getDoctorId()); + query.setScheduleDate(localDate.plusDays(i)); + query.setAfter(1); + List detailList = planDetailMapper.getList(query); + List morningList = new ArrayList<>(); + List afternoonList = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(detailList)) { + detailList.forEach(detail -> { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm"); + if (StringUtils.equals("1", detail.getType())) { + morningList.add(SchedulePlanDetailVO.builder().scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter)) + .status(StringUtils.equals("0", detail.getStatus()) && StringUtils.equals("0",detail.getApplyState())).build()); + } + if (StringUtils.equals("2", detail.getType())) { + afternoonList.add(SchedulePlanDetailVO.builder().scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter)) + .status(StringUtils.equals("0", detail.getStatus()) && StringUtils.equals("0",detail.getApplyState())).build()); + } + }); + } + SchedulePlanVO schedulePlanVO = SchedulePlanVO.builder() + .scheduleDate(localDate.plusDays(i)) + .morningList(morningList) + .afternoonList(afternoonList).build(); + + retList.add(schedulePlanVO); + } + return retList; + } + /** * 生成计划明细 * @param number:人数 diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplandetail/ISchedulePlanDetailService.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplandetail/ISchedulePlanDetailService.java index 7880c35..83b37a9 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplandetail/ISchedulePlanDetailService.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/service/scheduleplandetail/ISchedulePlanDetailService.java @@ -13,4 +13,5 @@ public interface ISchedulePlanDetailService { int save(SchedulePlanDetail planDetail); List getList(SchedulePlanDetail planDetail); + } diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/scheduleplan/SchedulePlanVO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/scheduleplan/SchedulePlanVO.java new file mode 100644 index 0000000..84b2d07 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/scheduleplan/SchedulePlanVO.java @@ -0,0 +1,38 @@ +package com.xinelu.manage.vo.scheduleplan; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.xinelu.manage.vo.scheduleplandetail.SchedulePlanDetailVO; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.LocalDate; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @description: 医生排班计划视图类 + * @author: haown + * @create: 2023-10-17 09:15 + **/ +@ApiModel("医生排班计划视图类") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SchedulePlanVO { + + @ApiModelProperty("排班日期") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + private LocalDate scheduleDate; + + @ApiModelProperty("周几") + private String week; + + @ApiModelProperty("上午排班计划") + public List morningList; + + @ApiModelProperty("下午排班计划") + public List afternoonList; +} diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/scheduleplandetail/SchedulePlanDetailVO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/scheduleplandetail/SchedulePlanDetailVO.java new file mode 100644 index 0000000..f19e6c4 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/scheduleplandetail/SchedulePlanDetailVO.java @@ -0,0 +1,30 @@ +package com.xinelu.manage.vo.scheduleplandetail; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @description: 医生排班计划明细视图类 + * @author: haown + * @create: 2023-10-17 09:20 + **/ +@ApiModel("医生排班计划明细视图类") +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class SchedulePlanDetailVO { + + @ApiModelProperty("预约时间段") + private String scheduleTimeSlot; + + /** + * 可预约状态(0可预约 1不可预约) + */ + @ApiModelProperty("可预约状态(0可预约 1不可预约)") + private Boolean status; +} diff --git a/xinelu-nurse-manage/src/main/resources/mapper/manage/scheduleplandetail/SchedulePlanDetailMapper.xml b/xinelu-nurse-manage/src/main/resources/mapper/manage/scheduleplandetail/SchedulePlanDetailMapper.xml index 692b2b7..12b08f3 100644 --- a/xinelu-nurse-manage/src/main/resources/mapper/manage/scheduleplandetail/SchedulePlanDetailMapper.xml +++ b/xinelu-nurse-manage/src/main/resources/mapper/manage/scheduleplandetail/SchedulePlanDetailMapper.xml @@ -10,6 +10,7 @@ + @@ -18,7 +19,7 @@ id,schedule_plan_id,doctor_id, - doctor_name,schedule_date,schedule_start_time, + doctor_name,schedule_date,`type`,schedule_start_time, schedule_end_time,status,apply_state @@ -36,10 +37,10 @@ insert into schedule_plan_detail ( id,schedule_plan_id,doctor_id - ,doctor_name,schedule_date,schedule_start_time + ,doctor_name,schedule_date,`type`,schedule_start_time ,schedule_end_time,status,apply_state) values (#{id,jdbcType=BIGINT},#{schedulePlanId,jdbcType=BIGINT},#{doctorId,jdbcType=BIGINT} - ,#{doctorName,jdbcType=VARCHAR},#{scheduleDate,jdbcType=DATE},#{scheduleStartTime,jdbcType=TIME} + ,#{doctorName,jdbcType=VARCHAR},#{scheduleDate,jdbcType=DATE},#{type,jdbcType=CHAR},#{scheduleStartTime,jdbcType=TIME} ,#{scheduleEndTime,jdbcType=TIME},#{status,jdbcType=CHAR},#{applyState,jdbcType=VARCHAR}) @@ -50,6 +51,7 @@ doctor_id, doctor_name, schedule_date, + type, schedule_start_time, schedule_end_time, status, @@ -61,7 +63,8 @@ #{doctorId,jdbcType=BIGINT}, #{doctorName,jdbcType=VARCHAR}, #{scheduleDate,jdbcType=DATE}, - #{scheduleStartTime,jdbcType=TIME}, + #{type,jdbcType=CHAR}, + #{scheduleStartTime,jdbcType=TIME}, #{scheduleEndTime,jdbcType=TIME}, #{status,jdbcType=CHAR}, #{applyState,jdbcType=VARCHAR}, @@ -82,6 +85,9 @@ schedule_date = #{scheduleDate,jdbcType=DATE}, + + `type` = #{type,jdbcType=CHAR}, + schedule_start_time = #{scheduleStartTime,jdbcType=TIME}, @@ -104,6 +110,7 @@ doctor_id = #{doctorId,jdbcType=BIGINT}, doctor_name = #{doctorName,jdbcType=VARCHAR}, schedule_date = #{scheduleDate,jdbcType=DATE}, + type = #{type,jdbcType=CHAR}, schedule_start_time = #{scheduleStartTime,jdbcType=TIME}, schedule_end_time = #{scheduleEndTime,jdbcType=TIME}, status = #{status,jdbcType=CHAR}, @@ -113,11 +120,11 @@ insert into schedule_plan_detail (schedule_plan_id,doctor_id - ,doctor_name,schedule_date,schedule_start_time + ,doctor_name,schedule_date,type,schedule_start_time ,schedule_end_time,status,apply_state) values (#{item.schedulePlanId},#{item.doctorId} - ,#{item.doctorName},#{item.scheduleDate},#{item.scheduleStartTime} + ,#{item.doctorName},#{item.scheduleDate},#{item.type},#{item.scheduleStartTime} ,#{item.scheduleEndTime},#{item.status},#{item.applyState}) @@ -136,6 +143,9 @@ and schedule_date = #{scheduleDate,jdbcType=DATE} + + and `type` = #{type,jdbcType=CHAR} + and DATE_FORMAT(schedule_start_time, '%H%i') <= DATE_FORMAT(#{scheduleStartTime}, '%H%i') @@ -145,6 +155,9 @@ and DATE_FORMAT(schedule_end_time, '%H%i') < DATE_FORMAT(now(), '%H%i') + + status = #{status,jdbcType=CHAR} +