package com.iwe3.langchain4j.mapper;

import com.iwe3.langchain4j.entity.AppointmentEntity;
import com.iwe3.langchain4j.record.AppointmentRecord;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface AppointmentMapper {

    @Insert("""
        insert into appointment(username,id_card,department,date,time,doctor_name)
        values (#{r.userName},#{r.idcard},#{r.department},#{r.date},#{r.time},#{r.doctorName})
    """)
    void saveAppointmentEntity(@Param("r") AppointmentRecord record);

    @Delete("""
        delete from appointment where id = #{id}
    """)
    void removeById(@Param("id") long id);

    AppointmentEntity getOne(@Param("r") AppointmentRecord record);
}
