package com.iailab.module.mcs.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.iailab.framework.common.service.impl.CrudServiceImpl;
|
import com.iailab.framework.common.util.object.ConvertUtils;
|
import com.iailab.module.mcs.dao.StModelParamDao;
|
import com.iailab.module.mcs.dto.StModelParamDTO;
|
import com.iailab.module.mcs.entity.StModelParamEntity;
|
import com.iailab.module.mcs.service.StModelParamService;
|
import org.apache.commons.lang3.StringUtils;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
*
|
*
|
* @author lirm 1343021927@qq.com
|
* @since 1.0.0 2023-05-10
|
*/
|
@Service
|
public class StModelParamServiceImpl extends CrudServiceImpl<StModelParamDao, StModelParamEntity, StModelParamDTO>
|
implements StModelParamService {
|
|
|
@Override
|
public List<StModelParamDTO> getAll(Map<String, Object> params) {
|
return baseDao.getAll(params);
|
}
|
@Override
|
public QueryWrapper<StModelParamEntity> getWrapper(Map<String, Object> params) {
|
String id = (String)params.get("id");
|
|
QueryWrapper<StModelParamEntity> wrapper = new QueryWrapper<>();
|
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
|
|
return wrapper;
|
}
|
@Override
|
public void deleteByModelId(String modelId) {
|
baseDao.deleteByModelId(modelId);
|
}
|
|
@Override
|
public List<StModelParamDTO> getByModelId(String modelId) {
|
QueryWrapper queryWrapper = new QueryWrapper<StModelParamEntity>()
|
.eq("model_id", modelId)
|
.orderByAsc("param_port_order")
|
.orderByAsc("param_order");
|
return ConvertUtils.sourceToTarget(baseDao.selectList(queryWrapper), StModelParamDTO.class);
|
}
|
|
}
|