package com.aucma.dms.mapper;

import com.aucma.dms.domain.DmsPlanMaintDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 保养计划明细Mapper接口
 *
 * @author xins
 * @date 2024-01-10
 */
public interface DmsPlanMaintDetailMapper
{
    /**
     * 查询保养计划明细
     *
     * @param planMaintDetailId 保养计划明细主键
     * @return 保养计划明细
     */
    public DmsPlanMaintDetail selectDmsPlanMaintDetailByPlanMaintDetailId(@Param("planMaintDetailId") Long planMaintDetailId);

    public Long selectStationIdByCode(@Param("maintStationCode") String maintStationCode);

    /**
     * 查询保养计划明细列表
     *
     * @param dmsPlanMaintDetail 保养计划明细
     * @return 保养计划明细集合
     */
    public List<DmsPlanMaintDetail> selectDmsPlanMaintDetailList(DmsPlanMaintDetail dmsPlanMaintDetail);

    /**
     * 新增保养计划明细
     *
     * @param dmsPlanMaintDetail 保养计划明细
     * @return 结果
     */
    public int insertDmsPlanMaintDetail(DmsPlanMaintDetail dmsPlanMaintDetail);

    /**
     * 修改保养计划明细
     *
     * @param dmsPlanMaintDetail 保养计划明细
     * @return 结果
     */
    public int updateDmsPlanMaintDetail(DmsPlanMaintDetail dmsPlanMaintDetail);

    /**
     * 删除保养计划明细
     *
     * @param planMaintDetailId 保养计划明细主键
     * @return 结果
     */
    public int deleteDmsPlanMaintDetailByPlanMaintDetailId(@Param("planMaintDetailId") Long planMaintDetailId);

    /**
     * 批量删除保养计划明细
     *
     * @param planMaintDetailIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDmsPlanMaintDetailByPlanMaintDetailIds(@Param("planMaintDetailIds") Long[] planMaintDetailIds);



    /**
     * 查询保养计划明细列表,join standard和station
     *
     * @param dmsPlanMaintDetail 保养计划明细
     * @return 保养计划明细集合
     */
    public List<DmsPlanMaintDetail> selectDmsPlanMaintDetailJoinList(DmsPlanMaintDetail dmsPlanMaintDetail);

    List<DmsPlanMaintDetail> selectDmsPlanMaintDetailListByPlanMaintId(@Param("planMaintId") Long planMaintId);


    Long selectStandardId(@Param("stationId") Long stationId);

    /**
     * 查询保养计划下的所有设备ID列表
     * @param planMaintId 计划ID
     * @return 设备ID列表
     */
    List<Long> selectDeviceIdsByPlanId(@Param("planMaintId") Long planMaintId);
}
