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

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

import java.util.List;

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

    @Query(value = "SELECT * FROM `field_extension_table` WHERE english_name = ?1 ORDER BY id DESC LIMIT 1 ",nativeQuery = true)
    FieldExtensionTable findByEnglishName(String englishName);

    @Query(value = "SELECT * FROM `field_extension_table` WHERE extend_table = ?1 ORDER BY topic_name DESC,order_no ASC ",nativeQuery = true)
    List<FieldExtensionTable> findByExtendTable(String extendTable);
}