package com.sw.mes.agv.dao;

import com.sw.mes.agv.entity.RechargeArtBagItem;
import com.sw.mes.core.base.BaseDao;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface RechargeArtBagItemDao extends BaseDao<RechargeArtBagItem, Integer> {

    @Query(value = "SELECT * FROM zhxx_recharge_art_bag_item WHERE device_no=?1 ", nativeQuery = true)
    List<RechargeArtBagItem> findByDeviceNo(String deviceNo);

    @Modifying
    @Transactional
    @Query(value = "DELETE FROM zhxx_recharge_art_bag_item WHERE device_no=?1 ", nativeQuery = true)
    void deleteByDeviceNo(String deviceNo);

}
