package com.rongwei.bscommon.sys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rongwei.bsentity.domain.ApsProcessOperationBackupDo;
import com.rongwei.bsentity.vo.CheckScheduleVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Entity com.rongwei.training.domain.ApsProcessOperationBackup
 */
public interface ApsProcessOperationBackupDao extends BaseMapper<ApsProcessOperationBackupDo> {
    void processOperationBackup(@Param("processOperationIdList") List<String> processOperationIdList,
                                @Param("userId") String userId,
                                @Param("userName") String userName);

    void deletedByBlankId(@Param("blankIds") List<String> blankIds,@Param("factoryId") String factoryId);

    void processOperationCopy(@Param("userId") String userId,
                              @Param("userName") String userName);

    @Select("select count(ID) as count,BACKUPUSERID as backUpUserId,BACKUPUSER as backUpUserName from aps_process_operation_backup where DELETED = 0 AND BLANKID in (select ID from aps_blank_order where DELETED ='0' and  PRODUCTIONORDERID = #{orderId} ) GROUP BY BACKUPUSERID,BACKUPUSER limit 1")
    CheckScheduleVo selectBackByOrderId(@Param("orderId") String orderId);

    CheckScheduleVo selectBackByBlankIdList(@Param("blankIdList") List<String> blankIdList);
}




