diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml index 71519a5..66626be 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/mapper/RehearsalPlanMapper.xml @@ -68,16 +68,16 @@ t2.people_num, t2.actual_start_time, t2.actual_end_time, t1.rehearsal_status FROM hzims_rehearsal_plan t1 - LEFT JOIN hzims_rehearsal_record t2 ON t1.id = t2.rehearsal_record_id + LEFT JOIN hzims_rehearsal_record t2 ON t1.id = t2.rehearsal_plan_id WHERE t1.is_deleted = 0 - - AND t1.unit = #{unit} + + AND t1.unit like #{unit} - + AND t1.scheduled_start_time >= #{startTime} - + AND t1.scheduled_end_time < #{endTime} diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java index a3db6d5..647fb1f 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/RehearsalPlanServiceImpl.java @@ -181,7 +181,7 @@ public class RehearsalPlanServiceImpl extends ServiceImpl rehearsalPlanPage(Map param, Query query) { QueryWrapper queryWrapper = new QueryWrapper<>(); String unit = String.valueOf(param.get("unit")); - String startTime = String.valueOf(param.get("startTime")); - String endTime = String.valueOf((param.get("endTime"))); - if (unit.equals("null") || unit.equals("")) { - queryWrapper.lambda().eq(RehearsalPlanEntity::getUnit, unit); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf((param.get("scheduledEndTime"))); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(RehearsalPlanEntity::getUnit, unit); } - if (startTime.equals("null") || startTime.equals("")) { + if (!startTime.equals("null") && !startTime.equals("")) { queryWrapper.lambda().ge(RehearsalPlanEntity::getScheduledStartTime, startTime); } - if (endTime.equals("null") || endTime.equals("")) { + if (!endTime.equals("null") && !endTime.equals("")) { queryWrapper.lambda().le(RehearsalPlanEntity::getScheduledEndTime, endTime); } return this.page(Condition.getPage(query), queryWrapper); diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java index 33aec9e..cba9def 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/service/impl/TrainPlanServiceImpl.java @@ -13,9 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.safeproduct.constants.SafeProductConstant; import com.hnac.hzims.safeproduct.dto.AnalysisYearDTO; -import com.hnac.hzims.safeproduct.entity.RehearsalPlanEntity; import com.hnac.hzims.safeproduct.entity.TrainPlanEntity; -import com.hnac.hzims.safeproduct.enums.RehearsalStatusEnum; import com.hnac.hzims.safeproduct.enums.TrainStatusEnum; import com.hnac.hzims.safeproduct.mapper.TrainPlanMapper; import com.hnac.hzims.safeproduct.service.ITestService; @@ -243,15 +241,15 @@ public class TrainPlanServiceImpl extends ServiceImpl trainPlanPage(Map param, Query query) { QueryWrapper queryWrapper = new QueryWrapper<>(); String unit = String.valueOf(param.get("unit")); - String startTime = String.valueOf(param.get("startTime")); - String endTime = String.valueOf((param.get("endTime"))); - if (unit.equals("null") || unit.equals("")) { - queryWrapper.lambda().eq(TrainPlanEntity::getUnit, unit); + String startTime = String.valueOf(param.get("scheduledStartTime")); + String endTime = String.valueOf((param.get("scheduledEndTime"))); + if (!unit.equals("null") && !unit.equals("")) { + queryWrapper.lambda().like(TrainPlanEntity::getUnit, unit); } - if (startTime.equals("null") || startTime.equals("")) { + if (!startTime.equals("null") && !startTime.equals("")) { queryWrapper.lambda().ge(TrainPlanEntity::getScheduledStartTime, startTime); } - if (endTime.equals("null") || endTime.equals("")) { + if (!endTime.equals("null") && !endTime.equals("")) { queryWrapper.lambda().le(TrainPlanEntity::getScheduledEndTime, endTime); } return this.page(Condition.getPage(query), queryWrapper);