package com.cool.store.dao;

import com.cool.store.constants.CommonConstants;
import com.cool.store.dto.pre.fry.PreFryStageImagesDTO;
import com.cool.store.entity.PreFryStageChangesDO;
import com.cool.store.mapper.PreFryStageChangesMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author suzhuhong
 * @Date 2025/6/20 19:13
 * @Version 1.0
 */
@Repository
public class PreFryStageChangesDAO {

    @Resource
    PreFryStageChangesMapper preFryStageChangesMapper;

    public int batchInsert(List<PreFryStageChangesDO> records){
        if (CollectionUtils.isEmpty(records)){
            return CommonConstants.ZERO;
        }
        return preFryStageChangesMapper.batchInsert(records);
    }


    public List<PreFryStageImagesDTO> selectByRecordId( Long recordId){
        if (recordId == null){
            return new ArrayList<>();
        }
        return preFryStageChangesMapper.selectByRecordId(recordId);
    }

    public List<PreFryStageImagesDTO> selectByRecordIdList( List<Long> recordIdList){
        if (recordIdList == null){
            return new ArrayList<>();
        }
        return preFryStageChangesMapper.selectByRecordIdList(recordIdList);
    }




}
