package com.zy.asrs.mapper; import com.baomidou.mybatisplus.mapper.BaseMapper; import com.zy.asrs.entity.AgvBasDevp; import org.apache.ibatis.annotations.Delete; 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; import java.util.Map; @Mapper @Repository public interface AgvBasDevpMapper extends BaseMapper { @Delete("delete from agv_bas_devp") void deleteAll(); @Select("select dev_no from agv_bas_devp where loc_sts = 'O'") List getAvailableEmptyInSite(); @Select("select station_code from agv_bas_devp where cache_shelves = 'N' and in_enable = 'Y' group by station_code") List selectCacheShelvesStationCodeByFloor(@Param("floor") int floor); @Select("select dev_no from agv_bas_devp where loc_type1 = #{locType} and out_enable = 'Y'") List selectCacheShelvesStationCodeByLocType(@Param("locType") Short locType); @Select("SELECT\n" + "\tbas.dev_no,\n" + "\tCOUNT ( mast.loc_no ) AS num \n" + "FROM\n" + "\tagv_bas_devp bas\n" + "\tLEFT JOIN agv_wrk_mast mast ON bas.dev_no = mast.loc_no \n" + "WHERE\n" + "\tbas.station_code = #{stationCode} AND bas.loc_sts != 'X' \n" + "GROUP BY\n" + "\tbas.dev_no \n" + "ORDER BY\n" + "\tnum") List> selectDevNoAndNumBystationCode(@Param("stationCode") String stationCode); @Select("select station_code from agv_bas_devp group by station_code") List selectAllStationCode(); }