package com.iailab.module.model.mcs.sche.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.module.model.mcs.sche.dao.StScheduleParamDao; import com.iailab.module.model.mcs.sche.entity.StScheduleParamEntity; import com.iailab.module.model.mcs.sche.service.StScheduleParamService; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; import java.util.UUID; /** * @author PanZhibao * @date 2021年07月22日 10:05 */ @Service("stScheduleParamService") public class StScheduleParamServiceImpl extends BaseServiceImpl implements StScheduleParamService { @Override public List getByModelid(String modelid) { QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("modelid", modelid); queryWrapper.orderByAsc("MODELPARAMPORTORDER"); queryWrapper.orderByAsc("MODELPARAMORDER"); List list = baseDao.selectList(queryWrapper); if (CollectionUtils.isEmpty(list)) { return new ArrayList<>(); } return list; } public void saveList(List list) { QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("modelid", list.get(0).getModelid()); baseDao.delete(queryWrapper); //scheduleModelEntityFactory.removeModelInputParam(list.get(0).getModelid()); list.forEach(item -> { item.setId(UUID.randomUUID().toString()); baseDao.insert(item); }); } public void deleteBatch(String[] modelIds) { QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.in("modelid", modelIds); baseDao.delete(queryWrapper); } }