package com.upsfj.sfjprojectbackend.mapper;


import com.upsfj.sfjprojectbackend.entity.Field;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface FieldMapper {

    @Insert("INSERT INTO sfj_field (field_name) VALUES (#{field_name}) ")
    void AddField(String field_name);


    @Update("UPDATE sfj_field SET field_name=#{field_name} WHERE field_id = #{field_id}")
    void UpdateField(Field field);


    @Delete("DELETE FROM sfj_field WHERE field_id = #{field_id}")
    void  DeleteField(Field field);


    @Delete("DELETE FROM sfj_algorithm_field WHERE field_id = #{field_id}")
    void DeleteAlgorithmForField(Field field);
}
