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 implements StModelParamService { @Override public List getAll(Map params) { return baseDao.getAll(params); } @Override public QueryWrapper getWrapper(Map params) { String id = (String)params.get("id"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), "id", id); return wrapper; } @Override public void deleteByModelId(String modelId) { baseDao.deleteByModelId(modelId); } @Override public List getByModelId(String modelId) { QueryWrapper queryWrapper = new QueryWrapper() .eq("model_id", modelId) .orderByAsc("param_port_order") .orderByAsc("param_order"); return ConvertUtils.sourceToTarget(baseDao.selectList(queryWrapper), StModelParamDTO.class); } }