package com.sw.mes.fb.checkout.dao;

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.fb.checkout.entity.FieldExtensionRecord;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
* @Author
* @Description：
* @Date:
* @Modified By:
*/
public interface FieldExtensionRecordDao extends BaseDao<FieldExtensionRecord, Long> {

    @Query(value = "SELECT * FROM `field_extension_record` WHERE  associated_id = ?1 ",nativeQuery = true)
    List<FieldExtensionRecord> findByAssociatedId(Long associatedId);

    @Modifying
    @Query(value = "DELETE FROM field_extension_record  WHERE associated_id = ?1 ", nativeQuery = true)
    void deleteByProductModelId(Long associatedId);
}