package com.bofeng.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.bofeng.entity.MsReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: xielianghe
 * @Date: 2020/2/4 15:45
 */
@Mapper
@Repository
public interface MsReportMapper extends BaseMapper<MsReport> {

    List<MsReport> selectByReportDate(@Param("reportDate") String reportDate,@Param("userCreate") Long userCreate);

    @Select("select property_id from sys_user_role where user_id=#{userId} and role_id=1")
    long selectHouseIdByUserId(@Param("userId") Long userId);

    //
    @Select("select count(*) from ms_suspected where report_id=#{reportId} and  medical=#{medical}")
    Integer selectSuspectedNum(@Param("reportId") Long reportId,@Param("medical") Integer medical);

}
