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 implements StModelOutService { @Resource private StModelOutDao stModelOutDao; @Override public QueryWrapper getWrapper(Map params) { String modelId = (String) params.get("model_id"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(modelId), "model_id", modelId); return wrapper; } @Override public void deleteByModelId(String modelId) { Map params = new HashMap<>(); params.put("model_id", modelId); baseDao.delete(this.getWrapper(params)); } @Override public List getWriteByModelId(String modelId) { QueryWrapper queryWrapper = new QueryWrapper() .eq("model_id", modelId) .eq("is_write", "1") .orderByAsc("sort"); return ConvertUtils.sourceToTarget(baseDao.selectList(queryWrapper), StModelOutDTO.class); } @Override public List getOutPoint(String modelCode) { Map params = new HashMap<>(1); params.put("modelCode", modelCode); return stModelOutDao.getOutPoint(params); } @Override public List getAll(Map out) { return stModelOutDao.getAll(out); } }