package com.elephant.framework.galaxy.aroad.module.roadcondition.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elephant.framework.galaxy.aroad.module.roadcondition.dto.*;
import com.elephant.framework.galaxy.aroad.module.roadcondition.entity.RoadConditionEvent;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 路况事件统计
 *
 * @author Xingyuyang
 * @date 2019-04-23 16:41:06
 */
public interface RoadConditionEventMapper extends BaseMapper<RoadConditionEvent> {
  IPage<RoadConditionEvent> getRoadConditionEventPage(
      IPage<RoadConditionEvent> page, RoadConditionEvent roadConditionEvent,@Param("units")String units);

  List<SaveUnitDto> getUnitTree();

  List<RoadConditionEvent> getRoadConditionEventMobilePage();

  List<staticByEventTypeDto> staticByEventType();

  List<staticByInfluenceDto> staticByInfluence();

  List<staticByMonthDto> staticByMonth();

  List<staticByRoadCodeDto> staticByRoadCode();

  List<staticByCityDto> staticByCity();

  List<DeptUnitDto> getUnitByDept(@Param("deptId") String deptId);

  List<CoordinateDto> getCoordinates(@Param("units") String units);

  List<CoordinateDto> getTQCoordinates();

  List<CoordinateDto> getYHCoordinates();

  List<CoordinateDto> getSFZCoordinates();

  List<CoordinateDto> getTFCoordinates();

  List<staticByYHCityDto> staticByYHCity();
  /**
   * @Description: 查询树形 @Param: []
   *
   * @return:
   *     java.util.List<com.elephant.framework.galaxy.travel.module.basic_resources.entity.BaseServiceArea> @Author:
   *     Xingyuyang @Date: 2019/4/25
   */
  List<CityNameDto> getTree();

  RoadConditionEvent getById(@Param("id") Integer id);

  boolean saveUnitWithDept(
      @Param("deptId") String deptId, @Param("unit") String unit);

  boolean deleteUnitByDept(@Param("deptId") String deptId);

  /**
   * 查询数据库是否存在该实体
   *
   * @param event
   * @return
   */
  RoadConditionEvent selectRoadMaintainEvent(RoadConditionEvent event);

  /**
   * 撤销事件，更新flag标识为0
   *
   * @param eventIdList
   * @return
   */
  Integer updateBatchByEventId(@Param("eventIdList") List<Object> eventIdList);

  /**
   * 删除养护施工事件（假删除）更新flag标识为1
   *
   * @param event
   * @return
   */
  Integer deleteBatchByEvent(RoadConditionEvent event);

  boolean saveUnit();

  boolean deleteUnit();
}
