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.StModelOutDao;
|
import com.iailab.module.mcs.dto.StModelOutDTO;
|
import com.iailab.module.mcs.entity.StModelOutEntity;
|
import com.iailab.module.mcs.service.StModelOutService;
|
import org.apache.commons.lang3.StringUtils;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* @author PanZhibao
|
* @Description
|
* @createTime 2023年08月02日 13:33:00
|
*/
|
@Service
|
public class StModelOutServiceImpl extends CrudServiceImpl<StModelOutDao, StModelOutEntity, StModelOutDTO> implements StModelOutService {
|
|
@Resource
|
private StModelOutDao stModelOutDao;
|
|
@Override
|
public QueryWrapper<StModelOutEntity> getWrapper(Map<String, Object> params) {
|
String modelId = (String) params.get("model_id");
|
|
QueryWrapper<StModelOutEntity> wrapper = new QueryWrapper<>();
|
wrapper.eq(StringUtils.isNotBlank(modelId), "model_id", modelId);
|
|
return wrapper;
|
}
|
|
@Override
|
public void deleteByModelId(String modelId) {
|
Map<String, Object> params = new HashMap<>();
|
params.put("model_id", modelId);
|
baseDao.delete(this.getWrapper(params));
|
}
|
|
@Override
|
public List<StModelOutDTO> getWriteByModelId(String modelId) {
|
QueryWrapper queryWrapper = new QueryWrapper<StModelOutEntity>()
|
.eq("model_id", modelId)
|
.eq("is_write", "1")
|
.orderByAsc("sort");
|
return ConvertUtils.sourceToTarget(baseDao.selectList(queryWrapper), StModelOutDTO.class);
|
}
|
|
@Override
|
public List<StModelOutDTO> getOutPoint(String modelCode) {
|
Map<String, Object> params = new HashMap<>(1);
|
params.put("modelCode", modelCode);
|
return stModelOutDao.getOutPoint(params);
|
}
|
|
@Override
|
public List<StModelOutDTO> getAll(Map<String, Object> out) {
|
return stModelOutDao.getAll(out);
|
}
|
|
}
|