| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Properties; |
| | | |
| | | @Component |
| | | @Intercepts({ |
| | | @Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class}) |
| | |
| | | |
| | | /** |
| | | * 数据同步 |
| | | * |
| | | * @param tableName |
| | | * @param sqlType |
| | | * @param parameter |
| | |
| | | //update 方法需要特殊处理 |
| | | if (tableName.equals("jczz_article")) { |
| | | Article entity = (Article) ((MapperMethod.ParamMap) parameter).get("param1"); |
| | | if (null!=entity.getId()) { |
| | | if (entity != null && entity.getId() != null) { |
| | | esParam.setTableId(entity.getId().toString()); |
| | | elasticsearchDocumentService.update(esParam, entity, EsTableConstant.articleList); |
| | | } |
| | |
| | | PlaceEntity placeEntity = new PlaceEntity(); |
| | | if (parameter instanceof MapperMethod.ParamMap){ |
| | | placeEntity = (PlaceEntity) ((MapperMethod.ParamMap) parameter).get("param1"); |
| | | if (null!=placeEntity.getId()) { |
| | | if (placeEntity != null && null != placeEntity.getId()) { |
| | | setPlaceInfo(entity, placeEntity); |
| | | esParam.setTableId(entity.getId().toString()); |
| | | elasticsearchDocumentService.update(esParam, entity, EsTableConstant.placeList); |
| | |
| | | HouseEntity entity = new HouseEntity(); |
| | | if (parameter instanceof MapperMethod.ParamMap){ |
| | | entity = (HouseEntity) ((MapperMethod.ParamMap) parameter).get("param1"); |
| | | if (null!=entity.getId()) { |
| | | if (entity != null && entity.getId() != null) { |
| | | setHouseInfo(houseEntity, entity); |
| | | esParam.setTableId(entity.getId().toString()); |
| | | elasticsearchDocumentService.update(esParam, entity, EsTableConstant.houseList); |
| | |
| | | HouseholdEntity entity = new HouseholdEntity(); |
| | | if (parameter instanceof MapperMethod.ParamMap){ |
| | | entity = (HouseholdEntity) ((MapperMethod.ParamMap) parameter).get("param1"); |
| | | if (null!=entity.getId()) { |
| | | if (entity != null && entity.getId() != null) { |
| | | setHouseholdInfo(householdEntity, entity); |
| | | esParam.setTableId(entity.getId().toString()); |
| | | elasticsearchDocumentService.update(esParam, entity, EsTableConstant.householdList); |
| | |
| | | |
| | | /** |
| | | * 场所值复制 |
| | | * |
| | | * @param entity |
| | | * @param placeEntity |
| | | */ |
| | |
| | | entity.setPrincipalIdCard(placeEntity.getPrincipalIdCard()); |
| | | entity.setLocation(placeEntity.getLocation()); |
| | | } |
| | | |
| | | /** |
| | | * 房屋值复制 |
| | | * |
| | | * @param entity |
| | | * @param houseEntity |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 住户值复制 |
| | | * |
| | | * @param entity |
| | | * @param householdEntity |
| | | */ |