package com.bonus.material.fieldMaintenance.mapper;

import com.bonus.material.fieldMaintenance.domain.FieldApplyDetails;
import com.bonus.material.fieldMaintenance.domain.FieldApplyInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FieldMaintenanceMapper {
    /**
     * 查询现场维修任务列表
     *
     * @param fieldApplyInfo 现场维修任务
     * @return 现场维修任务集合
     */
    List<FieldApplyInfo> selectFieldApplyInfoList(FieldApplyInfo fieldApplyInfo);


    List<FieldApplyDetails> selectFieldApplyDetailsList(FieldApplyDetails fieldApplyInfo);

    /**
     * 通过id获取
     *
     * @param id id
     * @return 信息
     */
    FieldApplyInfo selectFieldApplyInfoById(Integer id);

    /**
     * 新增维修任务
     *
     * @param fieldApplyInfo 信息
     * @return 是否成功
     */
    int insert(FieldApplyInfo fieldApplyInfo);

    /**
     * 删除任务
     *
     * @param id id
     * @return 条数
     */
    int deleteFieldApplyInfoById(Integer id);

    int deleteFieldApplyDetailsById(@Param("id") Long id, @Param("typeId") Long typeId);

    int insertDetails(FieldApplyDetails fieldApplyDetails);
}
