package com.tuoheng.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tuoheng.admin.entity.domain.Inspection;
import com.tuoheng.admin.entity.request.inspection.QueryInspectionPageListRequest;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 巡检任务Mapper接口
 *
 * @team tuoheng
 * @author wanjing
 * @date 2022-11-16
 */
public interface InspectionMapper extends BaseMapper<Inspection> {
        /**
         * 查询巡检任务
         *
         * @param request 巡检任务查询实体
         * @return 巡检任务
         */
     Inspection selectOneById(QueryInspectionPageListRequest request);

    /**
     * 查询巡检任务分页列表
     *
     * @param request 巡检任务查询实体
     * @return 巡检任务集合
     */
    Page<Inspection> selectPageList(@Param("page") IPage page, @Param("request") QueryInspectionPageListRequest request);

    /**
     * 修改巡检任务
     *
     * @param inspection 巡检任务
     * @return 结果
     */
    int update(Inspection inspection);

    int updateStatus(Inspection inspection);

    int updateByPrimaryKeySelective(Inspection request);

    int updateByPrimaryKey(Inspection inspection);

    /**
     * 删除巡检任务， 逻辑删除
     *
     * @param inspection 巡检任务
     * @return 结果
     */
    int deleteByLogic(Inspection inspection);

    /**
     * 删除巡检任务，物理删除
     * 
     * @param id 巡检任务主键
     * @return 结果
     */
     int deleteByPhysical(String id);

    List<Inspection> getListByBox(@Param("boxSn") String boxSn);

}
