package com.railway.business.safetool.mapper;

import com.github.pagehelper.Page;
import com.railway.business.safetool.domain.SecExperiment;
import com.railway.business.safetool.domain.vo.SecExpAddParmVo;
import com.railway.business.safetool.domain.vo.SecExpInfoVo;
import com.railway.business.safetool.domain.vo.SecExpListParmVo;
import com.railway.business.safetool.domain.vo.SecExpListVo;
import com.railway.business.safetool.domain.vo.SecExpToolsVo;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
* 送检记录表
* @author lijie
* @date 2021/12/25
*/
@Mapper
@Repository
public interface SecExperimentMapper {

    /**
    * 新增
    */
    int insertExp(SecExpAddParmVo secExpAddParmVo);

    int insertTool(@Param("secid") String secid,@Param("expid") String expid,@Param("createby") String createby);

    /**
    * 更新
    */
    int update(SecExperiment secExperiment);

    int updateScheduled(@Param("id") Long id, @Param("state") String state);

    /**
    * 获取单个
    */
    SecExpInfoVo getInfo(@Param("id") String id);

    List<SecExpToolsVo> listSafetyTools(@Param("id") String id);

    /**
     * 根据工具ID列出相关的计划
     * @param toolId 工具ID
     * @return 计划列表
     */
    List<SecExperiment> listExperiment(@Param("toolId") Long toolId);

    /**
    * 查询列表
    */
    Page<SecExpListVo> getList(SecExpListParmVo listParmVo);

}
