瀏覽代碼

品牌库、脑店图、下拉框

云殇忆 1 年之前
父節點
當前提交
b1c497d837
共有 50 個文件被更改,包括 1762 次插入0 次删除
  1. 101 0
      benyun-core/src/main/java/com/benyun/core/controller/BrandController.java
  2. 41 0
      benyun-core/src/main/java/com/benyun/core/controller/CategoryCotroller.java
  3. 44 0
      benyun-core/src/main/java/com/benyun/core/controller/WdInfoController.java
  4. 11 0
      benyun-core/src/main/java/com/benyun/core/dao/BrandCityMapper.java
  5. 17 0
      benyun-core/src/main/java/com/benyun/core/dao/BrandMapper.java
  6. 11 0
      benyun-core/src/main/java/com/benyun/core/dao/BrandProvinceMapper.java
  7. 12 0
      benyun-core/src/main/java/com/benyun/core/dao/BrandStatisticsMapper.java
  8. 12 0
      benyun-core/src/main/java/com/benyun/core/dao/BrandZoneMapper.java
  9. 19 0
      benyun-core/src/main/java/com/benyun/core/dao/CategoryMapper.java
  10. 9 0
      benyun-core/src/main/java/com/benyun/core/dao/EnterpriseMapper.java
  11. 13 0
      benyun-core/src/main/java/com/benyun/core/dao/WdInfoMapper.java
  12. 90 0
      benyun-core/src/main/java/com/benyun/core/entity/Brand.java
  13. 19 0
      benyun-core/src/main/java/com/benyun/core/entity/BrandCity.java
  14. 19 0
      benyun-core/src/main/java/com/benyun/core/entity/BrandProvince.java
  15. 22 0
      benyun-core/src/main/java/com/benyun/core/entity/BrandStatistics.java
  16. 23 0
      benyun-core/src/main/java/com/benyun/core/entity/BrandZone.java
  17. 13 0
      benyun-core/src/main/java/com/benyun/core/entity/Category.java
  18. 4 0
      benyun-core/src/main/java/com/benyun/core/entity/Enterprise.java
  19. 13 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BStoreData.java
  20. 10 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandAddrTypeDistribution.java
  21. 11 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandDisCloud.java
  22. 10 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandDisItem.java
  23. 14 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandDistribution.java
  24. 21 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandInfo.java
  25. 12 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandProperty.java
  26. 16 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandProvinceBo.java
  27. 17 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandSearch.java
  28. 15 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandSimilar.java
  29. 9 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandStatus.java
  30. 13 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/BrandTotal.java
  31. 13 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/Info.java
  32. 10 0
      benyun-core/src/main/java/com/benyun/core/entity/bo/WdAddrTypeDistribution.java
  33. 19 0
      benyun-core/src/main/java/com/benyun/core/entity/vo/BrandListQueryBody.java
  34. 22 0
      benyun-core/src/main/java/com/benyun/core/service/BrandService.java
  35. 12 0
      benyun-core/src/main/java/com/benyun/core/service/CategoryService.java
  36. 11 0
      benyun-core/src/main/java/com/benyun/core/service/WdInfoService.java
  37. 296 0
      benyun-core/src/main/java/com/benyun/core/service/impl/BrandServiceImpl.java
  38. 87 0
      benyun-core/src/main/java/com/benyun/core/service/impl/CategoryServiceImpl.java
  39. 30 0
      benyun-core/src/main/java/com/benyun/core/service/impl/WdInfoServiceImpl.java
  40. 19 0
      benyun-core/src/main/resources/mapper/BrandCityMapper.xml
  41. 133 0
      benyun-core/src/main/resources/mapper/BrandMapper.xml
  42. 20 0
      benyun-core/src/main/resources/mapper/BrandProvinceMapper.xml
  43. 25 0
      benyun-core/src/main/resources/mapper/BrandStatisticsMapper.xml
  44. 46 0
      benyun-core/src/main/resources/mapper/BrandZoneMapper.xml
  45. 67 0
      benyun-core/src/main/resources/mapper/CategoryMapper.xml
  46. 29 0
      benyun-core/src/main/resources/mapper/EnterpriseMapper.xml
  47. 79 0
      benyun-core/src/main/resources/mapper/WdInfoMapper.xml
  48. 123 0
      benyun-core/src/test/java/com/benyun/core/service/BrandServiceImplTest.java
  49. 38 0
      benyun-core/src/test/java/com/benyun/core/service/CategoryServiceImplTest.java
  50. 42 0
      benyun-core/src/test/java/com/benyun/core/service/WdInfoServiceImplTest.java

+ 101 - 0
benyun-core/src/main/java/com/benyun/core/controller/BrandController.java

@@ -0,0 +1,101 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.entity.bo.BrandSearch;
+import com.benyun.core.entity.vo.BrandListQueryBody;
+import com.benyun.core.service.BrandService;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.R;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/bailianAi/brand")
+public class BrandController extends BaseController {
+    @Autowired
+    private BrandService brandService;
+
+//    获取品牌信息列表
+    @GetMapping("/search")
+    public R search(String text){
+        List<BrandSearch> list = brandService.searchByLikeName(text);
+        return R.ok(list);
+    }
+
+//    获取品牌信息列表
+    @GetMapping("/list")
+    public R list(BrandListQueryBody body){
+        return R.ok(brandService.searchListByMulti(body));
+    }
+
+//    获取品牌详细信息
+    @GetMapping("/info")
+    public R info(String brandId){
+        return R.ok(brandService.searchByBrandId(brandId));
+    }
+
+//    获取品牌物业信息
+    @GetMapping("/property")
+    public R property(String brandId){
+        return R.ok(brandService.searchPropertyByBrandId(brandId));
+    }
+
+//    获取品牌城市分布词云
+    @GetMapping("/distribution")
+    public R distribution(String brandId){
+        return R.ok(brandService.searchDisCloudByBrandId(brandId));
+    }
+
+//    获取相似品牌
+    @GetMapping("/similar")
+    public R similar(String brandId){
+        return R.ok(brandService.searchSimilarByBrandId(brandId));
+    }
+
+//    获取品牌网点营业状态分布
+    @GetMapping("/status")
+    public R statusDistribution(String brandId){
+        return R.ok(brandService.searchStatusByBrandId(brandId));
+    }
+
+//    获取品牌网点地图信息
+    @GetMapping("/area")
+    public R area(String brandId){
+        return R.ok(brandService.searchProvinceByBrandId(brandId));
+    }
+
+//    获取品牌网点数量及其城市数量分布
+    @GetMapping("/shopCount")
+    public R shopCount(String brandId){
+        return R.ok(brandService.searchDistributionByBrandId(brandId));
+    }
+
+//    获取所有品牌网点数量
+    @GetMapping("/total")
+    public R total(){
+        return R.ok(brandService.searchTotal());
+    }
+
+//    获取品牌均分分布
+    @GetMapping("/average")
+    public R average(String brandId){
+        return R.ok(brandService.searchAvgScoreByBrandId(brandId));
+    }
+
+//    获取品牌网点类型分布情况
+    @GetMapping("/categoryDistribution")
+    public R categoryDis(BrandListQueryBody body){
+        List<String> addrCode = body.getAddrCode();
+        List<String> industryCode = body.getIndustryCode();
+        return R.ok(brandService.searchAddrTypeDisByMulti(addrCode,industryCode));
+    }
+
+//    获取连锁品牌近期开关店情况
+}

+ 41 - 0
benyun-core/src/main/java/com/benyun/core/controller/CategoryCotroller.java

@@ -0,0 +1,41 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.service.CategoryService;
+import com.ruoyi.common.core.domain.R;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Validated
+@RequiredArgsConstructor
+@RestController
+public class CategoryCotroller {
+    @Autowired
+    CategoryService categoryService;
+
+//    获取地区信息
+    @GetMapping("/getAddrCategory")
+    public R getAddrCategory(){
+        return R.ok(categoryService.getAddrCategory());
+    }
+
+//    获取行业分类
+    @GetMapping("/getIndustryCategory")
+    public R getIndustryCategory(){
+        return R.ok(categoryService.getIndustryCategory());
+    }
+
+//    获取网点分类
+    @GetMapping("/getTypeGdCategory")
+    public R getTypeGdCategoryTest(){
+        return R.ok(categoryService.getTypeGdCategory());
+    }
+
+//    获取网点类型
+    @GetMapping("/getWdTypeCategory")
+    public R getWdTypeCategory(){
+        return R.ok(categoryService.getWdTypeCategory());
+    }
+}

+ 44 - 0
benyun-core/src/main/java/com/benyun/core/controller/WdInfoController.java

@@ -0,0 +1,44 @@
+package com.benyun.core.controller;
+
+import com.benyun.core.entity.vo.BrandListQueryBody;
+import com.benyun.core.service.WdInfoService;
+import com.ruoyi.common.core.domain.R;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/bailianAi/originWd")
+public class WdInfoController {
+    @Autowired
+    WdInfoService wdInfoService;
+
+//    获取各地区网点分类分布情况
+    @GetMapping("/categoryDistribution")
+    public R categoryDistribution(BrandListQueryBody body){
+        List<String> addrCodes = body.getAddrCode();
+        List<String> typeCodes = body.getTypeCode();
+        return R.ok(wdInfoService.searchAddrTypeDistribution(addrCodes,typeCodes));
+    }
+
+//    获取各地区网点类型分布情况
+    @GetMapping("/wdTypeDistribution")
+    public R wdTypeDistribution(BrandListQueryBody body){
+        List<String> addrCodes = body.getAddrCode();
+        List<String> typeCodes = body.getTypeCode();
+        return R.ok(wdInfoService.searchWdTypeDistribution(addrCodes,typeCodes));
+    }
+
+//    获取所有网点类型网点数量(降序)
+    @GetMapping("/total")
+    public R total(){
+        return R.ok(wdInfoService.searchWdTotal());
+    }
+}

+ 11 - 0
benyun-core/src/main/java/com/benyun/core/dao/BrandCityMapper.java

@@ -0,0 +1,11 @@
+package com.benyun.core.dao;
+
+import com.benyun.core.entity.BrandCity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface BrandCityMapper {
+    List<BrandCity> searchByBrandId(String brandId);
+}

+ 17 - 0
benyun-core/src/main/java/com/benyun/core/dao/BrandMapper.java

@@ -0,0 +1,17 @@
+package com.benyun.core.dao;
+
+import com.benyun.core.entity.Brand;
+import com.benyun.core.entity.bo.BrandAddrTypeDistribution;
+import com.benyun.core.entity.bo.BrandSearch;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface BrandMapper {
+    List<Brand> searchList(String text);
+    Brand searchById(String brandId);
+    List<Brand> searchByIndustryCodeList(String brandId, String industryCode);
+    List<BrandSearch> searchSearchByMulti(String text, List<String> industryCode, Integer countUp, Integer countDown, Integer coverUp, Integer coverDown, List<String> addrCode, Integer orderBy);
+    List<BrandAddrTypeDistribution> searchAddrTypeDisByMulti(List<String> addrCodes, List<String> industryCodes);
+}

+ 11 - 0
benyun-core/src/main/java/com/benyun/core/dao/BrandProvinceMapper.java

@@ -0,0 +1,11 @@
+package com.benyun.core.dao;
+
+import com.benyun.core.entity.BrandProvince;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface BrandProvinceMapper {
+    List<BrandProvince> searchByBrandId(String brandId);
+}

+ 12 - 0
benyun-core/src/main/java/com/benyun/core/dao/BrandStatisticsMapper.java

@@ -0,0 +1,12 @@
+package com.benyun.core.dao;
+
+import com.benyun.core.entity.BrandStatistics;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface BrandStatisticsMapper {
+    BrandStatistics searchByBrandId(String brandId);
+    List<BrandStatistics> searchList();
+}

+ 12 - 0
benyun-core/src/main/java/com/benyun/core/dao/BrandZoneMapper.java

@@ -0,0 +1,12 @@
+package com.benyun.core.dao;
+
+import com.benyun.core.entity.BrandZone;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface BrandZoneMapper {
+    List<BrandZone> searchByBrandId(String brandId);
+    List<BrandZone> searchByMulti(List<String> addrCodes,List<String> industryCodes,List<String> brandIds);
+}

+ 19 - 0
benyun-core/src/main/java/com/benyun/core/dao/CategoryMapper.java

@@ -0,0 +1,19 @@
+package com.benyun.core.dao;
+
+import com.benyun.core.entity.Category;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface CategoryMapper {
+    List<Category> searchProvince();
+    List<Category> searchCityByProvince(String province);
+    List<Category> searchZoneByCity(String city);
+    List<Category> searchBigIndustry();
+    List<Category> searchMidIndustryByBig(String bigCategory);
+    List<Category> searchBigCategory();
+    List<Category> searchMidCategoryByBig(String bigCategory);
+    List<Category> searchSubCategoryByMid(String midCategory);
+    List<Category> searchWdType();
+}

+ 9 - 0
benyun-core/src/main/java/com/benyun/core/dao/EnterpriseMapper.java

@@ -0,0 +1,9 @@
+package com.benyun.core.dao;
+
+import com.benyun.core.entity.Enterprise;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EnterpriseMapper {
+    Enterprise searchByUsci(String EnterpriseUsci);
+}

+ 13 - 0
benyun-core/src/main/java/com/benyun/core/dao/WdInfoMapper.java

@@ -0,0 +1,13 @@
+package com.benyun.core.dao;
+
+import com.benyun.core.entity.bo.WdAddrTypeDistribution;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface WdInfoMapper {
+    List<WdAddrTypeDistribution> searchAddrDisByMulti(List<String> addrCodes, List<String> typeCodes);
+    List<WdAddrTypeDistribution> searchWdTypeDisByMulti(List<String> addrCodes, List<String> typeCodes);
+    List<WdAddrTypeDistribution> searchWdTotal();
+}

+ 90 - 0
benyun-core/src/main/java/com/benyun/core/entity/Brand.java

@@ -0,0 +1,90 @@
+package com.benyun.core.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@TableName("ddt_origin_brand")
+public class Brand extends BaseEntity {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     *
+     */
+    private String brandId;
+    /**
+     *
+     */
+    private String brandImg;
+    /**
+     *
+     */
+    private String brandName;
+    /**
+     *
+     */
+    private String industryCode;
+    /**
+     *
+     */
+    private String enterpriseUsci;
+    /**
+     *
+     */
+    private Float perCapitaConsumption;
+    /**
+     *
+     */
+    private Long commentCount;
+    /**
+     *
+     */
+    private Float score;
+    /**
+     *
+     */
+    private String menuInfo;
+    /**
+     *
+     */
+    private Float indexScore;
+    /**
+     *
+     */
+    private Date createDate;
+    /**
+     *
+     */
+    private Long audit;
+    /**
+     *
+     */
+    private String collectPerson;
+    /**
+     *
+     */
+    private Date collectTime;
+    /**
+     *
+     */
+    private Date enterTime;
+    /**
+     *
+     */
+    private String hash;
+    /**
+     *
+     */
+    private Long agree;
+    /**
+     *
+     */
+    private Long oppose;
+
+}

+ 19 - 0
benyun-core/src/main/java/com/benyun/core/entity/BrandCity.java

@@ -0,0 +1,19 @@
+package com.benyun.core.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("bl_brand_city_distribution")
+public class BrandCity {
+    private String disId;
+    private String brandId;
+    private String addrCode;
+    private String city;
+    private Float latGd;
+    private Float lngGd;
+    private Integer disCount;
+    private Date updateTime;
+}

+ 19 - 0
benyun-core/src/main/java/com/benyun/core/entity/BrandProvince.java

@@ -0,0 +1,19 @@
+package com.benyun.core.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("bl_brand_province_distribution")
+public class BrandProvince {
+    private String disId;
+    private String brandId;
+    private String addrCode;
+    private String province;
+    private Float latGd;
+    private Float lngGd;
+    private Integer disCount;
+    private Date updateTime;
+}

+ 22 - 0
benyun-core/src/main/java/com/benyun/core/entity/BrandStatistics.java

@@ -0,0 +1,22 @@
+package com.benyun.core.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("bl_brand_statistics")
+public class BrandStatistics {
+    private String statId;
+    private String brandId;
+    private String brandName;
+    private int coverProvinceCount;
+    private int coverCityCount;
+    private int coverZoneCount;
+    private int businessCount;
+    private int pauseBusinessCount;
+    private int noBusinessCount;
+    private int total;
+    private Date updateTime;
+}

+ 23 - 0
benyun-core/src/main/java/com/benyun/core/entity/BrandZone.java

@@ -0,0 +1,23 @@
+package com.benyun.core.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("bl_brand_zone_distribution")
+public class BrandZone {
+    private String disId;
+    private String brandId;
+    private String industryCode;
+    private String addrCode;
+    private String province;
+    private String city;
+    private String zone;
+    private Float latGd;
+    private Float lngGd;
+    private Integer disCount;
+    private Float averageScore;
+    private Date updateTime;
+}

+ 13 - 0
benyun-core/src/main/java/com/benyun/core/entity/Category.java

@@ -0,0 +1,13 @@
+package com.benyun.core.entity;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class Category {
+    private String code;
+    private String name;
+    private String type;
+    private List<Category> children;
+}

+ 4 - 0
benyun-core/src/main/java/com/benyun/core/entity/Enterprise.java

@@ -79,4 +79,8 @@ public class Enterprise {
     private LocalDateTime updateTime;
     @TableField("hash")
     private String hash;
+    @TableField("telephone")
+    private String telephone;
+    @TableField("website")
+    private String website;
 }

+ 13 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BStoreData.java

@@ -0,0 +1,13 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class BStoreData {
+    private String brandName;
+    private String status;
+    private String industryCode;
+    private List<Info> info;
+}

+ 10 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandAddrTypeDistribution.java

@@ -0,0 +1,10 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+@Data
+public class BrandAddrTypeDistribution {
+    private String industryCode;
+    private String addrCode;
+    private Integer count;
+}

+ 11 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandDisCloud.java

@@ -0,0 +1,11 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class BrandDisCloud {
+    private List<BrandDisItem> zoneDistribution;
+    private List<BrandDisItem> cityDistribution;
+}

+ 10 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandDisItem.java

@@ -0,0 +1,10 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+@Data
+public class BrandDisItem {
+    private String code;
+    private String name;
+    private Integer count;
+}

+ 14 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandDistribution.java

@@ -0,0 +1,14 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+@Data
+public class BrandDistribution {
+    private Integer total;
+    private Integer coverProvinceCount;
+    private String coverProvinceRatio;
+    private Integer coverCityCount;
+    private String coverCityRatio;
+    private Integer coverZoneCount;
+    private String coverZoneRatio;
+}

+ 21 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandInfo.java

@@ -0,0 +1,21 @@
+package com.benyun.core.entity.bo;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("ddt_origin_brand")
+public class BrandInfo {
+    private String brandId;
+    private String brandName;
+    private String brandImg;
+    private Float indexScore;
+    private String enterpriseUsci;
+    private String enterpriseName;
+    private String addrInfo;
+    private String addrCode;
+    private String telephone;
+    private Date updateTime;
+}

+ 12 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandProperty.java

@@ -0,0 +1,12 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+@Data
+public class BrandProperty {
+    private String industryCode;
+    private Float perCapitaConsumption;
+    private Long commentCount;
+    private Float score;
+    private String activeRatio;
+}

+ 16 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandProvinceBo.java

@@ -0,0 +1,16 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class BrandProvinceBo {
+    private String brandId;
+    private String code;
+    private String name;
+    private String location;
+    private Integer count;
+    private String ratio;
+    private Date updateTime;
+}

+ 17 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandSearch.java

@@ -0,0 +1,17 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class BrandSearch {
+    private String brandId;
+    private String brandName;
+    private String brandImg;
+    private Float indexScore;
+    private String enterpriseName;
+    private Integer coverCityCount;
+    private Integer total;
+    private Date updateTime;
+}

+ 15 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandSimilar.java

@@ -0,0 +1,15 @@
+package com.benyun.core.entity.bo;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName("ddt_origin_brand")
+public class BrandSimilar {
+    private String brandId;
+    private String brandName;
+    private String brandImg;
+    private Date updateTime;
+}

+ 9 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandStatus.java

@@ -0,0 +1,9 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+@Data
+public class BrandStatus {
+    private String businessStatus;
+    private Integer count;
+}

+ 13 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/BrandTotal.java

@@ -0,0 +1,13 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class BrandTotal {
+    private String brandId;
+    private String brandName;
+    private int total;
+    private Date updateTime;
+}

+ 13 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/Info.java

@@ -0,0 +1,13 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class Info {
+    private String addrCode;
+    private Float avgScore;
+    private Integer count;
+    private Date time;
+}

+ 10 - 0
benyun-core/src/main/java/com/benyun/core/entity/bo/WdAddrTypeDistribution.java

@@ -0,0 +1,10 @@
+package com.benyun.core.entity.bo;
+
+import lombok.Data;
+
+@Data
+public class WdAddrTypeDistribution {
+    private String typeCode;
+    private String addrCode;
+    private Integer count;
+}

+ 19 - 0
benyun-core/src/main/java/com/benyun/core/entity/vo/BrandListQueryBody.java

@@ -0,0 +1,19 @@
+package com.benyun.core.entity.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class BrandListQueryBody {
+    private String text;
+    private List<String> brandId;
+    private List<String> industryCode;
+    private List<String> typeCode;
+    private List<String> wdCount;
+    private List<String> coverCityCount;
+    private List<String> addrCode;
+    private String orderBy;
+    private Integer pageNum;
+    private Integer pageSize;
+}

+ 22 - 0
benyun-core/src/main/java/com/benyun/core/service/BrandService.java

@@ -0,0 +1,22 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.bo.*;
+import com.benyun.core.entity.vo.BrandListQueryBody;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+
+public interface BrandService {
+    List<BrandSearch> searchByLikeName(String text);
+    BrandInfo searchByBrandId(String brandId);
+    BrandProperty searchPropertyByBrandId(String brandId);
+    List<BrandSimilar> searchSimilarByBrandId(String brandId);
+    List<BrandStatus> searchStatusByBrandId(String brandId);
+    BrandDistribution searchDistributionByBrandId(String brandId);
+    List<BrandProvinceBo> searchProvinceByBrandId(String brandId);
+    BrandDisCloud searchDisCloudByBrandId(String brandId);
+    PageInfo<List<BrandSearch>> searchListByMulti(BrandListQueryBody body);
+    List<BrandTotal> searchTotal();
+    BStoreData searchAvgScoreByBrandId(String brandId);
+    List<BrandAddrTypeDistribution> searchAddrTypeDisByMulti(List<String> addrCodes, List<String> typeCodes);
+}

+ 12 - 0
benyun-core/src/main/java/com/benyun/core/service/CategoryService.java

@@ -0,0 +1,12 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.Category;
+
+import java.util.List;
+
+public interface CategoryService {
+    List<Category> getAddrCategory();
+    List<Category> getIndustryCategory();
+    List<Category> getTypeGdCategory();
+    List<Category> getWdTypeCategory();
+}

+ 11 - 0
benyun-core/src/main/java/com/benyun/core/service/WdInfoService.java

@@ -0,0 +1,11 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.bo.WdAddrTypeDistribution;
+
+import java.util.List;
+
+public interface WdInfoService {
+    List<WdAddrTypeDistribution> searchAddrTypeDistribution(List<String> addrCodes, List<String> typeCodes);
+    List<WdAddrTypeDistribution> searchWdTypeDistribution(List<String> addrCodes, List<String> typeCodes);
+    List<WdAddrTypeDistribution> searchWdTotal();
+}

+ 296 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/BrandServiceImpl.java

@@ -0,0 +1,296 @@
+package com.benyun.core.service.impl;
+
+import com.benyun.core.dao.*;
+import com.benyun.core.entity.*;
+import com.benyun.core.entity.bo.*;
+import com.benyun.core.entity.vo.BrandListQueryBody;
+import com.benyun.core.service.BrandService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class BrandServiceImpl implements BrandService {
+    @Autowired
+    BrandMapper brandMapper;
+    @Autowired
+    BrandStatisticsMapper brandStatisticsMapper;
+    @Autowired
+    BrandProvinceMapper brandProvinceMapper;
+    @Autowired
+    BrandCityMapper brandCityMapper;
+    @Autowired
+    BrandZoneMapper brandZoneMapper;
+    @Autowired
+    EnterpriseMapper enterpriseMapper;
+
+    @Override
+    public List<BrandSearch> searchByLikeName(String text) {
+        List<Brand> list = brandMapper.searchList(text);
+        List<BrandSearch> sList = new ArrayList<>();
+        for (Brand brand : list){
+            Enterprise enterprise = enterpriseMapper.searchByUsci(brand.getEnterpriseUsci());
+            BrandSearch bs = new BrandSearch();
+            bs.setBrandId(brand.getBrandId());
+            bs.setBrandName(brand.getBrandName());
+            if (enterprise != null)
+                bs.setEnterpriseName(enterprise.getEnterpriseName());
+            bs.setUpdateTime(brand.getUpdateTime());
+            sList.add(bs);
+        }
+        return sList;
+    }
+
+    @Override
+    public BrandInfo searchByBrandId(String brandId) {
+        Brand brand = brandMapper.searchById(brandId);
+        BrandInfo info = new BrandInfo();
+        if (brand != null){
+            Enterprise enterprise = enterpriseMapper.searchByUsci(brand.getEnterpriseUsci());
+            info.setBrandId(brandId);
+            info.setBrandName(brand.getBrandName());
+            info.setBrandImg(brand.getBrandImg());
+            info.setIndexScore(brand.getIndexScore());
+            if (enterprise != null){
+                info.setEnterpriseUsci(enterprise.getEnterpriseUsci());
+                info.setEnterpriseName(enterprise.getEnterpriseName());
+                info.setAddrCode(enterprise.getAddrCode());
+                info.setAddrInfo(enterprise.getAddrInfo());
+                info.setTelephone(enterprise.getTelephone());
+            }
+            info.setUpdateTime(brand.getUpdateTime());
+        }else return null;
+        return info;
+    }
+
+    @Override
+    public BrandProperty searchPropertyByBrandId(String brandId) {
+        BrandStatistics brandStatistics = brandStatisticsMapper.searchByBrandId(brandId);
+        Brand brand = brandMapper.searchById(brandId);
+        BrandProperty bp = new BrandProperty();
+        if (brand != null){
+            bp.setIndustryCode(brand.getIndustryCode());
+            bp.setPerCapitaConsumption(brand.getPerCapitaConsumption());
+            bp.setCommentCount(brand.getCommentCount());
+            bp.setScore(brand.getScore());
+        }else {
+            bp.setIndustryCode("****");
+            bp.setPerCapitaConsumption(null);
+            bp.setCommentCount(null);
+            bp.setScore(null);
+        }
+        if (brandStatistics != null){
+            float activeRatio = (float) brandStatistics.getBusinessCount()/brandStatistics.getTotal();
+            bp.setActiveRatio((int)(activeRatio*100)+"%");
+        }else {
+            bp.setActiveRatio("****");
+        }
+        return bp;
+    }
+
+    @Override
+    public List<BrandSimilar> searchSimilarByBrandId(String brandId) {
+//        先查询品牌id得到industryCode
+        Brand brand = brandMapper.searchById(brandId);
+        if (brand == null)
+            return null;
+//        再根据industryCode得到其他品牌的信息
+        if (brand.getIndustryCode() == null)
+            return null;
+        List<Brand> brands = brandMapper.searchByIndustryCodeList(brandId, brand.getIndustryCode());
+        List<BrandSimilar> similarList = new ArrayList<>();
+        for (Brand b : brands){
+            BrandSimilar bs = new BrandSimilar();
+            bs.setBrandId(b.getBrandId());
+            bs.setBrandImg(b.getBrandImg());
+            bs.setBrandName(b.getBrandName());
+            bs.setUpdateTime(b.getUpdateTime());
+            similarList.add(bs);
+        }
+        return similarList;
+    }
+
+    @Override
+    public List<BrandStatus> searchStatusByBrandId(String brandId) {
+//        查询状态后拆分
+        BrandStatistics statistics = brandStatisticsMapper.searchByBrandId(brandId);
+        if (statistics == null)
+            return null;
+        int businessCount = statistics.getBusinessCount();
+        int pauseBusinessCount = statistics.getPauseBusinessCount();
+        int noBusinessCount = statistics.getNoBusinessCount();
+        List<BrandStatus> statuses = new ArrayList<>();
+        if (businessCount != 0){
+            BrandStatus status = new BrandStatus();
+            status.setBusinessStatus("正常");
+            status.setCount(businessCount);
+            statuses.add(status);
+        }
+        if (pauseBusinessCount != 0){
+            BrandStatus status = new BrandStatus();
+            status.setBusinessStatus("暂停");
+            status.setCount(pauseBusinessCount);
+            statuses.add(status);
+        }
+        if (noBusinessCount != 0){
+            BrandStatus status = new BrandStatus();
+            status.setBusinessStatus("尚未营业");
+            status.setCount(noBusinessCount);
+            statuses.add(status);
+        }
+        if (statuses.isEmpty())
+            return null;
+        return statuses;
+    }
+
+    @Override
+    public BrandDistribution searchDistributionByBrandId(String brandId) {
+//        省份:31
+//        城市:342
+//        区县:2989
+//        查询统计并附加信息
+        int province = 31;
+        int city = 342;
+        int zone = 2989;
+        BrandStatistics statistics = brandStatisticsMapper.searchByBrandId(brandId);
+        if (statistics == null)
+            return null;
+        BrandDistribution bd = new BrandDistribution();
+        int cpc = statistics.getCoverProvinceCount();
+        int ccc = statistics.getCoverCityCount();
+        int czc = statistics.getCoverZoneCount();
+        bd.setTotal(statistics.getTotal());
+        bd.setCoverProvinceCount(cpc);
+        float provinceRatio = (float) cpc/province;
+        bd.setCoverProvinceRatio((int)(provinceRatio*100) + "%");
+        bd.setCoverCityCount(ccc);
+        float cityRatio = (float) ccc/city;
+        bd.setCoverCityRatio((int)(cityRatio*100) + "%");
+        bd.setCoverZoneCount(czc);
+        float zoneRatio = (float) czc/zone;
+        bd.setCoverZoneRatio((int)(zoneRatio*100) + "%");
+        return bd;
+    }
+
+    @Override
+    public List<BrandProvinceBo> searchProvinceByBrandId(String brandId) {
+        List<BrandProvince> provinces = brandProvinceMapper.searchByBrandId(brandId);
+        BrandStatistics statistics = brandStatisticsMapper.searchByBrandId(brandId);
+        if (provinces.isEmpty() || statistics == null)
+            return null;
+        int total = statistics.getTotal();
+        List<BrandProvinceBo> bpbs = new ArrayList<>();
+        for (BrandProvince bp : provinces){
+            int disCount = bp.getDisCount();
+            BrandProvinceBo bpb = new BrandProvinceBo();
+//            bpb.setBrandId(bp.getBrandId());
+            bpb.setCode(bp.getAddrCode());
+            bpb.setName(bp.getProvince());
+            bpb.setLocation(bp.getLatGd().toString() + "," + bp.getLngGd().toString());
+            bpb.setCount(disCount);
+            float ratio = (float) disCount/total;
+            bpb.setRatio((ratio*100) + "%");
+            bpb.setUpdateTime(bp.getUpdateTime());
+            bpbs.add(bpb);
+        }
+        return bpbs;
+    }
+
+    @Override
+    public BrandDisCloud searchDisCloudByBrandId(String brandId) {
+        List<BrandCity> brandCities = brandCityMapper.searchByBrandId(brandId);
+        List<BrandZone> brandZones = brandZoneMapper.searchByBrandId(brandId);
+        BrandDisCloud disCloud = new BrandDisCloud();
+        List<BrandDisItem> zoneDis = new ArrayList<>();
+        List<BrandDisItem> cityDis = new ArrayList<>();
+        for (BrandZone bz : brandZones){
+            BrandDisItem bdi = new BrandDisItem();
+            bdi.setCode(bz.getAddrCode());
+            bdi.setName(bz.getZone());
+            bdi.setCount(bz.getDisCount());
+            zoneDis.add(bdi);
+        }
+        for (BrandCity bc : brandCities){
+            BrandDisItem bdi = new BrandDisItem();
+            bdi.setCode(bc.getAddrCode());
+            bdi.setName(bc.getCity());
+            bdi.setCount(bc.getDisCount());
+            cityDis.add(bdi);
+        }
+        disCloud.setZoneDistribution(zoneDis);
+        disCloud.setCityDistribution(cityDis);
+        return disCloud;
+    }
+
+    @Override
+    public PageInfo<List<BrandSearch>> searchListByMulti(BrandListQueryBody body) {
+        PageHelper.startPage(body.getPageNum(),body.getPageSize(),true);
+        String text = body.getText();
+        List<String> industryCode = body.getIndustryCode();
+        Integer countDown = null;
+        Integer countUp = null;
+        Integer coverDown = null;
+        Integer coverUp = null;
+        try {
+            countDown = Integer.parseInt(body.getWdCount().get(0));
+            countUp = Integer.parseInt(body.getWdCount().get(1));
+            coverDown = Integer.parseInt(body.getCoverCityCount().get(0));
+            coverUp = Integer.parseInt(body.getCoverCityCount().get(1));
+        }catch (Exception e){}
+        List<String> addrCode = body.getAddrCode();
+        int orderBy = 1;
+        if (body.getOrderBy().equals("total"))
+            orderBy = 2;
+        if (body.getOrderBy().equals("custom"))
+            orderBy = 3;
+        PageInfo info = new PageInfo(brandMapper.searchSearchByMulti(text, industryCode, countUp, countDown, coverUp, coverDown, addrCode, orderBy));
+        return info;
+    }
+
+    @Override
+    public List<BrandTotal> searchTotal() {
+        List<BrandStatistics> list = brandStatisticsMapper.searchList();
+        if (list.isEmpty())
+            return null;
+        List<BrandTotal> tList = new ArrayList<>();
+        for (BrandStatistics bs : list){
+            BrandTotal bt = new BrandTotal();
+            bt.setBrandId(bs.getBrandId());
+            bt.setBrandName(bs.getBrandName());
+            bt.setTotal(bs.getTotal());
+            bt.setUpdateTime(bs.getUpdateTime());
+            tList.add(bt);
+        }
+        return tList;
+    }
+
+    @Override
+    public BStoreData searchAvgScoreByBrandId(String brandId) {
+        Brand brand = brandMapper.searchById(brandId);
+        if (brand == null)
+            return null;
+        BStoreData bStoreData = new BStoreData();
+        bStoreData.setBrandName(brand.getBrandName());
+        List<BrandZone> zones = brandZoneMapper.searchByBrandId(brandId);
+        if (zones.isEmpty())
+            return null;
+        List<Info> infos = new ArrayList<>();
+        for (BrandZone bz : zones){
+            Info info = new Info();
+            info.setAddrCode(bz.getAddrCode());
+            info.setAvgScore(bz.getAverageScore());
+            infos.add(info);
+        }
+        bStoreData.setInfo(infos);
+        return bStoreData;
+    }
+
+    @Override
+    public List<BrandAddrTypeDistribution> searchAddrTypeDisByMulti(List<String> addrCodes, List<String> industryCodes) {
+        return brandMapper.searchAddrTypeDisByMulti(addrCodes, industryCodes);
+    }
+}

+ 87 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/CategoryServiceImpl.java

@@ -0,0 +1,87 @@
+package com.benyun.core.service.impl;
+
+import com.benyun.core.entity.Category;
+import com.benyun.core.dao.CategoryMapper;
+import com.benyun.core.service.CategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CategoryServiceImpl implements CategoryService {
+    @Autowired
+    CategoryMapper categoryMapper;
+
+    @Override
+    public List<Category> getAddrCategory() {
+        List<Category> provinces = categoryMapper.searchProvince();
+        if (provinces.isEmpty())
+            return null;
+        for (Category province : provinces){
+            province.setType("province");
+            List<Category> citys = categoryMapper.searchCityByProvince(province.getName());
+            if (citys.isEmpty())
+                province.setChildren(null);
+            else{
+                for (Category city : citys){
+                    city.setType("city");
+                    List<Category> zones = categoryMapper.searchZoneByCity(city.getName());
+                    if (zones.isEmpty())
+                        city.setChildren(null);
+                    else{
+                        for (Category zone : zones){
+                            zone.setType("zone");
+                            zone.setChildren(null);
+                        }
+                        city.setChildren(zones);
+                    }
+                }
+                province.setChildren(citys);
+            }
+        }
+        return provinces;
+    }
+
+    @Override
+    public List<Category> getIndustryCategory() {
+        List<Category> bigs = categoryMapper.searchBigIndustry();
+        if (bigs.isEmpty())
+            return null;
+        for (Category big : bigs){
+            big.setType("big_category");
+            List<Category> mids = categoryMapper.searchMidIndustryByBig(big.getName());
+            if (mids.isEmpty())
+                big.setChildren(null);
+            else{
+                for (Category mid : mids){
+                    mid.setType("mid_category");
+                    mid.setChildren(null);
+                }
+                big.setChildren(mids);
+            }
+        }
+        return bigs;
+    }
+
+    @Override
+    public List<Category> getTypeGdCategory() {
+        List<Category> bigs = categoryMapper.searchBigCategory();
+        if (bigs.isEmpty())
+            return null;
+        for (Category big : bigs){
+            List<Category> mids = categoryMapper.searchMidCategoryByBig(big.getName());
+            for (Category mid : mids){
+                List<Category> subs = categoryMapper.searchSubCategoryByMid(mid.getName());
+                mid.setChildren(subs);
+            }
+            big.setChildren(mids);
+        }
+        return bigs;
+    }
+
+    @Override
+    public List<Category> getWdTypeCategory() {
+        return categoryMapper.searchWdType();
+    }
+}

+ 30 - 0
benyun-core/src/main/java/com/benyun/core/service/impl/WdInfoServiceImpl.java

@@ -0,0 +1,30 @@
+package com.benyun.core.service.impl;
+
+import com.benyun.core.dao.WdInfoMapper;
+import com.benyun.core.entity.bo.WdAddrTypeDistribution;
+import com.benyun.core.service.WdInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class WdInfoServiceImpl implements WdInfoService {
+    @Autowired
+    WdInfoMapper wdInfoMapper;
+
+    @Override
+    public List<WdAddrTypeDistribution> searchAddrTypeDistribution(List<String> addrCodes, List<String> typeCodes) {
+        return wdInfoMapper.searchAddrDisByMulti(addrCodes, typeCodes);
+    }
+
+    @Override
+    public List<WdAddrTypeDistribution> searchWdTypeDistribution(List<String> addrCodes, List<String> typeCodes) {
+        return wdInfoMapper.searchWdTypeDisByMulti(addrCodes,typeCodes);
+    }
+
+    @Override
+    public List<WdAddrTypeDistribution> searchWdTotal() {
+        return wdInfoMapper.searchWdTotal();
+    }
+}

+ 19 - 0
benyun-core/src/main/resources/mapper/BrandCityMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.benyun.core.dao.BrandCityMapper">
+    <resultMap type="com.benyun.core.entity.BrandCity" id="BrandCityResult">
+        <result property="disId" column="dis_id"/>
+        <result property="brandId" column="brand_id"/>
+        <result property="addrCode" column="addr_code"/>
+        <result property="city" column="city"/>
+        <result property="latGd" column="lat_gd"/>
+        <result property="lngGd" column="lng_gd"/>
+        <result property="disCount" column="dis_count"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+    <select id="searchByBrandId" resultMap="BrandCityResult">
+        select * from bl_brand_city_distribution where brand_id = #{brandId}
+    </select>
+</mapper>

+ 133 - 0
benyun-core/src/main/resources/mapper/BrandMapper.xml

@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.benyun.core.dao.BrandMapper">
+    <resultMap type="com.benyun.core.entity.Brand" id="BrandResult">
+        <result property="brandId" column="brand_id"/>
+        <result property="brandImg" column="brand_img"/>
+        <result property="brandName" column="brand_name"/>
+        <result property="industryCode" column="industry_code"/>
+        <result property="enterpriseUsci" column="enterprise_usci"/>
+        <result property="perCapitaConsumption" column="per_capita_consumption"/>
+        <result property="commentCount" column="comment_count"/>
+        <result property="score" column="score"/>
+        <result property="menuInfo" column="menu_info"/>
+        <result property="indexScore" column="index_score"/>
+        <result property="createDate" column="create_date"/>
+        <result property="audit" column="audit"/>
+        <result property="collectPerson" column="collect_person"/>
+        <result property="collectTime" column="collect_time"/>
+        <result property="enterTime" column="enter_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="hash" column="hash"/>
+        <result property="agree" column="agree"/>
+        <result property="oppose" column="oppose"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.bo.BrandSearch" id="BrandSearchResult">
+        <result property="brandId" column="brand_id"/>
+        <result property="brandImg" column="brand_img"/>
+        <result property="brandName" column="brand_name"/>
+        <result property="indexScore" column="index_score"/>
+        <result property="enterpriseName" column="enterprise_name"/>
+        <result property="coverCityCount" column="cover_city_count"/>
+        <result property="total" column="total"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.bo.BrandAddrTypeDistribution" id="AddrTypeDisResult">
+        <result property="addrCode" column="addr_code"/>
+        <result property="industryCode" column="industry_code"/>
+        <result property="count" column="count"/>
+    </resultMap>
+    <select id="searchList" resultMap="BrandResult">
+        select * from ddt_origin_brand where brand_name like concat("%",#{text},"%")
+    </select>
+    <select id="searchById" resultMap="BrandResult">
+        select * from ddt_origin_brand where brand_id = #{brandId}
+    </select>
+    <select id="searchByIndustryCodeList" resultMap="BrandResult">
+        select * from ddt_origin_brand where industry_code = #{industryCode} and brand_id <![CDATA[<>]]> #{brandId}
+    </select>
+    <select id="searchSearchByMulti" resultMap="BrandSearchResult">
+        SELECT
+            dob.brand_id brand_id,
+            dob.brand_name brand_name,
+            brand_img,
+            index_score,
+            enterprise_name,
+            cover_city_count,
+            total,
+            bbs.update_time update_time
+        FROM
+            ddt_origin_brand dob,
+            ddt_origin_enterprise doe,
+            bl_brand_statistics bbs
+        WHERE
+            dob.enterprise_usci = doe.enterprise_usci
+        AND bbs.brand_id = dob.brand_id
+        <if test="text != null">
+            AND dob.brand_name LIKE concat('%',#{text},'%')
+        </if>
+        <if test="industryCode != null">
+            <foreach collection="industryCode" item="industry_code" open="AND dob.industry_code IN (" separator="," close=")">
+                #{industry_code,jdbcType=VARCHAR}
+            </foreach>
+        </if>
+        <if test="countDown != null">
+            AND #{countDown} <![CDATA[<=]]> total
+        </if>
+        <if test="countUp">
+            AND total <![CDATA[<=]]> #{countUp}
+        </if>
+        <if test="coverDown != null">
+            AND #{coverDown} <![CDATA[<=]]> cover_city_count
+        </if>
+        <if test="coverUp != null">
+            AND cover_city_count <![CDATA[<=]]> #{coverUp}
+        </if>
+        <if test="addrCode != null">
+            <foreach collection="addrCode" item="addr_code" open="AND addr_code IN (" separator="," close=")">
+                #{addr_code,jdbcType=VARCHAR}
+            </foreach>
+        </if>
+        <if test="orderBy == 1">
+            ORDER BY
+            dob.update_time
+        </if>
+        <if test="orderBy == 2">
+            ORDER BY
+            dob.total
+        </if>
+        <if test="orderBy == 3">
+            ORDER BY
+            dob.brand_id
+        </if>
+    </select>
+    <select id="searchAddrTypeDisByMulti" resultMap="AddrTypeDisResult">
+        SELECT
+            addr_code,
+            dob.industry_code,
+            COUNT(*) count
+        FROM
+            `ddt_origin_brand` dob,
+            `ddt_origin_enterprise` doe
+        WHERE
+            dob.enterprise_usci = doe.enterprise_usci
+          AND dob.enterprise_usci IS NOT NULL
+        <if test="addrCodes != null">
+            <foreach collection="addrCodes" item="addrCode" open="AND addr_code IN (" separator="," close=")">
+                #{addrCode,jdbcType=VARCHAR}
+            </foreach>
+        </if>
+        <if test="industryCodes != null">
+            <foreach collection="industryCodes" item="industryCode" open="AND dob.industry_code IN (" separator="," close=")">
+                #{industryCode,jdbcType=VARCHAR}
+            </foreach>
+        </if>
+        GROUP BY
+            addr_code,
+            dob.industry_code
+        ORDER BY count DESC;
+    </select>
+
+</mapper>

+ 20 - 0
benyun-core/src/main/resources/mapper/BrandProvinceMapper.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.benyun.core.dao.BrandProvinceMapper">
+    <resultMap type="com.benyun.core.entity.BrandProvince" id="BrandProvinceResult">
+        <result property="disId" column="dis_id"/>
+        <result property="brandId" column="brand_id"/>
+        <result property="addrCode" column="addr_code"/>
+        <result property="province" column="province"/>
+        <result property="latGd" column="lat_gd"/>
+        <result property="lngGd" column="lng_gd"/>
+        <result property="disCount" column="dis_count"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+    <select id="searchByBrandId" resultMap="BrandProvinceResult">
+        select * from bl_brand_province_distribution where brand_id = #{brandId}
+    </select>
+
+</mapper>

+ 25 - 0
benyun-core/src/main/resources/mapper/BrandStatisticsMapper.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.benyun.core.dao.BrandStatisticsMapper">
+    <resultMap type="com.benyun.core.entity.BrandStatistics" id="BrandStatisticsResult">
+        <result property="statId" column="stat_id"/>
+        <result property="brandId" column="brand_id"/>
+        <result property="brandName" column="brand_name"/>
+        <result property="coverProvinceCount" column="cover_province_count"/>
+        <result property="coverCityCount" column="cover_city_count"/>
+        <result property="coverZoneCount" column="cover_zone_count"/>
+        <result property="businessCount" column="business_count"/>
+        <result property="pauseBusinessCount" column="pause_business_count"/>
+        <result property="noBusinessCount" column="no_business_count"/>
+        <result property="total" column="total"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+    <select id="searchByBrandId" resultMap="BrandStatisticsResult">
+        select * from bl_brand_statistics where brand_id = #{brandId}
+    </select>
+    <select id="searchList" resultMap="BrandStatisticsResult">
+        select * from bl_brand_statistics order by total desc;
+    </select>
+</mapper>

+ 46 - 0
benyun-core/src/main/resources/mapper/BrandZoneMapper.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.benyun.core.dao.BrandZoneMapper">
+    <resultMap type="com.benyun.core.entity.BrandZone" id="BrandZoneResult">
+        <result property="disId" column="dis_id"/>
+        <result property="brandId" column="brand_id"/>
+        <result property="industryCode" column="industry_code"/>
+        <result property="addrCode" column="addr_code"/>
+        <result property="province" column="province"/>
+        <result property="city" column="city"/>
+        <result property="zone" column="zone"/>
+        <result property="latGd" column="lat_gd"/>
+        <result property="lngGd" column="lng_gd"/>
+        <result property="disCount" column="dis_count"/>
+        <result property="averageScore" column="average_score"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+    <select id="searchByBrandId" resultMap="BrandZoneResult">
+        select * from bl_brand_zone_distribution where brand_id = #{brandId}
+    </select>
+    <select id="searchByMulti" resultMap="BrandZoneResult">
+        SELECT
+            *
+        FROM
+            `bl_brand_zone_distribution`
+        <trim prefix="where" prefixOverrides="and">
+            <if test="brandIds != null">
+                <foreach collection="brandIds" item="brandId" open="and brand_id IN (" separator="," close=")">
+                    #{brandId,jdbcType=VARCHAR}
+                </foreach>
+            </if>
+            <if test="addrCodes != null">
+                <foreach collection="addrCodes" item="addrCode" open="and addr_code IN (" separator="," close=")">
+                    #{addrCode,jdbcType=VARCHAR}
+                </foreach>
+            </if>
+            <if test="industryCodes != null">
+                <foreach collection="industryCodes" item="industryCode" open="and industry_code IN (" separator="," close=")">
+                    #{industryCode,jdbcType=VARCHAR}
+                </foreach>
+            </if>
+        </trim>
+    </select>
+</mapper>

+ 67 - 0
benyun-core/src/main/resources/mapper/CategoryMapper.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.benyun.core.dao.CategoryMapper">
+    <resultMap type="com.benyun.core.entity.Category" id="ProvinceResult">
+        <result property="code" column="addr_code"/>
+        <result property="name" column="province"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="CityResult">
+        <result property="code" column="addr_code"/>
+        <result property="name" column="city"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="ZoneResult">
+        <result property="code" column="addr_code"/>
+        <result property="name" column="district"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="BigIndResult">
+        <result property="code" column="industry_code"/>
+        <result property="name" column="big_category"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="MidIndResult">
+        <result property="code" column="industry_code"/>
+        <result property="name" column="mid_category"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="BigResult">
+        <result property="name" column="big_category"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="MidResult">
+        <result property="name" column="mid_category"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="SubResult">
+        <result property="code" column="type_code_gd"/>
+        <result property="name" column="sub_category"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="WdTypeResult">
+        <result property="code" column="wd_type_code"/>
+        <result property="name" column="wd_type_name"/>
+    </resultMap>
+    <select id="searchProvince" resultMap="ProvinceResult">
+        select * from `ddt_addr_category` where city = ''
+    </select>
+    <select id="searchCityByProvince" resultMap="CityResult">
+        select * from`ddt_addr_category` where city <![CDATA[<>]]> '' and district = '' and province = #{province};
+    </select>
+    <select id="searchZoneByCity" resultMap="ZoneResult">
+        select * from `ddt_addr_category` where city <![CDATA[<>]]> '' and district <![CDATA[<>]]> '' and city = #{city};
+    </select>
+    <select id="searchBigIndustry" resultMap="BigIndResult">
+        select * from `ddt_industry_category` where mid_category = '';
+    </select>
+    <select id="searchMidIndustryByBig" resultMap="MidIndResult">
+        select * from `ddt_industry_category` where mid_category <![CDATA[<>]]> '' AND big_category = #{bigCategory};
+    </select>
+    <select id="searchBigCategory" resultMap="BigResult">
+        SELECT big_category FROM `ddt_type_gd` GROUP BY big_category
+    </select>
+    <select id="searchMidCategoryByBig" resultMap="MidResult">
+        SELECT mid_category FROM `ddt_type_gd` WHERE big_category = #{bigCategory} GROUP BY mid_category;
+    </select>
+    <select id="searchSubCategoryByMid" resultMap="SubResult">
+        SELECT * FROM `ddt_type_gd` WHERE mid_category = #{midCategory};
+    </select>
+    <select id="searchWdType" resultMap="WdTypeResult">
+        SELECT * FROM `ddt_wd_type`;
+    </select>
+</mapper>

+ 29 - 0
benyun-core/src/main/resources/mapper/EnterpriseMapper.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.benyun.core.dao.EnterpriseMapper">
+    <resultMap type="com.benyun.core.entity.Enterprise" id="EnterpriseResult">
+        <result property="enterpriseUsci" column="enterprise_usci"/>
+        <result property="enterpriseImg" column="enterprise_img"/>
+        <result property="enterpriseName" column="enterprise_name"/>
+        <result property="addrCode" column="addr_code"/>
+        <result property="addrInfo" column="addr_info"/>
+        <result property="enterpriseInfo" column="enterprise_info"/>
+        <result property="manageRangeInfo" column="manage_range_info"/>
+        <result property="enterpriseScale" column="enterprise_scale"/>
+        <result property="registeredCapital" column="registered_capital"/>
+        <result property="createTime" column="create_time"/>
+        <result property="enterpriseItin" column="enterprise_itin"/>
+        <result property="businessStatus" column="business_status"/>
+        <result property="industryCode" column="industry_code"/>
+        <result property="enterpriseType" column="enterprise_type"/>
+        <result property="creditScore" column="credit_score"/>
+        <result property="telephone" column="telephone"/>
+        <result property="website" column="website"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+    <select id="searchByUsci" resultMap="EnterpriseResult">
+        select * from ddt_origin_enterprise where enterprise_usci = #{enterpriseUsci}
+    </select>
+</mapper>

+ 79 - 0
benyun-core/src/main/resources/mapper/WdInfoMapper.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+    PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+    "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.benyun.core.dao.WdInfoMapper">
+    <resultMap type="com.benyun.core.entity.bo.WdAddrTypeDistribution" id="WdAddrDisResult">
+        <result property="addrCode" column="addr_code"/>
+        <result property="typeCode" column="type_code_gd"/>
+        <result property="count" column="count"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.bo.WdAddrTypeDistribution" id="WdTypeDisResult">
+        <result property="addrCode" column="addr_code"/>
+        <result property="typeCode" column="wd_type_code"/>
+        <result property="count" column="count"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.bo.WdAddrTypeDistribution" id="WdTotalDisResult">
+        <result property="typeCode" column="wd_type_code"/>
+        <result property="count" column="count"/>
+    </resultMap>
+    <select id="searchAddrDisByMulti" resultMap="WdAddrDisResult">
+        SELECT
+            addr_code,
+            type_code_gd,
+            COUNT(*) count
+        FROM
+            `ddt_origin_wd_info`
+        WHERE
+            wd_type_code = 1
+          AND type_code_gd IS NOT NULL
+        <if test="addrCodes != null">
+            <foreach collection="addrCodes" item="addrCode" open="AND addr_code IN (" separator="," close=")">
+                #{addrCode,jdbcType=VARCHAR}
+            </foreach>
+        </if>
+        <if test="typeCodes != null">
+            <foreach collection="typeCodes" item="typeCode" open="AND type_code_gd IN (" separator="," close=")">
+                #{typeCode,jdbcType=VARCHAR}
+            </foreach>
+        </if>
+        GROUP BY
+            addr_code,
+            type_code_gd
+        ORDER BY count DESC;
+    </select>
+    <select id="searchWdTypeDisByMulti" resultMap="WdTypeDisResult">
+        SELECT
+            addr_code,
+            wd_type_code,
+            COUNT(*) count
+        FROM
+            `ddt_origin_wd_info`
+        <trim prefix="WHERE" prefixOverrides="AND">
+            <if test="addrCodes != null">
+                <foreach collection="addrCodes" item="addrCode" open="AND addr_code IN (" separator="," close=")">
+                    #{addrCode,jdbcType=VARCHAR}
+                </foreach>
+            </if>
+            <if test="typeCodes != null">
+                <foreach collection="typeCodes" item="typeCode" open="AND wd_type_code IN (" separator="," close=")">
+                    #{typeCode,jdbcType=VARCHAR}
+                </foreach>
+            </if>
+        </trim>
+        GROUP BY
+            addr_code,
+            wd_type_code
+        ORDER BY count DESC
+    </select>
+    <select id="searchWdTotal" resultMap="WdTotalDisResult">
+        SELECT
+            wd_type_code,
+            COUNT(*) count
+        FROM
+            `ddt_origin_wd_info`
+        GROUP BY
+            wd_type_code
+        ORDER BY count DESC
+    </select>
+</mapper>

+ 123 - 0
benyun-core/src/test/java/com/benyun/core/service/BrandServiceImplTest.java

@@ -0,0 +1,123 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.bo.BrandAddrTypeDistribution;
+import com.benyun.core.entity.bo.BrandSearch;
+import com.benyun.core.entity.vo.BrandListQueryBody;
+import com.github.pagehelper.PageInfo;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@SpringBootTest
+public class BrandServiceImplTest {
+    @Autowired
+    BrandService brandService;
+
+    @Test
+    public void searchByLikeNameTest(){
+        List<BrandSearch> list = brandService.searchByLikeName("益禾堂");
+        for (BrandSearch brand : list) {
+            System.out.println(brand.toString());
+        }
+        list = brandService.searchByLikeName("sdfasdfasdf");
+        for (BrandSearch brand : list) {
+            System.out.println(brand.toString());
+        }
+    }
+
+    @Test
+    public void searchInfoByBrandIdTest(){
+        String brandId1 = "0b793eea1b4d414ca163a1151e730daa";
+        System.out.println(brandService.searchByBrandId(brandId1));
+        String brandId2 = "0b793eea1b4d4";
+        System.out.println(brandService.searchByBrandId(brandId2));
+    }
+
+    @Test
+    public void searchPropertyByBrandIdTest(){
+        String brandId1 = "5eb6d4ccee1d498997c26a140a4bef08";
+        System.out.println(brandService.searchPropertyByBrandId(brandId1));
+    }
+
+    @Test
+    public void searchSimilarByBrandIdTest(){
+        String brandId1 = "5eb6d4ccee1d498997c26a140a4bef08";
+        System.out.println(brandService.searchSimilarByBrandId(brandId1));
+    }
+
+    @Test
+    public void searchStatusByBrandIdTest(){
+        String brandId1 = "5eb6d4ccee1d498997c26a140a4bef08";
+        System.out.println(brandService.searchStatusByBrandId(brandId1));
+    }
+
+    @Test
+    public void searchDistributionByBrandIdTest(){
+        String brandId1 = "5eb6d4ccee1d498997c26a140a4bef08";
+        System.out.println(brandService.searchDistributionByBrandId(brandId1));
+    }
+
+    @Test
+    public void searchProvinceByBrandIdTest(){
+        String brandId1 = "5eb6d4ccee1d498997c26a140a4bef08";
+        System.out.println(brandService.searchProvinceByBrandId(brandId1));
+    }
+
+    @Test
+    public void searchDisCloudByBrandIdTest(){
+        String brandId1 = "5eb6d4ccee1d498997c26a140a4bef08";
+        System.out.println(brandService.searchDisCloudByBrandId(brandId1));
+    }
+
+    @Test
+    public void searchListByMultiTest(){
+        BrandListQueryBody body = new BrandListQueryBody();
+        body.setText("益禾堂");
+        List<String> industryCode = new ArrayList<>();
+        industryCode.add("199");
+        industryCode.add("28");
+        body.setIndustryCode(industryCode);
+        List<String> wdCount = new ArrayList<>();
+        wdCount.add("1");
+        wdCount.add("99999");
+        body.setWdCount(wdCount);
+        List<String> coverCityCount = new ArrayList<>();
+        coverCityCount.add("1");
+        coverCityCount.add("999");
+        body.setCoverCityCount(coverCityCount);
+//        "check_first_time":最近更新
+//        "total":网点数量
+//        "custom":智能排序
+        body.setOrderBy("check_first_time");
+        body.setPageNum(1);
+        body.setPageSize(10);
+        PageInfo<List<BrandSearch>> list = brandService.searchListByMulti(body);
+        System.out.println(list);
+    }
+
+    @Test
+    public void searchTotalTest(){
+        System.out.println(brandService.searchTotal());
+    }
+
+    @Test
+    public void searchAvgScoreByBrandIdTest(){
+        String brandId1 = "5eb6d4ccee1d498997c26a140a4bef08";
+        System.out.println(brandService.searchAvgScoreByBrandId(brandId1));
+    }
+
+    @Test
+    public void searchAddrTypeDisByMultiTest(){
+        List<String> addrCodes = new ArrayList<>();
+        addrCodes.add("410105000000");
+        addrCodes.add("420111000000");
+        List<String> industryCodes = new ArrayList<>();
+        industryCodes.add("199");
+        industryCodes.add("28");
+        List<BrandAddrTypeDistribution> list = brandService.searchAddrTypeDisByMulti(addrCodes, industryCodes);
+        System.out.println(list);
+    }
+}

+ 38 - 0
benyun-core/src/test/java/com/benyun/core/service/CategoryServiceImplTest.java

@@ -0,0 +1,38 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.Category;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.util.List;
+
+@SpringBootTest
+public class CategoryServiceImplTest {
+    @Autowired
+    CategoryService categoryService;
+
+    @Test
+    public void getAddrCategoryTest(){
+        List<Category> category = categoryService.getAddrCategory();
+        System.out.println(category);
+    }
+
+    @Test
+    public void getIndustryCategoryTest(){
+        List<Category> category = categoryService.getIndustryCategory();
+        System.out.println(category);
+    }
+
+    @Test
+    public void getTypeCategoryTest(){
+        List<Category> typeCategory = categoryService.getTypeGdCategory();
+        System.out.println(typeCategory);
+    }
+
+    @Test
+    public void getWdTypeCategoryTest(){
+        List<Category> categories = categoryService.getWdTypeCategory();
+        System.out.println(categories);
+    }
+}

+ 42 - 0
benyun-core/src/test/java/com/benyun/core/service/WdInfoServiceImplTest.java

@@ -0,0 +1,42 @@
+package com.benyun.core.service;
+
+import com.benyun.core.entity.bo.WdAddrTypeDistribution;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@SpringBootTest
+public class WdInfoServiceImplTest {
+    @Autowired
+    WdInfoService wdInfoService;
+
+    @Test
+    public void searchWdAddrDistributionTest(){
+        List<String> addrCodes = new ArrayList<>();
+        addrCodes.add("450902000000");
+        addrCodes.add("451302000000");
+        List<String> typeCodes = null;
+        List<WdAddrTypeDistribution> list = wdInfoService.searchAddrTypeDistribution(addrCodes, typeCodes);
+        System.out.println(list);
+    }
+
+    @Test
+    public void searchWdTypeDistributionTest(){
+        List<String> addrCodes = new ArrayList<>();
+        addrCodes.add("450981000000");
+        addrCodes.add("451002000000");
+        List<String> typeCodes = new ArrayList<>();
+        typeCodes.add("1");
+        typeCodes.add("0");
+        List<WdAddrTypeDistribution> list = wdInfoService.searchWdTypeDistribution(addrCodes, typeCodes);
+        System.out.println(list);
+    }
+
+    @Test
+    public void searchWdTotalTest(){
+        System.out.println(wdInfoService.searchWdTotal());
+    }
+}