package com.changhong.epc.form.service.table;
|
|
import com.changhong.autoform.mapper.fieldvalue.impl.FieldValueMapperImpl;
|
import com.changhong.autoform.mapper.table.impl.TableMapperImpl;
|
import com.iemsoft.framework.cloud.config.datasource.DynamicDataSource;
|
import com.iemsoft.framework.cloud.core.exception.IEMRuntimeException;
|
import com.iemsoft.framework.cloud.core.tools.SpringUtil;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.stereotype.Service;
|
|
import java.sql.Connection;
|
import java.sql.SQLException;
|
|
@Service
|
@Slf4j
|
public class EpcTableMapperImpl extends TableMapperImpl {
|
|
@Override
|
protected Connection getConnection() {
|
// MybatisTool.initDataSource();
|
try {
|
return SpringUtil.getBean(DynamicDataSource.class).getConnection();
|
} catch (SQLException e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(e.getMessage());
|
}
|
}
|
|
}
|
|
@Slf4j
|
@Service
|
class EpcFieldValueMapperImpl extends FieldValueMapperImpl {
|
|
@Override
|
protected Connection getConnection() {
|
// MybatisTool.initDataSource();
|
try {
|
return SpringUtil.getBean(DynamicDataSource.class).getConnection();
|
} catch (SQLException e) {
|
log.error(e.getMessage(), e);
|
throw new IEMRuntimeException(e.getMessage());
|
}
|
}
|
}
|