fix: retain appointment cancellation reasons and query history

This commit is contained in:
2026-10-11 13:26:00 +08:00
parent d4b72594ab
commit 43494cbfa3
11 changed files with 255 additions and 14 deletions
@@ -11,4 +11,9 @@ public interface FbaAppointmentCommandMapper {
int begin(@Param("key") String key,@Param("hash") String hash,@Param("operation") String operation,@Param("operator") String operator,@Param("createdAt") java.time.LocalDateTime createdAt);
@Update("UPDATE ll_fba_appointment_command SET appointment_no=#{appointmentNo},response_json=#{response} WHERE command_key=#{key} AND response_json IS NULL")
int finish(@Param("key") String key,@Param("appointmentNo") String appointmentNo,@Param("response") String response);
record Cancellation(String responseJson,java.time.LocalDateTime createdAt) { }
@Select("SELECT COUNT(*) FROM ll_fba_appointment_command WHERE operation=CONCAT('CANCEL:',appointment_no) AND response_json IS NOT NULL AND (#{number} IS NULL OR appointment_no=#{number})")
long cancellationCount(@Param("number") String number);
@Select("SELECT response_json AS responseJson,created_at AS createdAt FROM ll_fba_appointment_command WHERE operation=CONCAT('CANCEL:',appointment_no) AND response_json IS NOT NULL AND (#{number} IS NULL OR appointment_no=#{number}) ORDER BY created_at DESC,command_key DESC LIMIT #{size} OFFSET #{offset}")
java.util.List<Cancellation> cancellations(@Param("number") String number,@Param("size") int size,@Param("offset") long offset);
}