package com.cool.store.mapper.closeup;

import com.cool.store.entity.closeup.CloseUpApplyFormDO;
import com.cool.store.request.closeup.CloseUpQueryRequest;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.Date;
import java.util.List;

public interface CloseUpApplyFormMapper extends Mapper<CloseUpApplyFormDO> {

    List<CloseUpApplyFormDO> getList(CloseUpQueryRequest request);

    /**
     * 新增或编辑，使用 ON DUPLICATE KEY UPDATE
     */
    int insertOrUpdate(CloseUpApplyFormDO record);

    /**
     * 判断是否存在时间交集的申请单（非审批拒绝状态）
     */
    int existsTimeOverlap(@Param("storeId") String storeId, @Param("planCloseDate") Date planCloseDate, @Param("planOpenDate") Date planOpenDate);
}