package com.gonghang.h5clientapp.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gonghang.h5clientapp.beans.dto.RobotDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by shiwn on 2022/8/3 14:18
 */
@Component
public interface RobotMapper extends BaseMapper<RobotDTO> {

    @Select("SELECT * FROM robot ORDER BY id DESC")
    List<RobotDTO> queryAllRobots();

    @Select("SELECT * FROM robot WHERE ip = #{ip}")
    RobotDTO selectRobotByIP(@Param("ip") String ip);
}
