package thyyxxk.webserver.dao.his.outpatient.interactive;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import thyyxxk.webserver.entity.outpatient.interactive.complaints.request.ComplaintsInquiry;
import thyyxxk.webserver.entity.outpatient.interactive.complaints.response.ComplaintsAndSuggestions;

import java.util.List;

@Mapper
public interface ComplaintsDao {
    @Select("select * from t_complaints_and_suggestions where create_datetime>=#{start} " +
            "and create_datetime<=#{end} ${extraStatement} order by id")
    List<ComplaintsAndSuggestions> selectAllComplaints(ComplaintsInquiry inquiry);

    @Update("update t_complaints_and_suggestions set replied=1,response=#{response},handle_staff=#{handleStaff}, " +
            "handle_datetime=getdate() where id=#{id}")
    void updateResponse(ComplaintsAndSuggestions complaint);
}
