| | |
| | | @Autowired |
| | | private List<SqlSessionFactory> sqlSessionFactoryList; |
| | | |
| | | @Value("${common.virtual_card_disable_set_inuse}") |
| | | private Boolean disableSetInUse; |
| | | @Value("${virtual_card_set_default:false}") |
| | | private Boolean virtualCardTbProSetDefault; |
| | | |
| | | /** |
| | | * 两个拦截器,自动生成ID,异常时输出SQL |
| | | * 根据配置文件配置,配置拦截器 |
| | | */ |
| | | @PostConstruct |
| | | public void addMyInterceptor() { |
| | | for (SqlSessionFactory sqlSessionFactory : sqlSessionFactoryList) { |
| | | if (disableSetInUse != null && disableSetInUse.booleanValue()) { |
| | | sqlSessionFactory.getConfiguration().addInterceptor(new VirtualCardInUseInterceptor()); |
| | | if (virtualCardTbProSetDefault != null && virtualCardTbProSetDefault.booleanValue()) { |
| | | sqlSessionFactory.getConfiguration().addInterceptor(new VirtualCardSetDefaultInterceptor()); |
| | | } |
| | | } |
| | | } |