项目启动不需要加载所有Mapper内容

Leon 4 years ago
parent d68650b84b
commit 994ccf6628

@ -33,7 +33,7 @@ import java.util.UUID;
* @author Syngna
* @since 2020-01-13
*/
@Aspect
//@Aspect
@Component
public class HttpLogAspect {

@ -0,0 +1,53 @@
package com.foreverwin.mesnac.console.mybatis;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.parser.SqlParserHelper;
import com.baomidou.mybatisplus.core.toolkit.Assert;
import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils;
import com.baomidou.mybatisplus.core.toolkit.TableInfoHelper;
import com.baomidou.mybatisplus.extension.injector.LogicSqlInjector;
import org.apache.ibatis.builder.MapperBuilderAssistant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import java.util.List;
import java.util.Set;
/**
* sql
*/
public class GeneralMybatisPlusSqlInjector extends LogicSqlInjector {
@Autowired
private Environment env;
@Override
public void inspectInject(MapperBuilderAssistant builderAssistant, Class<?> mapperClass) {
String statementLazyLoad = env.getProperty("mybatis-plus.statement-lazy-load");
String className = mapperClass.toString();
Set<String> mapperRegistryCache = GlobalConfigUtils.getMapperRegistryCache(builderAssistant.getConfiguration());
if (!mapperRegistryCache.contains(className)) {
List<AbstractMethod> methodList = this.getMethodList();
Assert.notEmpty(methodList, "No effective injection method was found.");
// 循环注入自定义方法
Class<?> modelClass = extractModelClass(mapperClass);
if (modelClass != null) {
TableInfo tableInfo = TableInfoHelper.initTableInfo(builderAssistant, modelClass);
if(!"true".equals(statementLazyLoad)) {
methodList.forEach(m -> m.inject(builderAssistant, mapperClass, modelClass, tableInfo));
}
}
mapperRegistryCache.add(className);
/*
* SQL
*/
if (GlobalConfigUtils.getGlobalConfig(builderAssistant.getConfiguration()).isSqlParserCache()) {
SqlParserHelper.initSqlParserInfoCache(mapperClass);
}
}
}
}

@ -0,0 +1,23 @@
package com.foreverwin.mesnac.console.mybatis;
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
*
* @description:
* @author: syngna
* @create: 2020-11-23 21:11
*/
@Configuration
public class MybatisPlusConfig {
/**
* sql
* @return
*/
@Bean
public ISqlInjector sqlInjector() {
return new GeneralMybatisPlusSqlInjector();
}
}

@ -0,0 +1,137 @@
package com.foreverwin.mesnac.console.mybatis.autoconfigure;
import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
import com.baomidou.mybatisplus.autoconfigure.SpringBootVFS;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.baomidou.mybatisplus.core.incrementer.IKeyGenerator;
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
import com.foreverwin.mesnac.console.mybatis.core.ExtMybatisConfiguration;
import org.apache.ibatis.mapping.DatabaseIdProvider;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.session.SqlSessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ResourceLoader;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.sql.DataSource;
import java.util.List;
/**
*
* @description:
* @author: syngna
* @create: 2021-04-16 16:58
*/
@ConditionalOnProperty(prefix = "mybatis-plus",name = "statement-lazy-load",havingValue = "true")
@Configuration
public class ExtMybatisPlusAutoConfiguration {
private final ExtMybatisPlusProperties properties;
private final Interceptor[] interceptors;
private final ResourceLoader resourceLoader;
private final DatabaseIdProvider databaseIdProvider;
private final List<ConfigurationCustomizer> configurationCustomizers;
private final ApplicationContext applicationContext;
public ExtMybatisPlusAutoConfiguration(ExtMybatisPlusProperties properties,
ObjectProvider<Interceptor[]> interceptorsProvider,
ResourceLoader resourceLoader,
ObjectProvider<DatabaseIdProvider> databaseIdProvider,
ObjectProvider<List<ConfigurationCustomizer>> configurationCustomizersProvider,
ApplicationContext applicationContext) {
this.properties = properties;
this.interceptors = interceptorsProvider.getIfAvailable();
this.resourceLoader = resourceLoader;
this.databaseIdProvider = databaseIdProvider.getIfAvailable();
this.configurationCustomizers = configurationCustomizersProvider.getIfAvailable();
this.applicationContext = applicationContext;
}
@Bean
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) throws Exception {
MybatisSqlSessionFactoryBean factory = new MybatisSqlSessionFactoryBean();
factory.setDataSource(dataSource);
factory.setVfs(SpringBootVFS.class);
if (StringUtils.hasText(this.properties.getConfigLocation())) {
factory.setConfigLocation(this.resourceLoader.getResource(this.properties.getConfigLocation()));
}
applyConfiguration(factory);
if (this.properties.getConfigurationProperties() != null) {
factory.setConfigurationProperties(this.properties.getConfigurationProperties());
}
if (!ObjectUtils.isEmpty(this.interceptors)) {
factory.setPlugins(this.interceptors);
}
if (this.databaseIdProvider != null) {
factory.setDatabaseIdProvider(this.databaseIdProvider);
}
if (StringUtils.hasLength(this.properties.getTypeAliasesPackage())) {
factory.setTypeAliasesPackage(this.properties.getTypeAliasesPackage());
}
// TODO 自定义枚举包
if (StringUtils.hasLength(this.properties.getTypeEnumsPackage())) {
factory.setTypeEnumsPackage(this.properties.getTypeEnumsPackage());
}
if (this.properties.getTypeAliasesSuperType() != null) {
factory.setTypeAliasesSuperType(this.properties.getTypeAliasesSuperType());
}
if (StringUtils.hasLength(this.properties.getTypeHandlersPackage())) {
factory.setTypeHandlersPackage(this.properties.getTypeHandlersPackage());
}
if (!ObjectUtils.isEmpty(this.properties.resolveMapperLocations())) {
factory.setMapperLocations(this.properties.resolveMapperLocations());
}
// TODO 此处必为非 NULL
GlobalConfig globalConfig = this.properties.getGlobalConfig();
//注入填充器
if (this.applicationContext.getBeanNamesForType(MetaObjectHandler.class,
false, false).length > 0) {
MetaObjectHandler metaObjectHandler = this.applicationContext.getBean(MetaObjectHandler.class);
globalConfig.setMetaObjectHandler(metaObjectHandler);
}
//注入主键生成器
if (this.applicationContext.getBeanNamesForType(IKeyGenerator.class, false,
false).length > 0) {
IKeyGenerator keyGenerator = this.applicationContext.getBean(IKeyGenerator.class);
globalConfig.getDbConfig().setKeyGenerator(keyGenerator);
}
//注入sql注入器
if (this.applicationContext.getBeanNamesForType(ISqlInjector.class, false,
false).length > 0) {
ISqlInjector iSqlInjector = this.applicationContext.getBean(ISqlInjector.class);
globalConfig.setSqlInjector(iSqlInjector);
}
factory.setGlobalConfig(globalConfig);
return factory.getObject();
}
private void applyConfiguration(MybatisSqlSessionFactoryBean factory) {
ExtMybatisConfiguration configuration = this.properties.getConfiguration();
if (configuration == null && !StringUtils.hasText(this.properties.getConfigLocation())) {
configuration = new ExtMybatisConfiguration();
}
if (configuration != null && !CollectionUtils.isEmpty(this.configurationCustomizers)) {
for (ConfigurationCustomizer customizer : this.configurationCustomizers) {
customizer.customize(configuration);
}
}
factory.setConfiguration(configuration);
}
}

@ -0,0 +1,32 @@
package com.foreverwin.mesnac.console.mybatis.autoconfigure;
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties;
import com.foreverwin.mesnac.console.mybatis.core.ExtMybatisConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.NestedConfigurationProperty;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
/**
*
* @description:
* @author: syngna
* @create: 2021-04-18 10:08
*/
@Primary
@ConditionalOnProperty(prefix = "mybatis-plus",name = "statement-lazy-load",havingValue = "true")
@Component
public class ExtMybatisPlusProperties extends MybatisPlusProperties {
@NestedConfigurationProperty
private ExtMybatisConfiguration configuration;
@Override
public ExtMybatisConfiguration getConfiguration() {
return configuration;
}
public void setConfiguration(ExtMybatisConfiguration configuration) {
this.configuration = configuration;
}
}

@ -0,0 +1,130 @@
package com.foreverwin.mesnac.console.mybatis.core;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
import com.baomidou.mybatisplus.core.toolkit.TableInfoHelper;
import com.foreverwin.mesnac.console.mybatis.override.MethodFactory;
import com.foreverwin.modular.core.exception.BusinessException;
import org.apache.ibatis.binding.MapperRegistry;
import org.apache.ibatis.builder.MapperBuilderAssistant;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.session.SqlSession;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
/**
* @program: modular-aps
* @description: override mybatis configuration
* @author: syngna
* @create: 2021-04-16 17:15
*/
public class ExtMybatisConfiguration extends MybatisConfiguration {
protected final ExtMybatisMapperRegistry mybatisMapperRegistry = new ExtMybatisMapperRegistry(this);
/**
* 使 MybatisMapperRegistry
*/
@Override
public MapperRegistry getMapperRegistry() {
return mybatisMapperRegistry;
}
/**
* 使 MybatisMapperRegistry
*/
@Override
public <T> void addMapper(Class<T> type) {
mybatisMapperRegistry.addMapper(type);
}
/**
* 使 MybatisMapperRegistry
*/
@Override
public void addMappers(String packageName, Class<?> superType) {
mybatisMapperRegistry.addMappers(packageName, superType);
}
/**
* 使 MybatisMapperRegistry
*/
@Override
public void addMappers(String packageName) {
mybatisMapperRegistry.addMappers(packageName);
}
/**
* 使 MybatisMapperRegistry
*/
@Override
public <T> T getMapper(Class<T> type, SqlSession sqlSession) {
return mybatisMapperRegistry.getMapper(type, sqlSession);
}
/**
* 使 MybatisMapperRegistry
*/
@Override
public boolean hasMapper(Class<?> type) {
return mybatisMapperRegistry.hasMapper(type);
}
@Override
public MappedStatement getMappedStatement(String id, boolean validateIncompleteStatements) {
if (validateIncompleteStatements) {
buildAllStatements();
}
if(!this.hasStatement(id)) {
// 新增逻辑没找到注入的statement则先注入----------------------------------------------------------------------------------------------------------
String mapperName = id.substring(0, id.lastIndexOf("."));
String methodName = id.substring(id.lastIndexOf(".") + 1);
Class<?> mapperInterface;
try {
mapperInterface = Class.forName(mapperName);
} catch (ClassNotFoundException e) {
throw BusinessException.build("get mapper class [" + mapperName + "] failed " + e);
}
String resource = mapperName.replace('.', '/') + ".java (best guess)";
MapperBuilderAssistant assistant = new MapperBuilderAssistant(this, resource);
assistant.setCurrentNamespace(mapperName);
Class<?> modelClass = extractModelClass(mapperInterface);
TableInfo tableInfo = TableInfoHelper.initTableInfo(assistant, modelClass);
MethodFactory.getInstance(methodName).inject(assistant,mapperInterface, modelClass, tableInfo);
// -----------------------------------------------------------------------------------------------------------------------------------------------
}
return mappedStatements.get(id);
}
/**
* ,T
*
* @param mapperClass mapper
* @return mapper
*/
protected Class<?> extractModelClass(Class<?> mapperClass) {
Type[] types = mapperClass.getGenericInterfaces();
ParameterizedType target = null;
for (Type type : types) {
if (type instanceof ParameterizedType) {
Type[] typeArray = ((ParameterizedType) type).getActualTypeArguments();
if (ArrayUtils.isNotEmpty(typeArray)) {
for (Type t : typeArray) {
if (t instanceof TypeVariable || t instanceof WildcardType) {
break;
} else {
target = (ParameterizedType) type;
break;
}
}
}
break;
}
}
return target == null ? null : (Class<?>) target.getActualTypeArguments()[0];
}
}

@ -0,0 +1,84 @@
package com.foreverwin.mesnac.console.mybatis.core;
import com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder;
import com.baomidou.mybatisplus.core.MybatisMapperRegistry;
import com.foreverwin.mesnac.console.mybatis.override.ExtMybatisMapperProxyFactory;
import org.apache.ibatis.binding.BindingException;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.SqlSession;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* @program: modular-aps
* @description:
* @author: syngna
* @create: 2021-04-16 17:25
*/
public class ExtMybatisMapperRegistry extends MybatisMapperRegistry {
private final Map<Class<?>, ExtMybatisMapperProxyFactory<?>> knownMappers = new HashMap<>();
private final Configuration config;
public ExtMybatisMapperRegistry(Configuration config) {
super(config);
this.config = config;
}
@SuppressWarnings("unchecked")
@Override
public <T> T getMapper(Class<T> type, SqlSession sqlSession) {
final ExtMybatisMapperProxyFactory<T> mapperProxyFactory = (ExtMybatisMapperProxyFactory<T>) knownMappers.get(type);
if (mapperProxyFactory == null) {
throw new BindingException("Type " + type + " is not known to the MybatisPlusMapperRegistry.");
}
try {
return mapperProxyFactory.newInstance(sqlSession);
} catch (Exception e) {
throw new BindingException("Error getting mapper instance. Cause: " + e, e);
}
}
@Override
public <T> boolean hasMapper(Class<T> type) {
return knownMappers.containsKey(type);
}
@Override
public <T> void addMapper(Class<T> type) {
if (type.isInterface()) {
if (hasMapper(type)) {
// TODO 如果之前注入 直接返回
return;
// throw new BindingException("Type " + type +
// " is already known to the MybatisPlusMapperRegistry.");
}
boolean loadCompleted = false;
try {
knownMappers.put(type, new ExtMybatisMapperProxyFactory<>(type));
// It's important that the type is added before the parser is run
// otherwise the binding may automatically be attempted by the
// mapper parser. If the type is already known, it won't try.
// TODO 自定义无 XML 注入
MybatisMapperAnnotationBuilder parser = new MybatisMapperAnnotationBuilder(config, type);
parser.parse();
loadCompleted = true;
} finally {
if (!loadCompleted) {
knownMappers.remove(type);
}
}
}
}
/**
* 使 knownMappers
*/
@Override
public Collection<Class<?>> getMappers() {
return Collections.unmodifiableCollection(knownMappers.keySet());
}
}

@ -0,0 +1,420 @@
package com.foreverwin.mesnac.console.mybatis.override;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
import com.baomidou.mybatisplus.core.toolkit.TableInfoHelper;
import org.apache.ibatis.annotations.Flush;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.binding.BindingException;
import org.apache.ibatis.builder.MapperBuilderAssistant;
import org.apache.ibatis.cursor.Cursor;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.SqlCommandType;
import org.apache.ibatis.mapping.StatementType;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.ParamNameResolver;
import org.apache.ibatis.reflection.TypeParameterResolver;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.session.SqlSession;
import java.lang.reflect.*;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* org.apache.ibatis.binding.MapperMethod</br>
* <p> ParamMap </p>
*
* @author miemie
* @since 2018-06-09
*/
public class ExtMybatisMapperMethod {
private final SqlCommand command;
private final MethodSignature method;
public ExtMybatisMapperMethod(Class<?> mapperInterface, Method method, Configuration config) {
this.command = new SqlCommand(config, mapperInterface, method);
this.method = new MethodSignature(config, mapperInterface, method);
}
@SuppressWarnings("unchecked")
public Object execute(SqlSession sqlSession, Object[] args) {
Object result;
switch (command.getType()) {
case INSERT: {
Object param = method.convertArgsToSqlCommandParam(args);
result = rowCountResult(sqlSession.insert(command.getName(), param));
break;
}
case UPDATE: {
Object param = method.convertArgsToSqlCommandParam(args);
result = rowCountResult(sqlSession.update(command.getName(), param));
break;
}
case DELETE: {
Object param = method.convertArgsToSqlCommandParam(args);
result = rowCountResult(sqlSession.delete(command.getName(), param));
break;
}
case SELECT:
if (method.returnsVoid() && method.hasResultHandler()) {
executeWithResultHandler(sqlSession, args);
result = null;
} else if (method.returnsMany()) {
result = executeForMany(sqlSession, args);
} else if (method.returnsMap()) {
result = executeForMap(sqlSession, args);
} else if (method.returnsCursor()) {
result = executeForCursor(sqlSession, args);
} else {
Object param = method.convertArgsToSqlCommandParam(args);
/*
*
*/
if (IPage.class.isAssignableFrom(method.getReturnType()) && args != null
&& IPage.class.isAssignableFrom(args[0].getClass())) {
result = ((IPage) args[0]).setRecords(executeForIPage(sqlSession, args));
/*
*
*/
} else {
result = sqlSession.selectOne(command.getName(), param);
if (method.returnsOptional() &&
(result == null || !method.getReturnType().equals(result.getClass()))) {
result = Optional.ofNullable(result);
}
}
}
break;
case FLUSH:
result = sqlSession.flushStatements();
break;
default:
throw new BindingException("Unknown execution method for: " + command.getName());
}
if (result == null && method.getReturnType().isPrimitive() && !method.returnsVoid()) {
throw new BindingException("Mapper method '" + command.getName()
+ " attempted to return null from a method with a primitive return type (" + method.getReturnType() + ").");
}
return result;
}
/**
* IPage
*/
private <E> List<E> executeForIPage(SqlSession sqlSession, Object[] args) {
Object param = method.convertArgsToSqlCommandParam(args);
return sqlSession.selectList(command.getName(), param);
}
private Object rowCountResult(int rowCount) {
final Object result;
if (method.returnsVoid()) {
result = null;
} else if (Integer.class.equals(method.getReturnType()) || Integer.TYPE.equals(method.getReturnType())) {
result = rowCount;
} else if (Long.class.equals(method.getReturnType()) || Long.TYPE.equals(method.getReturnType())) {
result = (long) rowCount;
} else if (Boolean.class.equals(method.getReturnType()) || Boolean.TYPE.equals(method.getReturnType())) {
result = rowCount > 0;
} else {
throw new BindingException("Mapper method '" + command.getName() + "' has an unsupported return type: " + method.getReturnType());
}
return result;
}
private void executeWithResultHandler(SqlSession sqlSession, Object[] args) {
MappedStatement ms = sqlSession.getConfiguration().getMappedStatement(command.getName());
if (!StatementType.CALLABLE.equals(ms.getStatementType())
&& void.class.equals(ms.getResultMaps().get(0).getType())) {
throw new BindingException("method " + command.getName()
+ " needs either a @ResultMap annotation, a @ResultType annotation,"
+ " or a resultType attribute in XML so a ResultHandler can be used as a parameter.");
}
Object param = method.convertArgsToSqlCommandParam(args);
if (method.hasRowBounds()) {
RowBounds rowBounds = method.extractRowBounds(args);
sqlSession.select(command.getName(), param, rowBounds, method.extractResultHandler(args));
} else {
sqlSession.select(command.getName(), param, method.extractResultHandler(args));
}
}
private <E> Object executeForMany(SqlSession sqlSession, Object[] args) {
List<E> result;
Object param = method.convertArgsToSqlCommandParam(args);
if (method.hasRowBounds()) {
RowBounds rowBounds = method.extractRowBounds(args);
result = sqlSession.selectList(command.getName(), param, rowBounds);
} else {
result = sqlSession.selectList(command.getName(), param);
}
// issue #510 Collections & arrays support
if (!method.getReturnType().isAssignableFrom(result.getClass())) {
if (method.getReturnType().isArray()) {
return convertToArray(result);
} else {
return convertToDeclaredCollection(sqlSession.getConfiguration(), result);
}
}
return result;
}
private <T> Cursor<T> executeForCursor(SqlSession sqlSession, Object[] args) {
Cursor<T> result;
Object param = method.convertArgsToSqlCommandParam(args);
if (method.hasRowBounds()) {
RowBounds rowBounds = method.extractRowBounds(args);
result = sqlSession.selectCursor(command.getName(), param, rowBounds);
} else {
result = sqlSession.selectCursor(command.getName(), param);
}
return result;
}
private <E> Object convertToDeclaredCollection(Configuration config, List<E> list) {
Object collection = config.getObjectFactory().create(method.getReturnType());
MetaObject metaObject = config.newMetaObject(collection);
metaObject.addAll(list);
return collection;
}
@SuppressWarnings("unchecked")
private <E> Object convertToArray(List<E> list) {
Class<?> arrayComponentType = method.getReturnType().getComponentType();
Object array = Array.newInstance(arrayComponentType, list.size());
if (arrayComponentType.isPrimitive()) {
for (int i = 0; i < list.size(); i++) {
Array.set(array, i, list.get(i));
}
return array;
} else {
return list.toArray((E[]) array);
}
}
private <K, V> Map<K, V> executeForMap(SqlSession sqlSession, Object[] args) {
Map<K, V> result;
Object param = method.convertArgsToSqlCommandParam(args);
if (method.hasRowBounds()) {
RowBounds rowBounds = method.extractRowBounds(args);
result = sqlSession.selectMap(command.getName(), param, method.getMapKey(), rowBounds);
} else {
result = sqlSession.selectMap(command.getName(), param, method.getMapKey());
}
return result;
}
public static class SqlCommand {
private final String name;
private final SqlCommandType type;
public SqlCommand(Configuration configuration, Class<?> mapperInterface, Method method) {
final String methodName = method.getName();
final Class<?> declaringClass = method.getDeclaringClass();
MappedStatement ms = resolveMappedStatement(mapperInterface, methodName, declaringClass,
configuration);
if (ms == null) {
if (method.getAnnotation(Flush.class) != null) {
name = null;
type = SqlCommandType.FLUSH;
} else {
throw new BindingException("Invalid bound statement (not found): "
+ mapperInterface.getName() + "." + methodName);
}
} else {
name = ms.getId();
type = ms.getSqlCommandType();
if (type == SqlCommandType.UNKNOWN) {
throw new BindingException("Unknown execution method for: " + name);
}
}
}
public String getName() {
return name;
}
public SqlCommandType getType() {
return type;
}
private MappedStatement resolveMappedStatement(Class<?> mapperInterface, String methodName,
Class<?> declaringClass, Configuration configuration) {
String statementId = mapperInterface.getName() + "." + methodName;
// 新增逻辑没找到注入的statement则先注入----------------------------------------------------------------------------------------------------------
if(!configuration.hasStatement(statementId)) {
String resource = mapperInterface.getName().replace('.', '/') + ".java (best guess)";
MapperBuilderAssistant assistant = new MapperBuilderAssistant(configuration, resource);
assistant.setCurrentNamespace(mapperInterface.getName());
Class<?> modelClass = extractModelClass(mapperInterface);
TableInfo tableInfo = TableInfoHelper.initTableInfo(assistant, modelClass);
MethodFactory.getInstance(methodName).inject(assistant,mapperInterface, modelClass,tableInfo);
}
// -----------------------------------------------------------------------------------------------------------------------------------------------
if (configuration.hasStatement(statementId)) {
return configuration.getMappedStatement(statementId);
} else if (mapperInterface.equals(declaringClass)) {
return null;
}
for (Class<?> superInterface : mapperInterface.getInterfaces()) {
if (declaringClass.isAssignableFrom(superInterface)) {
MappedStatement ms = resolveMappedStatement(superInterface, methodName,
declaringClass, configuration);
if (ms != null) {
return ms;
}
}
}
return null;
}
/**
* ,T
*
* @param mapperClass mapper
* @return mapper
*/
protected Class<?> extractModelClass(Class<?> mapperClass) {
Type[] types = mapperClass.getGenericInterfaces();
ParameterizedType target = null;
for (Type type : types) {
if (type instanceof ParameterizedType) {
Type[] typeArray = ((ParameterizedType) type).getActualTypeArguments();
if (ArrayUtils.isNotEmpty(typeArray)) {
for (Type t : typeArray) {
if (t instanceof TypeVariable || t instanceof WildcardType) {
break;
} else {
target = (ParameterizedType) type;
break;
}
}
}
break;
}
}
return target == null ? null : (Class<?>) target.getActualTypeArguments()[0];
}
}
public static class MethodSignature {
private final boolean returnsMany;
private final boolean returnsMap;
private final boolean returnsVoid;
private final boolean returnsCursor;
private final boolean returnsOptional;
private final Class<?> returnType;
private final String mapKey;
private final Integer resultHandlerIndex;
private final Integer rowBoundsIndex;
private final ParamNameResolver paramNameResolver;
public MethodSignature(Configuration configuration, Class<?> mapperInterface, Method method) {
Type resolvedReturnType = TypeParameterResolver.resolveReturnType(method, mapperInterface);
if (resolvedReturnType instanceof Class<?>) {
this.returnType = (Class<?>) resolvedReturnType;
} else if (resolvedReturnType instanceof ParameterizedType) {
this.returnType = (Class<?>) ((ParameterizedType) resolvedReturnType).getRawType();
} else {
this.returnType = method.getReturnType();
}
this.returnsVoid = void.class.equals(this.returnType);
this.returnsMany = configuration.getObjectFactory().isCollection(this.returnType) || this.returnType.isArray();
this.returnsCursor = Cursor.class.equals(this.returnType);
this.returnsOptional = Optional.class.equals(this.returnType);
this.mapKey = getMapKey(method);
this.returnsMap = this.mapKey != null;
this.rowBoundsIndex = getUniqueParamIndex(method, RowBounds.class);
this.resultHandlerIndex = getUniqueParamIndex(method, ResultHandler.class);
this.paramNameResolver = new ParamNameResolver(configuration, method);
}
public Object convertArgsToSqlCommandParam(Object[] args) {
return paramNameResolver.getNamedParams(args);
}
public boolean hasRowBounds() {
return rowBoundsIndex != null;
}
public RowBounds extractRowBounds(Object[] args) {
return hasRowBounds() ? (RowBounds) args[rowBoundsIndex] : null;
}
public boolean hasResultHandler() {
return resultHandlerIndex != null;
}
public ResultHandler extractResultHandler(Object[] args) {
return hasResultHandler() ? (ResultHandler) args[resultHandlerIndex] : null;
}
public String getMapKey() {
return mapKey;
}
public Class<?> getReturnType() {
return returnType;
}
public boolean returnsMany() {
return returnsMany;
}
public boolean returnsMap() {
return returnsMap;
}
public boolean returnsVoid() {
return returnsVoid;
}
public boolean returnsCursor() {
return returnsCursor;
}
/**
* return whether return type is {@code java.util.Optional}
*
* @return return {@code true}, if return type is {@code java.util.Optional}
* @since 3.5.0
*/
public boolean returnsOptional() {
return returnsOptional;
}
private Integer getUniqueParamIndex(Method method, Class<?> paramType) {
Integer index = null;
final Class<?>[] argTypes = method.getParameterTypes();
for (int i = 0; i < argTypes.length; i++) {
if (paramType.isAssignableFrom(argTypes[i])) {
if (index == null) {
index = i;
} else {
throw new BindingException(method.getName() + " cannot have multiple " + paramType.getSimpleName() + " parameters");
}
}
}
return index;
}
private String getMapKey(Method method) {
String mapKey = null;
if (Map.class.isAssignableFrom(method.getReturnType())) {
final MapKey mapKeyAnnotation = method.getAnnotation(MapKey.class);
if (mapKeyAnnotation != null) {
mapKey = mapKeyAnnotation.value();
}
}
return mapKey;
}
}
}

@ -0,0 +1,91 @@
/*
* Copyright (c) 2011-2020, hubin (jobob@qq.com).
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* <p>
* https://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.foreverwin.mesnac.console.mybatis.override;
import org.apache.ibatis.reflection.ExceptionUtil;
import org.apache.ibatis.session.SqlSession;
import java.io.Serializable;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Map;
/**
*
* <p> org.apache.ibatis.binding.MapperProxy</p>
*
* @author miemie
* @since 2018-06-09
*/
public class ExtMybatisMapperProxy<T> implements InvocationHandler, Serializable {
private static final long serialVersionUID = -6424540398559729838L;
private final SqlSession sqlSession;
private final Class<T> mapperInterface;
private final Map<Method, ExtMybatisMapperMethod> methodCache;
public ExtMybatisMapperProxy(SqlSession sqlSession, Class<T> mapperInterface, Map<Method, ExtMybatisMapperMethod> methodCache) {
this.sqlSession = sqlSession;
this.mapperInterface = mapperInterface;
this.methodCache = methodCache;
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
try {
if (Object.class.equals(method.getDeclaringClass())) {
return method.invoke(this, args);
} else if (isDefaultMethod(method)) {
return invokeDefaultMethod(proxy, method, args);
}
} catch (Throwable t) {
throw ExceptionUtil.unwrapThrowable(t);
}
final ExtMybatisMapperMethod mapperMethod = cachedMapperMethod(method);
return mapperMethod.execute(sqlSession, args);
}
private ExtMybatisMapperMethod cachedMapperMethod(Method method) {
return methodCache.computeIfAbsent(method, k -> new ExtMybatisMapperMethod(mapperInterface, method, sqlSession.getConfiguration()));
}
private Object invokeDefaultMethod(Object proxy, Method method, Object[] args)
throws Throwable {
final Constructor<MethodHandles.Lookup> constructor = MethodHandles.Lookup.class
.getDeclaredConstructor(Class.class, int.class);
if (!constructor.isAccessible()) {
constructor.setAccessible(true);
}
final Class<?> declaringClass = method.getDeclaringClass();
return constructor
.newInstance(declaringClass,
MethodHandles.Lookup.PRIVATE | MethodHandles.Lookup.PROTECTED
| MethodHandles.Lookup.PACKAGE | MethodHandles.Lookup.PUBLIC)
.unreflectSpecial(method, declaringClass).bindTo(proxy).invokeWithArguments(args);
}
/**
* Backport of java.lang.reflect.Method#isDefault()
*/
private boolean isDefaultMethod(Method method) {
return (method.getModifiers()
& (Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC)) == Modifier.PUBLIC
&& method.getDeclaringClass().isInterface();
}
}

@ -0,0 +1,43 @@
package com.foreverwin.mesnac.console.mybatis.override;
import com.baomidou.mybatisplus.core.override.MybatisMapperMethod;
import org.apache.ibatis.session.SqlSession;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
*
* @description:
* @author: syngna
* @create: 2021-04-16 17:34
*/
public class ExtMybatisMapperProxyFactory<T> {
private final Class<T> mapperInterface;
private final Map<Method, MybatisMapperMethod> methodCache = new ConcurrentHashMap<>();
public ExtMybatisMapperProxyFactory(Class<T> mapperInterface) {
this.mapperInterface = mapperInterface;
}
public Class<T> getMapperInterface() {
return mapperInterface;
}
public Map<Method, MybatisMapperMethod> getMethodCache() {
return methodCache;
}
protected T newInstance(ExtMybatisMapperProxy<T> mapperProxy) {
return (T) Proxy.newProxyInstance(mapperInterface.getClassLoader(), new Class[]{mapperInterface}, mapperProxy);
}
public T newInstance(SqlSession sqlSession) {
final ExtMybatisMapperProxy<T> mapperProxy = new ExtMybatisMapperProxy(sqlSession, mapperInterface, methodCache);
return newInstance(mapperProxy);
}
}

@ -0,0 +1,53 @@
package com.foreverwin.mesnac.console.mybatis.override;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.methods.Insert;
import com.baomidou.mybatisplus.extension.injector.methods.*;
/**
*
* @description:
* @author: syngna
* @create: 2021-04-18 17:14
*/
public class MethodFactory {
public static AbstractMethod getInstance(String methodName) {
if("insert".equals(methodName)) {
return new Insert();
} else if("delete".equals(methodName)) {
return new LogicDelete();
} else if("deleteByMap".equals(methodName)) {
return new LogicDeleteByMap();
} else if("deleteById".equals(methodName)) {
return new LogicDeleteById();
} else if("deleteBatchByIds".equals(methodName)) {
return new LogicDeleteBatchByIds();
} else if("update".equals(methodName)) {
return new LogicUpdate();
} else if("updateById".equals(methodName)) {
return new LogicUpdateById();
} else if("selectById".equals(methodName)) {
return new LogicSelectById();
} else if("selectBatchByIds".equals(methodName)) {
return new LogicSelectBatchByIds();
} else if("selectByMap".equals(methodName)) {
return new LogicSelectByMap();
} else if("selectOne".equals(methodName)) {
return new LogicSelectOne();
} else if("selectCount".equals(methodName)) {
return new LogicSelectCount();
} else if("selectMaps".equals(methodName)) {
return new LogicSelectMaps();
} else if("selectMapsPage".equals(methodName)) {
return new LogicSelectMapsPage();
} else if("selectObjs".equals(methodName)) {
return new LogicSelectObjs();
} else if("selectList".equals(methodName)) {
return new LogicSelectList();
} else if("selectPage".equals(methodName)) {
return new LogicSelectPage();
}
return null;
}
}

@ -54,6 +54,7 @@ mybatis-plus:
typeAliasesPackage: com.foreverwin.**.model
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
statement-lazy-load: false
#dialectClass: com.foreverwin.modular.core.mybatisplus.plugins.pagination.dialects.HanaDialect
# 加载全局的配置文件
# configuration:

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.dispatch.controller;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import com.foreverwin.modular.core.util.R;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.CommonMethods;
@ -26,15 +27,31 @@ public class SfcDispatchController {
public SfcDispatchService sfcDispatchService;
@ResponseBody
@GetMapping("getSfcDispatch")
public R getSfcDispatch() {
List<ShopOrderRelease> list;
try {
ShopOrderRelease shopOrderRelease = new ShopOrderRelease();
shopOrderRelease.setSite(CommonMethods.getSite());
list = sfcDispatchService.findSfcDispatchList(shopOrderRelease);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(list);
}
@ResponseBody
@PostMapping("querySfcDispatch")
public R querySfcDispatch(@RequestBody SfcDispatch sfcDispatch) {
List<SfcDispatch> list = null;
public R querySfcDispatch(@RequestBody ShopOrderRelease shopOrderRelease) {
List<ShopOrderRelease> list;
try {
sfcDispatch.setSite(CommonMethods.getSite());
shopOrderRelease.setSite(CommonMethods.getSite());
list = sfcDispatchService.selectList(sfcDispatch);
list = sfcDispatchService.findSfcDispatchList(shopOrderRelease);
} catch (Exception e) {
return R.failed(e.getMessage());
}
@ -91,8 +108,8 @@ public class SfcDispatchController {
.or().like(SfcDispatch::getWorkCenter, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getResrce, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getEmployee, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getTurnOrder, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getIsAllot, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getTurnOperation, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getIsDispatch, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getIsImport, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getRemark, frontPage.getGlobalQuery())
.or().like(SfcDispatch::getCreateUser, frontPage.getGlobalQuery())

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.dispatch.mapper;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@ -19,4 +20,6 @@ import java.util.List;
public interface SfcDispatchMapper extends BaseMapper<SfcDispatch> {
List<SfcDispatch> findSfcDispatch(@Param("site") String site, @Param("sfc") String sfc, @Param("operation") String operation, @Param("stepId") String stepId);
List<ShopOrderRelease> findSfcDispatchList(ShopOrderRelease shopOrderRelease);
}

@ -16,10 +16,11 @@ import com.baomidou.mybatisplus.annotation.IdType;
* </p>
*
* @author Leon.L
* @since 2021-06-02
* @since 2021-06-04
*/
@TableName("Z_SFC_DISPATCH")
public class SfcDispatch extends Model<SfcDispatch> {
private static final long serialVersionUID = 1L;
@ -58,7 +59,7 @@ public class SfcDispatch extends Model<SfcDispatch> {
*
*/
@TableField("DISPATCH_SEQ")
private Double dispatchSeq;
private String dispatchSeq;
/**
*
*/
@ -122,8 +123,8 @@ public class SfcDispatch extends Model<SfcDispatch> {
/**
*
*/
@TableField("TURN_ORDER")
private String turnOrder;
@TableField("TURN_OPERATION")
private String turnOperation;
/**
*
*/
@ -169,6 +170,11 @@ public class SfcDispatch extends Model<SfcDispatch> {
*/
@TableField("RELEASED_COMPLETE_DATE")
private LocalDateTime releasedCompleteDate;
/**
*
*/
@TableField("ACTUAL_START_DATE")
private LocalDateTime actualStartDate;
/**
*
*/
@ -177,8 +183,8 @@ public class SfcDispatch extends Model<SfcDispatch> {
/**
*
*/
@TableField("IS_ALLOT")
private String isAllot;
@TableField("IS_DISPATCH")
private String isDispatch;
/**
*
*/
@ -189,9 +195,9 @@ public class SfcDispatch extends Model<SfcDispatch> {
*/
@TableField("REMARK")
private String remark;
/**
*
*/
/**
*
*/
@TableField("IS_FIRST_OPERATION")
private String isFirstOperation;
/**
@ -274,11 +280,11 @@ public class SfcDispatch extends Model<SfcDispatch> {
this.isMajor = isMajor;
}
public Double getDispatchSeq() {
public String getDispatchSeq() {
return dispatchSeq;
}
public void setDispatchSeq(Double dispatchSeq) {
public void setDispatchSeq(String dispatchSeq) {
this.dispatchSeq = dispatchSeq;
}
@ -378,12 +384,12 @@ public class SfcDispatch extends Model<SfcDispatch> {
this.employee = employee;
}
public String getTurnOrder() {
return turnOrder;
public String getTurnOperation() {
return turnOperation;
}
public void setTurnOrder(String turnOrder) {
this.turnOrder = turnOrder;
public void setTurnOperation(String turnOperation) {
this.turnOperation = turnOperation;
}
public Double getDispatchQty() {
@ -458,6 +464,14 @@ public class SfcDispatch extends Model<SfcDispatch> {
this.releasedCompleteDate = releasedCompleteDate;
}
public LocalDateTime getActualStartDate() {
return actualStartDate;
}
public void setActualStartDate(LocalDateTime actualStartDate) {
this.actualStartDate = actualStartDate;
}
public LocalDateTime getActualCompleteDate() {
return actualCompleteDate;
}
@ -466,12 +480,12 @@ public class SfcDispatch extends Model<SfcDispatch> {
this.actualCompleteDate = actualCompleteDate;
}
public String getIsAllot() {
return isAllot;
public String getIsDispatch() {
return isDispatch;
}
public void setIsAllot(String isAllot) {
this.isAllot = isAllot;
public void setIsDispatch(String isDispatch) {
this.isDispatch = isDispatch;
}
public String getIsImport() {
@ -570,89 +584,93 @@ public class SfcDispatch extends Model<SfcDispatch> {
this.other5 = other5;
}
public static final String HANDLE = "HANDLE";
public static final String HANDLE = "HANDLE";
public static final String SITE = "SITE";
public static final String SHOP_ORDER = "SHOP_ORDER";
public static final String SITE = "SITE";
public static final String WORK_ORDER = "WORK_ORDER";
public static final String SHOP_ORDER = "SHOP_ORDER";
public static final String SFC = "SFC";
public static final String WORK_ORDER = "WORK_ORDER";
public static final String IS_MAJOR = "IS_MAJOR";
public static final String SFC = "SFC";
public static final String DISPATCH_SEQ = "DISPATCH_SEQ";
public static final String IS_MAJOR = "IS_MAJOR";
public static final String DISPATCH_NO = "DISPATCH_NO";
public static final String DISPATCH_SEQ = "DISPATCH_SEQ";
public static final String DISPATCH_STATUS = "DISPATCH_STATUS";
public static final String DISPATCH_NO = "DISPATCH_NO";
public static final String DRAWINGS_NO = "DRAWINGS_NO";
public static final String DISPATCH_STATUS = "DISPATCH_STATUS";
public static final String DRAWINGS_REVISION = "DRAWINGS_REVISION";
public static final String DRAWINGS_NO = "DRAWINGS_NO";
public static final String IS_LOCK = "IS_LOCK";
public static final String DRAWINGS_REVISION = "DRAWINGS_REVISION";
public static final String ROUTER_BO = "ROUTER_BO";
public static final String IS_LOCK = "IS_LOCK";
public static final String STEP_ID = "STEP_ID";
public static final String ROUTER_BO = "ROUTER_BO";
public static final String OPERATION = "OPERATION";
public static final String STEP_ID = "STEP_ID";
public static final String RESOURCE_TYPE = "RESOURCE_TYPE";
public static final String OPERATION = "OPERATION";
public static final String WORK_CENTER = "WORK_CENTER";
public static final String RESOURCE_TYPE = "RESOURCE_TYPE";
public static final String RESRCE = "RESRCE";
public static final String WORK_CENTER = "WORK_CENTER";
public static final String EMPLOYEE = "EMPLOYEE";
public static final String RESRCE = "RESRCE";
public static final String TURN_OPERATION = "TURN_OPERATION";
public static final String EMPLOYEE = "EMPLOYEE";
public static final String DISPATCH_QTY = "DISPATCH_QTY";
public static final String TURN_ORDER = "TURN_ORDER";
public static final String PROD_HOURS = "PROD_HOURS";
public static final String DISPATCH_QTY = "DISPATCH_QTY";
public static final String PLANNED_START_DATE = "PLANNED_START_DATE";
public static final String PROD_HOURS = "PROD_HOURS";
public static final String PLANNED_COMPLETE_DATE = "PLANNED_COMPLETE_DATE";
public static final String PLANNED_START_DATE = "PLANNED_START_DATE";
public static final String EARLIEST_START_DATE = "EARLIEST_START_DATE";
public static final String PLANNED_COMPLETE_DATE = "PLANNED_COMPLETE_DATE";
public static final String LATEST_END_DATE = "LATEST_END_DATE";
public static final String EARLIEST_START_DATE = "EARLIEST_START_DATE";
public static final String SO_RELEASED_DATE = "SO_RELEASED_DATE";
public static final String LATEST_END_DATE = "LATEST_END_DATE";
public static final String SFC_RELEASED_DATE = "SFC_RELEASED_DATE";
public static final String SO_RELEASED_DATE = "SO_RELEASED_DATE";
public static final String RELEASED_COMPLETE_DATE = "RELEASED_COMPLETE_DATE";
public static final String SFC_RELEASED_DATE = "SFC_RELEASED_DATE";
public static final String ACTUAL_START_DATE = "ACTUAL_START_DATE";
public static final String RELEASED_COMPLETE_DATE = "RELEASED_COMPLETE_DATE";
public static final String ACTUAL_COMPLETE_DATE = "ACTUAL_COMPLETE_DATE";
public static final String ACTUAL_COMPLETE_DATE = "ACTUAL_COMPLETE_DATE";
public static final String IS_DISPATCH = "IS_DISPATCH";
public static final String IS_ALLOT = "IS_ALLOT";
public static final String IS_IMPORT = "IS_IMPORT";
public static final String IS_IMPORT = "IS_IMPORT";
public static final String REMARK = "REMARK";
public static final String REMARK = "REMARK";
public static final String IS_FIRST_OPERATION = "IS_FIRST_OPERATION";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATE_USER = "CREATE_USER";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFY_USER = "MODIFY_USER";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public static final String MODIFIED_DATE_TIME = "MODIFIED_DATE_TIME";
public static final String OTHER_1 = "OTHER_1";
public static final String OTHER_1 = "OTHER_1";
public static final String OTHER_2 = "OTHER_2";
public static final String OTHER_2 = "OTHER_2";
public static final String OTHER_3 = "OTHER_3";
public static final String OTHER_3 = "OTHER_3";
public static final String OTHER_4 = "OTHER_4";
public static final String OTHER_4 = "OTHER_4";
public static final String OTHER_5 = "OTHER_5";
public static final String OTHER_5 = "OTHER_5";
@Override
@ -682,7 +700,7 @@ public static final String OTHER_5 = "OTHER_5";
", workCenter = " + workCenter +
", resrce = " + resrce +
", employee = " + employee +
", turnOrder = " + turnOrder +
", turnOperation = " + turnOperation +
", dispatchQty = " + dispatchQty +
", prodHours = " + prodHours +
", plannedStartDate = " + plannedStartDate +
@ -692,10 +710,12 @@ public static final String OTHER_5 = "OTHER_5";
", soReleasedDate = " + soReleasedDate +
", sfcReleasedDate = " + sfcReleasedDate +
", releasedCompleteDate = " + releasedCompleteDate +
", actualStartDate = " + actualStartDate +
", actualCompleteDate = " + actualCompleteDate +
", isAllot = " + isAllot +
", isDispatch = " + isDispatch +
", isImport = " + isImport +
", remark = " + remark +
", isFirstOperation = " + isFirstOperation +
", createUser = " + createUser +
", createdDateTime = " + createdDateTime +
", modifyUser = " + modifyUser +

@ -31,6 +31,9 @@ public class ShopOrderRelease extends SfcDispatch {
private String category;
private String status;
private String comments;
private String component;
private String componentDescription;
private String isCompleted;
private LocalDateTime plannedStartDate;
private LocalDateTime plannedCompDate;
@ -136,6 +139,30 @@ public class ShopOrderRelease extends SfcDispatch {
this.dispatchCompleteDate = dispatchCompleteDate;
}
public String getComponent() {
return component;
}
public void setComponent(String component) {
this.component = component;
}
public String getComponentDescription() {
return componentDescription;
}
public void setComponentDescription(String componentDescription) {
this.componentDescription = componentDescription;
}
public String getIsCompleted() {
return isCompleted;
}
public void setIsCompleted(String isCompleted) {
this.isCompleted = isCompleted;
}
public Date getStartFromDate() {
return startFromDate;
}

@ -3,6 +3,7 @@ package com.foreverwin.mesnac.dispatch.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.dispatch.model.SfcDispatch;
import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import com.foreverwin.modular.core.util.FrontPage;
import java.util.List;
@ -36,4 +37,12 @@ public interface SfcDispatchService extends IService<SfcDispatch> {
* @return
*/
List<SfcDispatch> findSfcDispatch(String site, String sfc, String operation, String stepId);
/**
*
*
* @param shopOrderRelease
* @return
*/
List<ShopOrderRelease> findSfcDispatchList(ShopOrderRelease shopOrderRelease);
}

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.dispatch.service.impl;
import com.foreverwin.mesnac.dispatch.model.ShopOrderRelease;
import com.foreverwin.modular.core.util.FrontPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -47,5 +48,10 @@ public class SfcDispatchServiceImpl extends ServiceImpl<SfcDispatchMapper, SfcDi
return sfcDispatchMapper.findSfcDispatch(site, sfc, operation, stepId);
}
@Override
public List<ShopOrderRelease> findSfcDispatchList(ShopOrderRelease shopOrderRelease) {
return sfcDispatchMapper.findSfcDispatchList(shopOrderRelease);
}
}

@ -227,7 +227,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setSfc(sfc);
sfcDispatchModel.setWorkOrder("");
sfcDispatchModel.setIsMajor("");
sfcDispatchModel.setDispatchSeq(new Double(m+1));
sfcDispatchModel.setDispatchSeq((m + 1)+"");
sfcDispatchModel.setDispatchNo(dispatchNo);
sfcDispatchModel.setDispatchStatus(Constants.STATUS_NEW);
sfcDispatchModel.setDrawingsNo("");
@ -243,7 +243,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
//sfcDispatchModel.setPlannedStartDate(plannedStartDate);
//sfcDispatchModel.setPlannedCompleteDate(plannedCompleteDate);
sfcDispatchModel.setSoReleasedDate(nowDate);
sfcDispatchModel.setIsAllot(Constants.BOOL_FALSE);
sfcDispatchModel.setIsDispatch(Constants.BOOL_FALSE);
sfcDispatchModel.setIsImport(Constants.BOOL_FALSE);
sfcDispatchModel.setIsFirstOperation(isFirstOperation);
sfcDispatchModel.setCreateUser(user);
@ -410,7 +410,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
sfcDispatchModel.setSfc(sfc);
sfcDispatchModel.setWorkOrder("");
sfcDispatchModel.setIsMajor("");
sfcDispatchModel.setDispatchSeq(new Double(m + 1));
sfcDispatchModel.setDispatchSeq((m + 1)+"");
sfcDispatchModel.setDispatchNo(dispatchNo);
sfcDispatchModel.setDispatchStatus(Constants.STATUS_NEW);
sfcDispatchModel.setDrawingsNo("");
@ -426,7 +426,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
//sfcDispatchModel.setPlannedStartDate(plannedStartDate);
//sfcDispatchModel.setPlannedCompleteDate(plannedCompleteDate);
sfcDispatchModel.setSoReleasedDate(nowDate);
sfcDispatchModel.setIsAllot(Constants.BOOL_FALSE);
sfcDispatchModel.setIsDispatch(Constants.BOOL_FALSE);
sfcDispatchModel.setIsImport(Constants.BOOL_FALSE);
sfcDispatchModel.setCreateUser(user);
sfcDispatchModel.setCreatedDateTime(nowDate);
@ -436,7 +436,7 @@ public class ShopOrderReleaseServiceImpl implements ShopOrderReleaseService {
} else {
//已经存在的更新
SfcDispatch sfcDispatchModel = list.get(0);
sfcDispatchModel.setDispatchSeq(new Double(m + 1));
sfcDispatchModel.setDispatchSeq((m + 1)+"");
sfcDispatchModel.setModifyUser(user);
sfcDispatchModel.setModifiedDateTime(nowDate);
updateSfcDispatchList.add(sfcDispatchModel);

@ -23,7 +23,7 @@
<result column="WORK_CENTER" property="workCenter" />
<result column="RESRCE" property="resrce" />
<result column="EMPLOYEE" property="employee" />
<result column="TURN_ORDER" property="turnOrder" />
<result column="TURN_OPERATION" property="turnOperation" />
<result column="DISPATCH_QTY" property="dispatchQty" />
<result column="PROD_HOURS" property="prodHours" />
<result column="PLANNED_START_DATE" property="plannedStartDate" />
@ -33,8 +33,9 @@
<result column="SO_RELEASED_DATE" property="soReleasedDate" />
<result column="SFC_RELEASED_DATE" property="sfcReleasedDate" />
<result column="RELEASED_COMPLETE_DATE" property="releasedCompleteDate" />
<result column="ACTUAL_START_DATE" property="actualStartDate" />
<result column="ACTUAL_COMPLETE_DATE" property="actualCompleteDate" />
<result column="IS_ALLOT" property="isAllot" />
<result column="IS_DISPATCH" property="isDispatch" />
<result column="IS_IMPORT" property="isImport" />
<result column="REMARK" property="remark" />
<result column="IS_FIRST_OPERATION" property="isFirstOperation" />
@ -49,9 +50,17 @@
<result column="OTHER_5" property="other5" />
</resultMap>
<resultMap id="FullResultMap" type="com.foreverwin.mesnac.dispatch.model.ShopOrderRelease">
<result column="IS_COMPLETED" property="isCompleted" />
<result column="ITEM" property="item" />
<result column="ITEM_DESCRIPTION" property="itemDescription" />
<result column="COMPONENT" property="component" />
<result column="COMPONENT_DESCRIPTION" property="componentDescription" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
HANDLE, SITE, SHOP_ORDER, WORK_ORDER, SFC, IS_MAJOR, DISPATCH_SEQ, DISPATCH_NO, DISPATCH_STATUS, DRAWINGS_NO, DRAWINGS_REVISION, IS_LOCK, ROUTER_BO, STEP_ID, OPERATION, RESOURCE_TYPE, WORK_CENTER, RESRCE, EMPLOYEE, TURN_ORDER, DISPATCH_QTY, PROD_HOURS, PLANNED_START_DATE, PLANNED_COMPLETE_DATE, EARLIEST_START_DATE, LATEST_END_DATE, SO_RELEASED_DATE, SFC_RELEASED_DATE, RELEASED_COMPLETE_DATE, ACTUAL_COMPLETE_DATE, IS_ALLOT, IS_IMPORT, REMARK, IS_FIRST_OPERATION, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, OTHER_1, OTHER_2, OTHER_3, OTHER_4, OTHER_5
HANDLE, SITE, SHOP_ORDER, WORK_ORDER, SFC, IS_MAJOR, DISPATCH_SEQ, DISPATCH_NO, DISPATCH_STATUS, DRAWINGS_NO, DRAWINGS_REVISION, IS_LOCK, ROUTER_BO, STEP_ID, OPERATION, RESOURCE_TYPE, WORK_CENTER, RESRCE, EMPLOYEE, TURN_OPERATION, DISPATCH_QTY, PROD_HOURS, PLANNED_START_DATE, PLANNED_COMPLETE_DATE, EARLIEST_START_DATE, LATEST_END_DATE, SO_RELEASED_DATE, SFC_RELEASED_DATE, RELEASED_COMPLETE_DATE, ACTUAL_START_DATE, ACTUAL_COMPLETE_DATE, IS_DISPATCH, IS_IMPORT, REMARK, IS_FIRST_OPERATION, CREATE_USER, CREATED_DATE_TIME, MODIFY_USER, MODIFIED_DATE_TIME, OTHER_1, OTHER_2, OTHER_3, OTHER_4, OTHER_5
</sql>
<!-- BaseMapper标准查询/修改/删除 -->
@ -104,7 +113,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOrder!=null"> AND TURN_ORDER=#{ew.entity.turnOrder}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
@ -114,8 +123,9 @@
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isAllot!=null"> AND IS_ALLOT=#{ew.entity.isAllot}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
@ -157,7 +167,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOrder!=null"> AND TURN_ORDER=#{ew.entity.turnOrder}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
@ -167,8 +177,9 @@
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isAllot!=null"> AND IS_ALLOT=#{ew.entity.isAllot}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
@ -218,7 +229,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOrder!=null"> AND TURN_ORDER=#{ew.entity.turnOrder}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
@ -228,8 +239,9 @@
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isAllot!=null"> AND IS_ALLOT=#{ew.entity.isAllot}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
@ -279,7 +291,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOrder!=null"> AND TURN_ORDER=#{ew.entity.turnOrder}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
@ -289,8 +301,9 @@
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isAllot!=null"> AND IS_ALLOT=#{ew.entity.isAllot}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
@ -340,7 +353,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOrder!=null"> AND TURN_ORDER=#{ew.entity.turnOrder}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
@ -350,8 +363,9 @@
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isAllot!=null"> AND IS_ALLOT=#{ew.entity.isAllot}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
@ -401,7 +415,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOrder!=null"> AND TURN_ORDER=#{ew.entity.turnOrder}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
@ -411,8 +425,9 @@
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isAllot!=null"> AND IS_ALLOT=#{ew.entity.isAllot}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
@ -462,7 +477,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOrder!=null"> AND TURN_ORDER=#{ew.entity.turnOrder}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
@ -472,8 +487,9 @@
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isAllot!=null"> AND IS_ALLOT=#{ew.entity.isAllot}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
@ -519,7 +535,7 @@
<if test="workCenter!=null">WORK_CENTER,</if>
<if test="resrce!=null">RESRCE,</if>
<if test="employee!=null">EMPLOYEE,</if>
<if test="turnOrder!=null">TURN_ORDER,</if>
<if test="turnOperation!=null">TURN_OPERATION,</if>
<if test="dispatchQty!=null">DISPATCH_QTY,</if>
<if test="prodHours!=null">PROD_HOURS,</if>
<if test="plannedStartDate!=null">PLANNED_START_DATE,</if>
@ -529,8 +545,9 @@
<if test="soReleasedDate!=null">SO_RELEASED_DATE,</if>
<if test="sfcReleasedDate!=null">SFC_RELEASED_DATE,</if>
<if test="releasedCompleteDate!=null">RELEASED_COMPLETE_DATE,</if>
<if test="actualStartDate!=null">ACTUAL_START_DATE,</if>
<if test="actualCompleteDate!=null">ACTUAL_COMPLETE_DATE,</if>
<if test="isAllot!=null">IS_ALLOT,</if>
<if test="isDispatch!=null">IS_DISPATCH,</if>
<if test="isImport!=null">IS_IMPORT,</if>
<if test="remark!=null">REMARK,</if>
<if test="isFirstOperation!=null">IS_FIRST_OPERATION,</if>
@ -564,7 +581,7 @@
<if test="workCenter!=null">#{workCenter},</if>
<if test="resrce!=null">#{resrce},</if>
<if test="employee!=null">#{employee},</if>
<if test="turnOrder!=null">#{turnOrder},</if>
<if test="turnOperation!=null">#{turnOperation},</if>
<if test="dispatchQty!=null">#{dispatchQty},</if>
<if test="prodHours!=null">#{prodHours},</if>
<if test="plannedStartDate!=null">#{plannedStartDate},</if>
@ -574,8 +591,9 @@
<if test="soReleasedDate!=null">#{soReleasedDate},</if>
<if test="sfcReleasedDate!=null">#{sfcReleasedDate},</if>
<if test="releasedCompleteDate!=null">#{releasedCompleteDate},</if>
<if test="actualStartDate!=null">#{actualStartDate},</if>
<if test="actualCompleteDate!=null">#{actualCompleteDate},</if>
<if test="isAllot!=null">#{isAllot},</if>
<if test="isDispatch!=null">#{isDispatch},</if>
<if test="isImport!=null">#{isImport},</if>
<if test="remark!=null">#{remark},</if>
<if test="isFirstOperation!=null">#{isFirstOperation},</if>
@ -616,7 +634,7 @@
#{workCenter},
#{resrce},
#{employee},
#{turnOrder},
#{turnOperation},
#{dispatchQty},
#{prodHours},
#{plannedStartDate},
@ -626,8 +644,9 @@
#{soReleasedDate},
#{sfcReleasedDate},
#{releasedCompleteDate},
#{actualStartDate},
#{actualCompleteDate},
#{isAllot},
#{isDispatch},
#{isImport},
#{remark},
#{isFirstOperation},
@ -664,7 +683,7 @@
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.employee!=null">EMPLOYEE=#{et.employee},</if>
<if test="et.turnOrder!=null">TURN_ORDER=#{et.turnOrder},</if>
<if test="et.turnOperation!=null">TURN_OPERATION=#{et.turnOperation},</if>
<if test="et.dispatchQty!=null">DISPATCH_QTY=#{et.dispatchQty},</if>
<if test="et.prodHours!=null">PROD_HOURS=#{et.prodHours},</if>
<if test="et.plannedStartDate!=null">PLANNED_START_DATE=#{et.plannedStartDate},</if>
@ -674,8 +693,9 @@
<if test="et.soReleasedDate!=null">SO_RELEASED_DATE=#{et.soReleasedDate},</if>
<if test="et.sfcReleasedDate!=null">SFC_RELEASED_DATE=#{et.sfcReleasedDate},</if>
<if test="et.releasedCompleteDate!=null">RELEASED_COMPLETE_DATE=#{et.releasedCompleteDate},</if>
<if test="et.actualStartDate!=null">ACTUAL_START_DATE=#{et.actualStartDate},</if>
<if test="et.actualCompleteDate!=null">ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},</if>
<if test="et.isAllot!=null">IS_ALLOT=#{et.isAllot},</if>
<if test="et.isDispatch!=null">IS_DISPATCH=#{et.isDispatch},</if>
<if test="et.isImport!=null">IS_IMPORT=#{et.isImport},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.isFirstOperation!=null">IS_FIRST_OPERATION=#{et.isFirstOperation},</if>
@ -712,7 +732,7 @@
WORK_CENTER=#{et.workCenter},
RESRCE=#{et.resrce},
EMPLOYEE=#{et.employee},
TURN_ORDER=#{et.turnOrder},
TURN_OPERATION=#{et.turnOperation},
DISPATCH_QTY=#{et.dispatchQty},
PROD_HOURS=#{et.prodHours},
PLANNED_START_DATE=#{et.plannedStartDate},
@ -722,8 +742,9 @@
SO_RELEASED_DATE=#{et.soReleasedDate},
SFC_RELEASED_DATE=#{et.sfcReleasedDate},
RELEASED_COMPLETE_DATE=#{et.releasedCompleteDate},
ACTUAL_START_DATE=#{et.actualStartDate},
ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},
IS_ALLOT=#{et.isAllot},
IS_DISPATCH=#{et.isDispatch},
IS_IMPORT=#{et.isImport},
REMARK=#{et.remark},
IS_FIRST_OPERATION=#{et.isFirstOperation},
@ -760,7 +781,7 @@
<if test="et.workCenter!=null">WORK_CENTER=#{et.workCenter},</if>
<if test="et.resrce!=null">RESRCE=#{et.resrce},</if>
<if test="et.employee!=null">EMPLOYEE=#{et.employee},</if>
<if test="et.turnOrder!=null">TURN_ORDER=#{et.turnOrder},</if>
<if test="et.turnOperation!=null">TURN_OPERATION=#{et.turnOperation},</if>
<if test="et.dispatchQty!=null">DISPATCH_QTY=#{et.dispatchQty},</if>
<if test="et.prodHours!=null">PROD_HOURS=#{et.prodHours},</if>
<if test="et.plannedStartDate!=null">PLANNED_START_DATE=#{et.plannedStartDate},</if>
@ -770,8 +791,9 @@
<if test="et.soReleasedDate!=null">SO_RELEASED_DATE=#{et.soReleasedDate},</if>
<if test="et.sfcReleasedDate!=null">SFC_RELEASED_DATE=#{et.sfcReleasedDate},</if>
<if test="et.releasedCompleteDate!=null">RELEASED_COMPLETE_DATE=#{et.releasedCompleteDate},</if>
<if test="et.actualStartDate!=null">ACTUAL_START_DATE=#{et.actualStartDate},</if>
<if test="et.actualCompleteDate!=null">ACTUAL_COMPLETE_DATE=#{et.actualCompleteDate},</if>
<if test="et.isAllot!=null">IS_ALLOT=#{et.isAllot},</if>
<if test="et.isDispatch!=null">IS_DISPATCH=#{et.isDispatch},</if>
<if test="et.isImport!=null">IS_IMPORT=#{et.isImport},</if>
<if test="et.remark!=null">REMARK=#{et.remark},</if>
<if test="et.isFirstOperation!=null">IS_FIRST_OPERATION=#{et.isFirstOperation},</if>
@ -807,7 +829,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOrder!=null"> AND TURN_ORDER=#{ew.entity.turnOrder}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
@ -817,8 +839,9 @@
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isAllot!=null"> AND IS_ALLOT=#{ew.entity.isAllot}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
@ -885,7 +908,7 @@
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.employee!=null"> AND EMPLOYEE=#{ew.entity.employee}</if>
<if test="ew.entity.turnOrder!=null"> AND TURN_ORDER=#{ew.entity.turnOrder}</if>
<if test="ew.entity.turnOperation!=null"> AND TURN_OPERATION=#{ew.entity.turnOperation}</if>
<if test="ew.entity.dispatchQty!=null"> AND DISPATCH_QTY=#{ew.entity.dispatchQty}</if>
<if test="ew.entity.prodHours!=null"> AND PROD_HOURS=#{ew.entity.prodHours}</if>
<if test="ew.entity.plannedStartDate!=null"> AND PLANNED_START_DATE=#{ew.entity.plannedStartDate}</if>
@ -895,8 +918,9 @@
<if test="ew.entity.soReleasedDate!=null"> AND SO_RELEASED_DATE=#{ew.entity.soReleasedDate}</if>
<if test="ew.entity.sfcReleasedDate!=null"> AND SFC_RELEASED_DATE=#{ew.entity.sfcReleasedDate}</if>
<if test="ew.entity.releasedCompleteDate!=null"> AND RELEASED_COMPLETE_DATE=#{ew.entity.releasedCompleteDate}</if>
<if test="ew.entity.actualStartDate!=null"> AND ACTUAL_START_DATE=#{ew.entity.actualStartDate}</if>
<if test="ew.entity.actualCompleteDate!=null"> AND ACTUAL_COMPLETE_DATE=#{ew.entity.actualCompleteDate}</if>
<if test="ew.entity.isAllot!=null"> AND IS_ALLOT=#{ew.entity.isAllot}</if>
<if test="ew.entity.isDispatch!=null"> AND IS_DISPATCH=#{ew.entity.isDispatch}</if>
<if test="ew.entity.isImport!=null"> AND IS_IMPORT=#{ew.entity.isImport}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.isFirstOperation!=null"> AND IS_FIRST_OPERATION=#{ew.entity.isFirstOperation}</if>
@ -911,12 +935,12 @@
<if test="ew.entity.other5!=null"> AND OTHER_5=#{ew.entity.other5}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
AND ${ew.sqlSegment}
${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
AND ${ew.sqlSegment}
${ew.sqlSegment}
</if>
</delete>
@ -938,4 +962,80 @@
AND STEP_ID = #{stepId}
</if>
</select>
<select id="findSfcDispatchList" resultMap="FullResultMap">
SELECT WIP.*, CASE WHEN WIP.DISPATCH_SEQ = 1 THEN WIP.PLANNED_START_DATE ELSE V1.PLANNED_COMPLETE_DATE END EARLIEST_START_DATE,
CASE WHEN V2.HANDLE IS NOT NULL THEN V2.PLANNED_START_DATE ELSE WIP.PLANNED_COMPLETE_DATE END LATEST_END_DATE,
CASE WHEN WIP.DISPATCH_SEQ = 1 OR V1.OTHER_1 = 'true' THEN N'是' ELSE N'否' END IS_COMPLETED
FROM (
SELECT DISTINCT SD.HANDLE, SD.SITE, SD.SHOP_ORDER, SD.DISPATCH_NO, C1.VALUE WORK_ORDER, IM.ITEM, IT.DESCRIPTION ITEM_DESCRIPTION, SD.SFC, SD.DISPATCH_STATUS,
SD.STEP_ID, SD.OPERATION, OT.DESCRIPTION OPERATION_DESCRIPTION, SD.RESOURCE_TYPE, SD.RESRCE, SD.EMPLOYEE, SD.DISPATCH_QTY, SD.PROD_HOURS,
CASE WHEN OTHER_1 = 'true' THEN SD.DISPATCH_QTY ELSE 0 END COMPLETED_QTY, SD.TURN_OPERATION, SD.PLANNED_START_DATE, SD.PLANNED_COMPLETE_DATE,
SD.ACTUAL_START_DATE, SD.ACTUAL_COMPLETE_DATE, SD.REMARK, SD.DISPATCH_SEQ, SD.DISPATCH_SEQ-1 BEFORE_SEQ, SD.DISPATCH_SEQ+1 AFTER_SEQ,
SD.WORK_CENTER, SD.IS_DISPATCH
FROM Z_SFC_DISPATCH SD
INNER JOIN SHOP_ORDER SO ON SO.SITE = SD.SITE AND SO.SHOP_ORDER = SD.SHOP_ORDER
LEFT JOIN CUSTOM_FIELDS C1 ON C1.HANDLE = SO.HANDLE AND C1."ATTRIBUTE" = 'ITEM_NUMBER'
INNER JOIN ITEM IM ON IM.HANDLE = SO.ITEM_BO
LEFT JOIN ITEM_T IT ON IT.ITEM_BO = IM.HANDLE AND IT.LOCALE = 'zh'
INNER JOIN OPERATION O ON O.SITE = SD.SITE AND O.OPERATION = SD.OPERATION AND O.CURRENT_REVISION = 'true'
LEFT JOIN OPERATION_T OT ON OT.OPERATION_BO = O.HANDLE AND OT.LOCALE = 'zh'
INNER JOIN BOM_COMPONENT BC ON BC.BOM_BO = SO.BOM_BO
INNER JOIN ITEM CP ON CP.HANDLE = BC.COMPONENT_GBO
LEFT JOIN ITEM_T CPT ON CPT.ITEM_BO = CP.HANDLE AND CPT.LOCALE = 'zh'
WHERE SD.SITE = #{site}
<if test="workCenter != null and workCenter != ''">
AND SD.WORK_CENTER = #{workCenter}
</if>
<if test="dispatchStatus != null and dispatchStatus != ''">
AND SD.DISPATCH_STATUS = #{dispatchStatus}
</if>
<if test="item != null and item != ''">
AND IM.ITEM = #{item}
</if>
<if test="workOrder != null and workOrder != ''">
AND C1.VALUE = #{workOrder}
</if>
<if test="shopOrder != null and shopOrder != ''">
AND SD.SHOP_ORDER = #{shopOrder}
</if>
<if test="resourceType != null and resourceType != ''">
AND SD.RESOURCE_TYPE = #{resourceType}
</if>
<if test="resrce != null and resrce != ''">
AND SD.RESRCE = #{resrce}
</if>
<if test="operation != null and operation != ''">
AND SD.OPERATION = #{operation}
</if>
<if test="sfc != null and sfc != ''">
AND SD.SFC = #{sfc}
</if>
<if test="turnOperation != null and turnOperation != ''">
AND SD.TURN_OPERATION = #{turnOperation}
</if>
<if test="componentDescription != null and componentDescription != ''">
AND CPT.DESCRIPTION LIKE '%' || #{componentDescription} || '%'
</if>
<if test="isDispatch != null and isDispatch != ''">
AND SD.IS_DISPATCH = #{isDispatch}
</if>
<if test="startFromDate != null">
AND SD.PLANNED_START_DATE >= #{startFromDate}
</if>
<if test="startToDate != null">
AND SD.PLANNED_START_DATE &lt;= #{startToDate}
</if>
<if test="completeFromDate != null">
AND SD.PLANNED_COMPLETE_DATE >= #{completeFromDate}
</if>
<if test="completeToDate != null">
AND SD.PLANNED_COMPLETE_DATE &lt;= #{completeToDate}
</if>
) WIP
LEFT JOIN Z_SFC_DISPATCH V1 ON V1.SITE = WIP.SITE AND V1.SFC = WIP.SFC AND V1.DISPATCH_SEQ = WIP.BEFORE_SEQ
LEFT JOIN Z_SFC_DISPATCH V2 ON V2.SITE = WIP.SITE AND V2.SFC = WIP.SFC AND V2.DISPATCH_SEQ = WIP.AFTER_SEQ
ORDER BY WIP.SFC, TO_NUMBER(WIP.DISPATCH_SEQ)
</select>
</mapper>

@ -41,6 +41,19 @@ public class ResrceController {
return R.ok(result);
}
@GetMapping("/getResourceListByType")
public R getResourceListByType(String resourceType) {
List<Resrce> result;
try {
String site = CommonMethods.getSite();
result = resrceService.getResourceListByType(site, resourceType);
} catch (Exception e) {
return R.failed(e.getMessage());
}
return R.ok(result);
}
/**
*
*

@ -51,30 +51,29 @@ public class SfcController {
@GetMapping("/page")
public R page(FrontPage<Sfc> frontPage, Sfc sfc){
IPage result;
QueryWrapper<Sfc> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfc);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query
queryWrapper.lambda().and(wrapper -> wrapper
.like(Sfc::getHandle, frontPage.getGlobalQuery())
.or().like(Sfc::getSite, frontPage.getGlobalQuery())
.or().like(Sfc::getSfc, frontPage.getGlobalQuery())
.or().like(Sfc::getStatusBo, frontPage.getGlobalQuery())
.or().like(Sfc::getShopOrderBo, frontPage.getGlobalQuery())
.or().like(Sfc::getItemBo, frontPage.getGlobalQuery())
.or().like(Sfc::getLocation, frontPage.getGlobalQuery())
.or().like(Sfc::getLccBo, frontPage.getGlobalQuery())
.or().like(Sfc::getOriginalStatusBo, frontPage.getGlobalQuery())
.or().like(Sfc::getQtyMultPerformed, frontPage.getGlobalQuery())
.or().like(Sfc::getPrevSite, frontPage.getGlobalQuery())
.or().like(Sfc::getOriginalTransferKey, frontPage.getGlobalQuery())
.or().like(Sfc::getImmediateArchive, frontPage.getGlobalQuery())
.or().like(Sfc::getTransferUser, frontPage.getGlobalQuery())
.or().like(Sfc::getSnDone, frontPage.getGlobalQuery())
.or().like(Sfc::getAinEquipmentId, frontPage.getGlobalQuery())
);
try {
String site = CommonMethods.getSite();
sfc.setSite(site);
QueryWrapper<Sfc> queryWrapper = new QueryWrapper<>();
queryWrapper.setEntity(sfc);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
queryWrapper
.like(Sfc.HANDLE, frontPage.getGlobalQuery())
.or().like(Sfc.SITE, frontPage.getGlobalQuery())
.or().like(Sfc.SFC, frontPage.getGlobalQuery())
.or().like(Sfc.STATUS_BO, frontPage.getGlobalQuery())
.or().like(Sfc.SHOP_ORDER_BO, frontPage.getGlobalQuery())
.or().like(Sfc.ITEM_BO, frontPage.getGlobalQuery())
.or().like(Sfc.ORIGINAL_STATUS_BO, frontPage.getGlobalQuery())
.or().like(Sfc.SN_DONE, frontPage.getGlobalQuery());
}
result = sfcService.page(frontPage.getPagePlus(), queryWrapper);
} catch (Exception e) {
return R.failed(e.getMessage());
}
result = sfcService.page(frontPage.getPagePlus(), queryWrapper);
return R.ok(result);
}

@ -2,8 +2,11 @@ package com.foreverwin.mesnac.meapi.mapper;
import com.foreverwin.mesnac.meapi.model.Resrce;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper
@ -15,4 +18,5 @@ import org.springframework.stereotype.Repository;
@Repository
public interface ResrceMapper extends BaseMapper<Resrce> {
List<Resrce> selectResourceListByType(@Param("site") String site, @Param("resourceType") String resourceType);
}

@ -25,4 +25,13 @@ public interface ResrceService extends IService<Resrce> {
IPage<Resrce> selectPage(FrontPage<Resrce> frontPage, Resrce resrce);
List<Resrce> selectList(Resrce resrce);
/**
*
*
* @param site
* @param resourceType
* @return
*/
List<Resrce> getResourceListByType(String site, String resourceType);
}

@ -42,5 +42,10 @@ public class ResrceServiceImpl extends ServiceImpl<ResrceMapper, Resrce> impleme
return super.list(queryWrapper);
}
@Override
public List<Resrce> getResourceListByType(String site, String resourceType) {
return resrceMapper.selectResourceListByType(site, resourceType);
}
}

@ -540,4 +540,12 @@
<!-- BaseMapper标准查询/修改/删除 -->
<select id="selectResourceListByType" resultMap="BaseResultMap">
SELECT RS.HANDLE, RS.SITE, RS.RESRCE, RS.DESCRIPTION, RS.STATUS_BO, RS.PROCESS_RESOURCE, RS.OPERATION_BO, RS.VALID_FROM, RS.VALID_TO, RS.SETUP_STATE, RS.SETUP_DESCRIPTION, RS.CNC_MACHINE, RS.PENDING_STATUS_BO, RS.PENDING_REASON_CODE_BO, RS.PENDING_RESOURCE_RC_BO, RS.PENDING_COMMENTS, RS.CREATED_DATE_TIME, RS.MODIFIED_DATE_TIME, RS.ERP_PLANT_MAINT_ORDER, RS.ERP_EQUIPMENT_NUMBER, RS.ERP_INTERNAL_ID, RS.ERP_CAPACITY_CATEGORY
FROM RESRCE RS
INNER JOIN RESOURCE_TYPE_RESOURCE RTR ON RTR.RESOURCE_BO = RS.HANDLE
INNER JOIN RESOURCE_TYPE RT ON RT.HANDLE = RTR.RESOURCE_TYPE_BO
WHERE RT.SITE = #{site} AND RT.RESOURCE_TYPE = #{resourceType}
</select>
</mapper>

@ -320,12 +320,12 @@
<if test="ew.entity.partitionDate!=null"> AND PARTITION_DATE=#{ew.entity.partitionDate}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</select>

Loading…
Cancel
Save