package com.zioinfo.signage.mapper;

import com.zioinfo.signage.domain.SignDeployVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface SignDeployMapper {
    List<SignDeployVo> findAll(@Param("tenantCode") String tenantCode,
                          @Param("status") String status,
                          @Param("keyword") String keyword);
    SignDeployVo findById(@Param("id") Long id);
    /** 매장코드 최신 PENDING/SENT 배포 1건 (30초 폴링 대상). */
    SignDeployVo findLatestForStore(@Param("storeCode") String storeCode);
    /** 폴링 확인 시각 갱신(status 미변경). */
    int markPolled(@Param("id") Long id);
    /** 배포 적용 완료 처리(status=APPLIED, deployed_at). */
    int markApplied(@Param("id") Long id);
    int insert(SignDeployVo vo);
    int update(SignDeployVo vo);
    int delete(@Param("id") Long id);
    long countAll(@Param("tenantCode") String tenantCode);
}
