提交
This commit is contained in:
+12
-5
@@ -35,6 +35,13 @@ public interface ContainerCustomsMapper {
|
||||
f.file_hash fileHash,f.content_type contentType,f.size_bytes sizeBytes,f.uploaded_by uploadedBy,
|
||||
f.uploaded_by_name uploadedByName,f.uploaded_at uploadedAt,f.version version
|
||||
""";
|
||||
String CONTAINER_COLUMNS = """
|
||||
id id,loading_plan_id loadingPlanId,container_booking_id containerBookingId,status status,
|
||||
started_by startedBy,started_by_name startedByName,started_at startedAt,
|
||||
completed_by completedBy,completed_by_name completedByName,completed_at completedAt,
|
||||
broker_submitted_by brokerSubmittedBy,broker_submitted_by_name brokerSubmittedByName,
|
||||
broker_submitted_at brokerSubmittedAt,created_at createdAt,updated_at updatedAt,version version
|
||||
""";
|
||||
|
||||
@Select("""
|
||||
SELECT DISTINCT p.id loadingPlanId,p.plan_no planNo,p.container_booking_id containerBookingId,
|
||||
@@ -132,19 +139,19 @@ public interface ContainerCustomsMapper {
|
||||
int insertContainer(@Param("id") long id,@Param("planId") long planId,
|
||||
@Param("containerBookingId") long containerBookingId,@Param("status") String status);
|
||||
|
||||
@Select("SELECT * FROM fl_customs_container WHERE loading_plan_id=#{planId}")
|
||||
@Select("SELECT " + CONTAINER_COLUMNS + " FROM fl_customs_container WHERE loading_plan_id=#{planId}")
|
||||
ContainerRow container(@Param("planId") long planId);
|
||||
|
||||
@Select("SELECT * FROM fl_customs_container WHERE id=#{id}")
|
||||
@Select("SELECT " + CONTAINER_COLUMNS + " FROM fl_customs_container WHERE id=#{id}")
|
||||
ContainerRow containerById(@Param("id") long id);
|
||||
|
||||
@Select("SELECT * FROM fl_customs_container WHERE container_booking_id=#{containerBookingId}")
|
||||
@Select("SELECT " + CONTAINER_COLUMNS + " FROM fl_customs_container WHERE container_booking_id=#{containerBookingId}")
|
||||
ContainerRow containerByBooking(@Param("containerBookingId") long containerBookingId);
|
||||
|
||||
@Select("SELECT * FROM fl_customs_container WHERE loading_plan_id=#{planId} FOR UPDATE")
|
||||
@Select("SELECT " + CONTAINER_COLUMNS + " FROM fl_customs_container WHERE loading_plan_id=#{planId} FOR UPDATE")
|
||||
ContainerRow lockContainer(@Param("planId") long planId);
|
||||
|
||||
@Select("SELECT * FROM fl_customs_container WHERE id=#{id} FOR UPDATE")
|
||||
@Select("SELECT " + CONTAINER_COLUMNS + " FROM fl_customs_container WHERE id=#{id} FOR UPDATE")
|
||||
ContainerRow lockContainerById(@Param("id") long id);
|
||||
|
||||
@Update("""
|
||||
|
||||
+8
@@ -28,6 +28,14 @@ class ContainerCustomsMapperContractTest {
|
||||
assertThat(currentRead.getCache()).isNull();
|
||||
}
|
||||
|
||||
@Test void containerQueriesExplicitlyMapEveryRecordComponentInOrder() throws Exception {
|
||||
assertRecordProjection("container", ContainerCustomsMapper.ContainerRow.class, long.class);
|
||||
assertRecordProjection("containerById", ContainerCustomsMapper.ContainerRow.class, long.class);
|
||||
assertRecordProjection("containerByBooking", ContainerCustomsMapper.ContainerRow.class, long.class);
|
||||
assertRecordProjection("lockContainer", ContainerCustomsMapper.ContainerRow.class, long.class);
|
||||
assertRecordProjection("lockContainerById", ContainerCustomsMapper.ContainerRow.class, long.class);
|
||||
}
|
||||
|
||||
@Test void merchantOrderUsesCompletedTaxRefundPlanWithRealCompletionTimestamp() throws Exception {
|
||||
String value=sql("completedPlanForOrder",long.class,long.class);
|
||||
assertThat(value)
|
||||
|
||||
Reference in New Issue
Block a user