|
|
|
@ -5,12 +5,10 @@ import com.alibaba.excel.ExcelWriter;
|
|
|
|
|
import com.alibaba.excel.converters.longconverter.LongStringConverter; |
|
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet; |
|
|
|
|
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
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.TrainPlanEntity; |
|
|
|
@ -265,21 +263,8 @@ public class TrainPlanServiceImpl extends ServiceImpl<TrainPlanMapper, TrainPlan
|
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public IPage<TrainPlanEntity> trainPlanPage(Map<String, Object> param, Query query) { |
|
|
|
|
QueryWrapper<TrainPlanEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
String unit = String.valueOf(param.get("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("")) { |
|
|
|
|
queryWrapper.lambda().ge(TrainPlanEntity::getScheduledStartTime, startTime); |
|
|
|
|
} |
|
|
|
|
if (!endTime.equals("null") && !endTime.equals("")) { |
|
|
|
|
queryWrapper.lambda().le(TrainPlanEntity::getScheduledEndTime, endTime); |
|
|
|
|
} |
|
|
|
|
queryWrapper.lambda().orderByDesc(TrainPlanEntity::getCreateTime); |
|
|
|
|
return this.page(Condition.getPage(query), queryWrapper); |
|
|
|
|
IPage<TrainPlanEntity> page = new Page<>(query.getCurrent(), query.getSize()); |
|
|
|
|
return baseMapper.trainPlanPage(page, param); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -290,17 +275,6 @@ public class TrainPlanServiceImpl extends ServiceImpl<TrainPlanMapper, TrainPlan
|
|
|
|
|
* @return 培训计划列表 |
|
|
|
|
*/ |
|
|
|
|
public List<TrainPlanEntity> getTrainPlanByUnitAndDate(String unit, String startTime, String endTime) { |
|
|
|
|
LambdaQueryWrapper<TrainPlanEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
if (!unit.equals("null")) { |
|
|
|
|
queryWrapper.eq(TrainPlanEntity::getUnit, unit); |
|
|
|
|
} |
|
|
|
|
if (!startTime.equals("null")) { |
|
|
|
|
queryWrapper.ge(TrainPlanEntity::getScheduledStartTime, startTime); |
|
|
|
|
} |
|
|
|
|
if (!endTime.equals("null")) { |
|
|
|
|
queryWrapper.lt(TrainPlanEntity::getScheduledEndTime, endTime); |
|
|
|
|
} |
|
|
|
|
queryWrapper.orderByDesc(TrainPlanEntity::getCreateTime); |
|
|
|
|
return this.list(queryWrapper); |
|
|
|
|
return baseMapper.selectListByUnitAndDate(unit, startTime, endTime); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|