package com.artfess.yhxt.check.regular.dao;


import com.artfess.yhxt.check.regular.model.CulvertOftenCheck;
import com.artfess.yhxt.check.regular.model.SideSlopeOftenCheck;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.Map;

/**
 * 涵洞经常检查表 Mapper 接口
 *
 * @company 阿特菲斯信息技术有限公司
 * @author xzh
 * @since 2021-08-05
 */
public interface CulvertOftenCheckDao extends BaseMapper<CulvertOftenCheck> {

    IPage<CulvertOftenCheck> queryCulvertOftenCheck(IPage<CulvertOftenCheck> convert2IPage,
                                                    @Param("map") Map<String, Object> params,
                                                    @Param(Constants.WRAPPER) Wrapper<CulvertOftenCheck> convert2Wrapper);

    @Select("SELECT * FROM BIZ_CULVERT_OFTEN_CHECK  WHERE CULVERT_ID_ = #{id}    ORDER BY CHECK_DATE_ DESC LIMIT 0,1 ")
    CulvertOftenCheck selectMaxCheckDate(String id);

    int countCulvertOften(@Param("ids") String culvertIds,@Param("mouth") String mouth);
}
