package com.xunmei.core.resumption.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xunmei.core.resumption.domain.AppRulePoint;
import com.xunmei.core.resumption.dto.appRuleItem.AppRulePointSelectPageDto;
import com.xunmei.core.resumption.dto.appRulePoint.AppRulePointDetailDto;
import com.xunmei.core.resumption.dto.appRulePoint.AppRulePointInfoDto;
import com.xunmei.core.resumption.vo.AppRulePointTaskVo;
import com.xunmei.core.resumption.vo.ResumptionPointVo;
import com.xunmei.core.resumption.vo.appRuleItem.AppRulePointSelectVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author jingyuanchao
 * @since 2022-04-27
 */
@Mapper
public interface AppRulePointMapper extends BaseMapper<AppRulePoint> {

    List<AppRulePointDetailDto> selectDataListByItemId(Long id);

//    List<AppRulePointInfoDto> selectDataListByIdList(@Param("pointIds") List<Long> pointIds, @Param("planIdList") List<Long> planIdList);

    List<AppRulePointInfoDto> selectPointListByIdList(@Param("pointIds") List<Long> pointIds, @Param("normIdList") List<Long> planIdList);

    List<AppRulePointTaskVo> findPointByPlan(Long planid);

    List<Map<String, Object>> findAreaListPlan(Long planid);

    Map<String, Object> findByName(Map<String, Object> param);

    Integer checkIsUsed(@Param("pointId") Long pointId);

    List<Long> selectPointIds(Long id);

    void updateDeleted(@Param("id") Long id, @Param("deleted") int deleted);

    void updatePlanItem(@Param("id") Long id, @Param("newId") Long newId);

//    Integer checkPointNumRepeat(@Param("itemId") Long itemId, @Param("pointId") Long pointId, @Param("pointNum") Integer pointNum);

    Integer checkPointNameRepeat(@Param("itemId") Long itemId, @Param("pointId") Long pointId, @Param("pointName") String pointName);

//    List<PointVo> findPointBySafetyPlan(Map<String,Object> param);
//
//    List<PointVo> findPointBySafetyPlanb(Map<String, Object> param);
//
    List<ResumptionPointVo> findPointByRulePlan(@Param("planId")Long planId);

    Integer checkIsJoinResumptionPlan(@Param("pointIds") List<Long> pointIds);

    Page<AppRulePointSelectVo> pointSelectionPage(@Param("page") Page<AppRulePointSelectVo> page, @Param("query") AppRulePointSelectPageDto query);
//    Integer checkIsJoinSafetyCheckTaskPlan(@Param("pointIds") List<Long> pointIds);
}
