优化
This commit is contained in:
+9
@@ -29,6 +29,15 @@ class ContainerOverviewSqlContractTest {
|
||||
.doesNotContain("SELECT *");
|
||||
}
|
||||
|
||||
@Test void pickExceptionReasonsRemainOrderedWithoutInvalidDistinctOrdering() throws Exception {
|
||||
String sql = String.join(" ", ContainerOverviewMapper.class
|
||||
.getDeclaredMethod("pickExceptionReasons", long.class)
|
||||
.getAnnotation(Select.class).value());
|
||||
assertThat(sql)
|
||||
.contains("GROUP BY h.operation_reason", "ORDER BY MIN(h.id)")
|
||||
.doesNotContain("SELECT DISTINCT");
|
||||
}
|
||||
|
||||
@Test void exceptionQueriesSelectEveryExceptionRowConstructorField() throws Exception {
|
||||
for (String method : java.util.List.of("exceptions", "latestException")) {
|
||||
String sql = String.join(" ", ContainerOverviewMapper.class.getDeclaredMethod(method, long.class)
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.baiyue.firstleg.repository;
|
||||
|
||||
import com.baiyue.firstleg.mapper.InboundHoldGateMapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class InboundHoldGateSqlContractTest {
|
||||
@Test void physicalWorkGateUsesOnlyCurrentFulfillmentTables() throws Exception {
|
||||
String sql = String.join(" ", InboundHoldGateMapper.class
|
||||
.getDeclaredMethod("hasPhysicalWork", long.class, long.class)
|
||||
.getAnnotation(Select.class).value());
|
||||
|
||||
assertThat(sql)
|
||||
.contains("fl_loading_pick_item", "picked_package_count>0", "fl_outbound_dispatch")
|
||||
.doesNotContain("fl_loading_work_pallet", "fl_loading_work_pallet_carton");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user