package com.hdkj.lt.bf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hdkj.lt.base.annotations.MybatisLikeInterceptorMethod;
import com.hdkj.lt.bf.entity.vo.FhzgFaultPowerCutVO;
import com.hdkj.lt.core.bizms.modle.po.fault.FaultPowerCut;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 故障停电转供信息表 Mapper 接口
 * </p>
 *
 * @author luorui
 * @since 2025-05-29
 */
@Mapper
public interface FaultPowerCutMapper extends BaseMapper<FaultPowerCut> {

    @MybatisLikeInterceptorMethod
    List<FhzgFaultPowerCutVO> selectSchemeList(Page<FhzgFaultPowerCutVO> page, @Param("params")FaultPowerCut params );

    @MybatisLikeInterceptorMethod
    List<FhzgFaultPowerCutVO> selectSchemeList2(Page<FhzgFaultPowerCutVO> page, @Param("params")FaultPowerCut params );

    @Update("update fhzg_fault_power_cut t set t.scheme_state=#{obj.schemeState} where t.id = #{obj.id}")
    Integer updateSchemeState(@Param("obj") FaultPowerCut obj);

    @Select("select * from fhzg_fault_power_cut where id=#{faultId}  ")
    FhzgFaultPowerCutVO getSchemeByFaultId(Long faultId);
}
