package org.jeecg.modules.workOrder.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.workOrder.entity.OperationRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.workOrder.model.WorkOrderDetailModel;

/**
 * @Description: 工单作业记录
 * @Author: jeecg-boot
 * @Date:   2025-02-20
 * @Version: V1.0
 */
public interface OperationRecordMapper extends BaseMapper<OperationRecord> {

    @Select("SELECT * FROM v_work_order_detail WHERE work_order = #{workOrderId}  ORDER BY disp_order")
    List<WorkOrderDetailModel> findByWorkOrderId(@Param("workOrderId") String workOrderId);
    @Select("SELECT * FROM bu_operation_record WHERE work_order = #{workOrderId} AND item_id = (SELECT detail_id FROM bu_regular_input WHERE id = #{regularInputId})")
    OperationRecord findByOrderAndInputId(@Param("workOrderId") String workOrderId,@Param("regularInputId") String regularInputId);

}
