package com.fdkanfang.dao.backend;

import com.fdkanfang.domain.backend.ImageEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
@Mapper
public interface ImageMapper extends IBaseMapper<ImageEntity, Long> {

    @Select(value = "select * from tb_image where house_id = #{id}")
    List<ImageEntity> findByHouseId(Long id);

    @Select(value = "select * from tb_image where house_id = #{houseId} and (floor = #{floor} or #{floor} is null)")
    List<ImageEntity> findByHouseIdAndFloor(Long houseId, Integer floor);
}