package com.ruoyi.interfaces.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.interfaces.domain.MdModelStep;
import com.ruoyi.interfaces.mapper.MdModelStepMapper;
import com.ruoyi.interfaces.service.MdModelStepService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author lql
 * @date 2025-7-15
 */
@Slf4j
@Service
@Transactional
public class MdModelStepServiceImpl extends ServiceImpl<MdModelStepMapper, MdModelStep> implements MdModelStepService {

    @Override
    public boolean save(MdModelStep mdModelStep) {
        return super.save(mdModelStep);
    }

    @Override
    public boolean updateById(MdModelStep mdModelStep) {
        return super.updateById(mdModelStep);
    }

    @Override
    public List<MdModelStep> listByWorkflowIdOrderBySequence(Long workflowId) {
        QueryWrapper<MdModelStep> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("workflow_id", workflowId)
                .orderByAsc("sequence");
        return list(queryWrapper);
    }
}
