临时工作进度
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package quant.rich.emoney.mapper.postgre;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import quant.rich.emoney.entity.postgre.EmoneyIndex;
|
||||
import quant.rich.emoney.entity.postgre.StockStrategy;
|
||||
|
||||
@Component
|
||||
@Mapper
|
||||
@DS("postgre")
|
||||
public interface StockStrategyMapper extends BaseMapper<StockStrategy> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package quant.rich.emoney.service.postgre;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import quant.rich.emoney.config.PostgreMybatisConfig;
|
||||
|
||||
/**
|
||||
* 使用 PostgreSQL 存储数据的 ServiceImpl,重写了部分使用 Transactional 的方法
|
||||
*/
|
||||
public abstract class PostgreServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M, T> {
|
||||
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER, rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean saveBatch(Collection<T> entityList) {
|
||||
return super.saveBatch(entityList);
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER, rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean saveBatch(Collection<T> entityList, int batchSize) {
|
||||
return super.saveBatch(entityList, batchSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER, rollbackFor = Exception.class)
|
||||
public boolean saveOrUpdateBatch(Collection<T> entityList) {
|
||||
return super.saveOrUpdateBatch(entityList);
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER, rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean saveOrUpdateBatch(Collection<T> entityList, int batchSize) {
|
||||
return super.saveOrUpdateBatch(entityList, batchSize);
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER,rollbackFor = Exception.class)
|
||||
@Override
|
||||
public boolean updateBatchById(Collection<T> entityList, int batchSize) {
|
||||
return super.updateBatchById(entityList, batchSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER,rollbackFor = Exception.class)
|
||||
public boolean removeByIds(Collection<?> list) {
|
||||
return super.removeByIds(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER,rollbackFor = Exception.class)
|
||||
public boolean removeByIds(Collection<?> list, boolean useFill) {
|
||||
return super.removeByIds(list, useFill);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER,rollbackFor = Exception.class)
|
||||
public boolean removeBatchByIds(Collection<?> list) {
|
||||
return super.removeBatchByIds(list, DEFAULT_BATCH_SIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER,rollbackFor = Exception.class)
|
||||
public boolean removeBatchByIds(Collection<?> list, int batchSize) {
|
||||
return super.removeBatchByIds(list, batchSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER,rollbackFor = Exception.class)
|
||||
public boolean removeBatchByIds(Collection<?> list, int batchSize, boolean useFill) {
|
||||
return super.removeBatchByIds(list, batchSize, useFill);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER,rollbackFor = Exception.class)
|
||||
public boolean removeBatchByIds(Collection<?> list, boolean useFill) {
|
||||
return super.removeBatchByIds(list, useFill);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER,rollbackFor = Exception.class)
|
||||
public boolean updateBatchById(Collection<T> entityList) {
|
||||
return super.updateBatchById(entityList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package quant.rich.emoney.service.postgre;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
|
||||
import quant.rich.emoney.entity.postgre.StockStrategy;
|
||||
import quant.rich.emoney.mapper.postgre.StockStrategyMapper;
|
||||
|
||||
@DS("postgre")
|
||||
@Service
|
||||
public class StockStrategyService extends PostgreServiceImpl<StockStrategyMapper, StockStrategy> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user