贴标申请,仓储转运
This commit is contained in:
+12
@@ -58,6 +58,18 @@ class ReturnOutboundPdaPersistenceTest {
|
||||
for (Class<?> mapper : List.of(OutboundOrderMapper.class, OutboundPalletItemMapper.class,
|
||||
OutboundPdaTaskMapper.class, OutboundPdaPickMapper.class, DeliveryOrderMapper.class, ReturnInventoryCartonMapper.class,
|
||||
ReturnInventoryCartonItemMapper.class, ReturnInventoryBalanceMapper.class, ReturnInventoryMovementMapper.class)) configuration.addMapper(mapper);
|
||||
// H2 does not implement MySQL charset/collation expressions. Preserve the real
|
||||
// movement query and bindings, removing only those expressions in this H2 fixture.
|
||||
for (String method : List.of("platformCount", "platformPage")) {
|
||||
var statement = configuration.getMappedStatement(ReturnInventoryMovementMapper.class.getName() + "." + method);
|
||||
var mysqlSource = statement.getSqlSource();
|
||||
org.apache.ibatis.mapping.SqlSource h2Source = params -> {
|
||||
var bound = mysqlSource.getBoundSql(params);
|
||||
String sql = bound.getSql().replaceAll("CONVERT\\(([^()]+) USING utf8mb4\\) COLLATE utf8mb4_unicode_ci", "$1");
|
||||
return new org.apache.ibatis.mapping.BoundSql(configuration, sql, bound.getParameterMappings(), params);
|
||||
};
|
||||
ReflectionTestUtils.setField(statement, "sqlSource", h2Source);
|
||||
}
|
||||
var factory = new MybatisSqlSessionFactoryBean(); factory.setDataSource(ds); factory.setConfiguration(configuration);
|
||||
var session = new SqlSessionTemplate(factory.getObject());
|
||||
movementMapper = session.getMapper(ReturnInventoryMovementMapper.class);
|
||||
|
||||
Reference in New Issue
Block a user