package shop.alien.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import shop.alien.entity.store.ActivityPeriod;
import shop.alien.entity.store.vo.ActivityPeriodVo;
import java.util.List;
@Mapper
public interface ActivityPeriodMapper extends BaseMapper<ActivityPeriod> {
    @Select("select asic.id, asic.activity_name, ap.start_time, ap.end_time from activity_period ap " +
            "left join activity_sign_in_config asic on asic.id = ap.activity_id " +
            "where asic.delete_flag = 0 and ap.delete_flag = 0 and ap.start_time <= #{endTime} and ap.end_time >= #{startTime}")
    List<ActivityPeriodVo> getActivityPeriodList(@Param("startTime") String startTime, @Param("endTime") String endTime);
    @Select("select ap.id,ap.activity_id,asic.activity_name,asic.plan_config_type from activity_period ap " +
            "left join activity_sign_in_config asic on asic.id = ap.activity_id " +
            "where ap.delete_flag = 0 and asic.delete_flag = 0 and asic.status = 1 and ap.start_time <= CURDATE() and ap.end_time >= CURDATE()")
    List<ActivityPeriodVo> getCurrentActivityPeriodList();
}