Browse Source

修改细节

云殇忆 1 year ago
parent
commit
28bc9f28cb
23 changed files with 159 additions and 126 deletions
  1. 1 1
      benyun-core/src/main/java/com/benyun/core/controller/BrandController.java
  2. 7 7
      benyun-core/src/main/java/com/benyun/core/controller/CategoryCotroller.java
  3. 1 1
      benyun-core/src/main/java/com/benyun/core/controller/WdInfoController.java
  4. 3 2
      benyun-core/src/main/java/com/benyun/core/dao/BrandMapper.java
  5. 2 1
      benyun-core/src/main/java/com/benyun/core/dao/BrandZoneMapper.java
  6. 3 2
      benyun-core/src/main/java/com/benyun/core/dao/CategoryMapper.java
  7. 3 2
      benyun-core/src/main/java/com/benyun/core/dao/WdInfoMapper.java
  8. 2 2
      benyun-core/src/main/java/com/benyun/core/entity/BrandCity.java
  9. 2 2
      benyun-core/src/main/java/com/benyun/core/entity/BrandProvince.java
  10. 3 3
      benyun-core/src/main/java/com/benyun/core/entity/BrandZone.java
  11. 2 2
      benyun-core/src/main/java/com/benyun/core/service/CategoryService.java
  12. 9 9
      benyun-core/src/main/java/com/benyun/core/service/impl/BrandServiceImpl.java
  13. 42 19
      benyun-core/src/main/java/com/benyun/core/service/impl/CategoryServiceImpl.java
  14. 2 2
      benyun-core/src/main/resources/mapper/BrandCityMapper.xml
  15. 22 22
      benyun-core/src/main/resources/mapper/BrandMapper.xml
  16. 2 2
      benyun-core/src/main/resources/mapper/BrandProvinceMapper.xml
  17. 3 3
      benyun-core/src/main/resources/mapper/BrandZoneMapper.xml
  18. 29 20
      benyun-core/src/main/resources/mapper/CategoryMapper.xml
  19. 1 1
      benyun-core/src/main/resources/mapper/EnterpriseMapper.xml
  20. 8 9
      benyun-core/src/main/resources/mapper/WdInfoMapper.xml
  21. 2 6
      benyun-core/src/test/java/com/benyun/core/service/BrandServiceImplTest.java
  22. 7 7
      benyun-core/src/test/java/com/benyun/core/service/CategoryServiceImplTest.java
  23. 3 1
      benyun-core/src/test/java/com/benyun/core/service/WdInfoServiceImplTest.java

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

@@ -17,7 +17,7 @@ import java.util.List;
 @Validated
 @RequiredArgsConstructor
 @RestController
-@RequestMapping("/bailianAi/brand")
+@RequestMapping("/brand")
 public class BrandController extends BaseController {
     @Autowired
     private BrandService brandService;

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

@@ -21,16 +21,16 @@ public class CategoryCotroller {
         return R.ok(categoryService.getAddrCategory());
     }
 
-//    获取行业分类
-    @GetMapping("/getIndustryCategory")
-    public R getIndustryCategory(){
-        return R.ok(categoryService.getIndustryCategory());
+//    获取经营分类
+    @GetMapping("/getManageCategory")
+    public R getManageCategory(){
+        return R.ok(categoryService.getManageCategory());
     }
 
 //    获取网点分类
-    @GetMapping("/getTypeGdCategory")
-    public R getTypeGdCategoryTest(){
-        return R.ok(categoryService.getTypeGdCategory());
+    @GetMapping("/getTypeByCategory")
+    public R getTypeByCategoryTest(){
+        return R.ok(categoryService.getTypeByCategory());
     }
 
 //    获取网点类型

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

@@ -15,7 +15,7 @@ import java.util.List;
 @Validated
 @RequiredArgsConstructor
 @RestController
-@RequestMapping("/bailianAi/originWd")
+@RequestMapping("/WdInfo")
 public class WdInfoController {
     @Autowired
     WdInfoService wdInfoService;

+ 3 - 2
benyun-core/src/main/java/com/benyun/core/dao/BrandMapper.java

@@ -4,6 +4,7 @@ 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 org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -12,6 +13,6 @@ 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);
+    List<BrandSearch> searchSearchByMulti(@Param("text") String text,@Param("industryCode") List<String> industryCode,@Param("countUp") Integer countUp,@Param("countDown") Integer countDown,@Param("coverUp") Integer coverUp,@Param("coverDown") Integer coverDown,@Param("addrCode") List<String> addrCode,@Param("orderBy") Integer orderBy);
+    List<BrandAddrTypeDistribution> searchAddrTypeDisByMulti(@Param("addrCodes") List<String> addrCodes,@Param("industryCodes") List<String> industryCodes);
 }

+ 2 - 1
benyun-core/src/main/java/com/benyun/core/dao/BrandZoneMapper.java

@@ -2,11 +2,12 @@ package com.benyun.core.dao;
 
 import com.benyun.core.entity.BrandZone;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 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);
+    List<BrandZone> searchByMulti(@Param("addrCodes") List<String> addrCodes,@Param("industryCodes") List<String> industryCodes,@Param("brandIds") List<String> brandIds);
 }

+ 3 - 2
benyun-core/src/main/java/com/benyun/core/dao/CategoryMapper.java

@@ -10,10 +10,11 @@ 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();
+    List<Category> searchBigManage();
+    List<Category> searchMidManageByBig(String bigCategory);
+    List<Category> searchSubManageByMid(String midCategory);
 }

+ 3 - 2
benyun-core/src/main/java/com/benyun/core/dao/WdInfoMapper.java

@@ -2,12 +2,13 @@ package com.benyun.core.dao;
 
 import com.benyun.core.entity.bo.WdAddrTypeDistribution;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 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> searchAddrDisByMulti(@Param("addrCodes") List<String> addrCodes,@Param("typeCodes") List<String> typeCodes);
+    List<WdAddrTypeDistribution> searchWdTypeDisByMulti(@Param("addrCodes") List<String> addrCodes,@Param("typeCodes") List<String> typeCodes);
     List<WdAddrTypeDistribution> searchWdTotal();
 }

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

@@ -12,8 +12,8 @@ public class BrandCity {
     private String brandId;
     private String addrCode;
     private String city;
-    private Float latGd;
-    private Float lngGd;
+    private Float lat;
+    private Float lng;
     private Integer disCount;
     private Date updateTime;
 }

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

@@ -12,8 +12,8 @@ public class BrandProvince {
     private String brandId;
     private String addrCode;
     private String province;
-    private Float latGd;
-    private Float lngGd;
+    private Float lat;
+    private Float lng;
     private Integer disCount;
     private Date updateTime;
 }

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

@@ -15,9 +15,9 @@ public class BrandZone {
     private String province;
     private String city;
     private String zone;
-    private Float latGd;
-    private Float lngGd;
+    private Float lat;
+    private Float lng;
     private Integer disCount;
-    private Float averageScore;
+    private Float avgScore;
     private Date updateTime;
 }

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

@@ -6,7 +6,7 @@ import java.util.List;
 
 public interface CategoryService {
     List<Category> getAddrCategory();
-    List<Category> getIndustryCategory();
-    List<Category> getTypeGdCategory();
+    List<Category> getTypeByCategory();
     List<Category> getWdTypeCategory();
+    List<Category> getManageCategory();
 }

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

@@ -97,11 +97,13 @@ public class BrandServiceImpl implements BrandService {
 //        先查询品牌id得到industryCode
         Brand brand = brandMapper.searchById(brandId);
         if (brand == null)
-            return null;
+            return new ArrayList<>();
 //        再根据industryCode得到其他品牌的信息
         if (brand.getIndustryCode() == null)
-            return null;
+            return new ArrayList<>();
         List<Brand> brands = brandMapper.searchByIndustryCodeList(brandId, brand.getIndustryCode());
+        if (brands.isEmpty())
+            return new ArrayList<>();
         List<BrandSimilar> similarList = new ArrayList<>();
         for (Brand b : brands){
             BrandSimilar bs = new BrandSimilar();
@@ -119,7 +121,7 @@ public class BrandServiceImpl implements BrandService {
 //        查询状态后拆分
         BrandStatistics statistics = brandStatisticsMapper.searchByBrandId(brandId);
         if (statistics == null)
-            return null;
+            return new ArrayList<>();
         int businessCount = statistics.getBusinessCount();
         int pauseBusinessCount = statistics.getPauseBusinessCount();
         int noBusinessCount = statistics.getNoBusinessCount();
@@ -142,8 +144,6 @@ public class BrandServiceImpl implements BrandService {
             status.setCount(noBusinessCount);
             statuses.add(status);
         }
-        if (statuses.isEmpty())
-            return null;
         return statuses;
     }
 
@@ -181,7 +181,7 @@ public class BrandServiceImpl implements BrandService {
         List<BrandProvince> provinces = brandProvinceMapper.searchByBrandId(brandId);
         BrandStatistics statistics = brandStatisticsMapper.searchByBrandId(brandId);
         if (provinces.isEmpty() || statistics == null)
-            return null;
+            return new ArrayList<>();
         int total = statistics.getTotal();
         List<BrandProvinceBo> bpbs = new ArrayList<>();
         for (BrandProvince bp : provinces){
@@ -190,7 +190,7 @@ public class BrandServiceImpl implements BrandService {
 //            bpb.setBrandId(bp.getBrandId());
             bpb.setCode(bp.getAddrCode());
             bpb.setName(bp.getProvince());
-            bpb.setLocation(bp.getLatGd().toString() + "," + bp.getLngGd().toString());
+            bpb.setLocation(bp.getLat().toString() + "," + bp.getLng().toString());
             bpb.setCount(disCount);
             float ratio = (float) disCount/total;
             bpb.setRatio((ratio*100) + "%");
@@ -255,7 +255,7 @@ public class BrandServiceImpl implements BrandService {
     public List<BrandTotal> searchTotal() {
         List<BrandStatistics> list = brandStatisticsMapper.searchList();
         if (list.isEmpty())
-            return null;
+            return new ArrayList<>();
         List<BrandTotal> tList = new ArrayList<>();
         for (BrandStatistics bs : list){
             BrandTotal bt = new BrandTotal();
@@ -282,7 +282,7 @@ public class BrandServiceImpl implements BrandService {
         for (BrandZone bz : zones){
             Info info = new Info();
             info.setAddrCode(bz.getAddrCode());
-            info.setAvgScore(bz.getAverageScore());
+            info.setAvgScore(bz.getAvgScore());
             infos.add(info);
         }
         bStoreData.setInfo(infos);

+ 42 - 19
benyun-core/src/main/java/com/benyun/core/service/impl/CategoryServiceImpl.java

@@ -44,19 +44,28 @@ public class CategoryServiceImpl implements CategoryService {
     }
 
     @Override
-    public List<Category> getIndustryCategory() {
-        List<Category> bigs = categoryMapper.searchBigIndustry();
+    public List<Category> getTypeByCategory() {
+        List<Category> bigs = categoryMapper.searchBigCategory();
         if (bigs.isEmpty())
             return null;
         for (Category big : bigs){
-            big.setType("big_category");
-            List<Category> mids = categoryMapper.searchMidIndustryByBig(big.getName());
+            big.setType("bigCategory");
+            List<Category> mids = categoryMapper.searchMidCategoryByBig(big.getName());
             if (mids.isEmpty())
                 big.setChildren(null);
-            else{
+            else {
                 for (Category mid : mids){
-                    mid.setType("mid_category");
-                    mid.setChildren(null);
+                    mid.setType("midCategory");
+                    List<Category> subs = categoryMapper.searchSubCategoryByMid(mid.getName());
+                    if (subs.isEmpty())
+                        mid.setChildren(null);
+                    else{
+                        for (Category sub : subs){
+                            sub.setType("subCategory");
+                            sub.setChildren(null);
+                        }
+                        mid.setChildren(subs);
+                    }
                 }
                 big.setChildren(mids);
             }
@@ -65,23 +74,37 @@ public class CategoryServiceImpl implements CategoryService {
     }
 
     @Override
-    public List<Category> getTypeGdCategory() {
-        List<Category> bigs = categoryMapper.searchBigCategory();
+    public List<Category> getWdTypeCategory() {
+        return categoryMapper.searchWdType();
+    }
+
+    @Override
+    public List<Category> getManageCategory() {
+        List<Category> bigs = categoryMapper.searchBigManage();
         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.setType("bigCategory");
+            List<Category> mids = categoryMapper.searchMidManageByBig(big.getName());
+            if (mids.isEmpty())
+                big.setChildren(null);
+            else {
+                for (Category mid : mids){
+                    mid.setType("midCategory");
+                    List<Category> subs = categoryMapper.searchSubManageByMid(mid.getName());
+                    if (subs.isEmpty())
+                        mid.setChildren(null);
+                    else{
+                        for (Category sub : subs){
+                            sub.setType("subCategory");
+                            sub.setChildren(null);
+                        }
+                        mid.setChildren(subs);
+                    }
+                }
+                big.setChildren(mids);
             }
-            big.setChildren(mids);
         }
         return bigs;
     }
-
-    @Override
-    public List<Category> getWdTypeCategory() {
-        return categoryMapper.searchWdType();
-    }
 }

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

@@ -8,8 +8,8 @@
         <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="lat" column="lat"/>
+        <result property="lng" column="lng"/>
         <result property="disCount" column="dis_count"/>
         <result property="updateTime" column="update_time"/>
     </resultMap>

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

@@ -40,36 +40,36 @@
         <result property="count" column="count"/>
     </resultMap>
     <select id="searchList" resultMap="BrandResult">
-        select * from ddt_origin_brand where brand_name like concat("%",#{text},"%")
+        select * from ddt_brand where brand_name like concat("%",#{text},"%")
     </select>
     <select id="searchById" resultMap="BrandResult">
-        select * from ddt_origin_brand where brand_id = #{brandId}
+        select * from ddt_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 * from ddt_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,
+            db.brand_id as brand_id,
+            db.brand_name as brand_name,
             brand_img,
             index_score,
             enterprise_name,
             cover_city_count,
             total,
-            bbs.update_time update_time
+            bbs.update_time as update_time
         FROM
-            ddt_origin_brand dob,
-            ddt_origin_enterprise doe,
+            ddt_brand db,
+            ddt_enterprise de,
             bl_brand_statistics bbs
         WHERE
-            dob.enterprise_usci = doe.enterprise_usci
-        AND bbs.brand_id = dob.brand_id
+            db.enterprise_usci = de.enterprise_usci
+        AND bbs.brand_id = db.brand_id
         <if test="text != null">
-            AND dob.brand_name LIKE concat('%',#{text},'%')
+            AND db.brand_name LIKE concat('%',#{text},'%')
         </if>
         <if test="industryCode != null">
-            <foreach collection="industryCode" item="industry_code" open="AND dob.industry_code IN (" separator="," close=")">
+            <foreach collection="industryCode" item="industry_code" open="AND db.industry_code IN (" separator="," close=")">
                 #{industry_code,jdbcType=VARCHAR}
             </foreach>
         </if>
@@ -92,41 +92,41 @@
         </if>
         <if test="orderBy == 1">
             ORDER BY
-            dob.update_time
+            db.update_time
         </if>
         <if test="orderBy == 2">
             ORDER BY
-            dob.total
+            db.total
         </if>
         <if test="orderBy == 3">
             ORDER BY
-            dob.brand_id
+            db.brand_id
         </if>
     </select>
     <select id="searchAddrTypeDisByMulti" resultMap="AddrTypeDisResult">
         SELECT
             addr_code,
-            dob.industry_code,
+            db.industry_code,
             COUNT(*) count
         FROM
-            `ddt_origin_brand` dob,
-            `ddt_origin_enterprise` doe
+            `ddt_brand` db,
+            `ddt_enterprise` de
         WHERE
-            dob.enterprise_usci = doe.enterprise_usci
-          AND dob.enterprise_usci IS NOT NULL
+            db.enterprise_usci = de.enterprise_usci
+          AND db.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=")">
+            <foreach collection="industryCodes" item="industryCode" open="AND db.industry_code IN (" separator="," close=")">
                 #{industryCode,jdbcType=VARCHAR}
             </foreach>
         </if>
         GROUP BY
             addr_code,
-            dob.industry_code
+            db.industry_code
         ORDER BY count DESC;
     </select>
 

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

@@ -8,8 +8,8 @@
         <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="lat" column="lat"/>
+        <result property="lng" column="lng"/>
         <result property="disCount" column="dis_count"/>
         <result property="updateTime" column="update_time"/>
     </resultMap>

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

@@ -11,10 +11,10 @@
         <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="lat" column="lat"/>
+        <result property="lng" column="lng"/>
         <result property="disCount" column="dis_count"/>
-        <result property="averageScore" column="average_score"/>
+        <result property="avgScore" column="avg_score"/>
         <result property="updateTime" column="update_time"/>
     </resultMap>
     <select id="searchByBrandId" resultMap="BrandZoneResult">

+ 29 - 20
benyun-core/src/main/resources/mapper/CategoryMapper.xml

@@ -15,22 +15,28 @@
         <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"/>
+    <resultMap type="com.benyun.core.entity.Category" id="BigTypeResult">
+        <result property="code" column="type_code_by"/>
         <result property="name" column="big_category"/>
     </resultMap>
-    <resultMap type="com.benyun.core.entity.Category" id="MidIndResult">
-        <result property="code" column="industry_code"/>
+    <resultMap type="com.benyun.core.entity.Category" id="MidTypeResult">
+        <result property="code" column="type_code_by"/>
         <result property="name" column="mid_category"/>
     </resultMap>
-    <resultMap type="com.benyun.core.entity.Category" id="BigResult">
+    <resultMap type="com.benyun.core.entity.Category" id="SubTypeResult">
+        <result property="code" column="type_code_by"/>
+        <result property="name" column="sub_category"/>
+    </resultMap>
+    <resultMap type="com.benyun.core.entity.Category" id="BigManageResult">
+        <result property="code" column="manage_type_code"/>
         <result property="name" column="big_category"/>
     </resultMap>
-    <resultMap type="com.benyun.core.entity.Category" id="MidResult">
+    <resultMap type="com.benyun.core.entity.Category" id="MidManageResult">
+        <result property="code" column="manage_type_code"/>
         <result property="name" column="mid_category"/>
     </resultMap>
-    <resultMap type="com.benyun.core.entity.Category" id="SubResult">
-        <result property="code" column="type_code_gd"/>
+    <resultMap type="com.benyun.core.entity.Category" id="SubManageResult">
+        <result property="code" column="manage_type_code"/>
         <result property="name" column="sub_category"/>
     </resultMap>
     <resultMap type="com.benyun.core.entity.Category" id="WdTypeResult">
@@ -46,22 +52,25 @@
     <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 id="searchBigCategory" resultMap="BigTypeResult">
+        select * from `ddt_type_by` where mid_category = ''
     </select>
-    <select id="searchMidCategoryByBig" resultMap="MidResult">
-        SELECT mid_category FROM `ddt_type_gd` WHERE big_category = #{bigCategory} GROUP BY mid_category;
+    <select id="searchMidCategoryByBig" resultMap="MidTypeResult">
+        select * from `ddt_type_by` where mid_category <![CDATA[<>]]> '' and sub_category = '' and big_category = #{bigCategory}
     </select>
-    <select id="searchSubCategoryByMid" resultMap="SubResult">
-        SELECT * FROM `ddt_type_gd` WHERE mid_category = #{midCategory};
+    <select id="searchSubCategoryByMid" resultMap="SubTypeResult">
+        select * from `ddt_type_by` where mid_category <![CDATA[<>]]> '' and sub_category <![CDATA[<>]]> '' and mid_category = #{midCategory}
     </select>
     <select id="searchWdType" resultMap="WdTypeResult">
         SELECT * FROM `ddt_wd_type`;
     </select>
+    <select id="searchBigManage" resultMap="BigManageResult">
+        select * from `ddt_manage_type` where mid_category = ''
+    </select>
+    <select id="searchMidManageByBig" resultMap="MidManageResult">
+        select * from `ddt_manage_type` where mid_category <![CDATA[<>]]> '' and sub_category = '' and big_category = #{bigCategory}
+    </select>
+    <select id="searchSubManageByMid" resultMap="SubManageResult">
+        select * from `ddt_manage_type` where mid_category <![CDATA[<>]]> '' and sub_category <![CDATA[<>]]> '' and mid_category = #{midCategory}
+    </select>
 </mapper>

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

@@ -24,6 +24,6 @@
         <result property="updateTime" column="update_time"/>
     </resultMap>
     <select id="searchByUsci" resultMap="EnterpriseResult">
-        select * from ddt_origin_enterprise where enterprise_usci = #{enterpriseUsci}
+        select * from ddt_enterprise where enterprise_usci = #{enterpriseUsci}
     </select>
 </mapper>

+ 8 - 9
benyun-core/src/main/resources/mapper/WdInfoMapper.xml

@@ -5,7 +5,7 @@
 <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="typeCode" column="type_code_by"/>
         <result property="count" column="count"/>
     </resultMap>
     <resultMap type="com.benyun.core.entity.bo.WdAddrTypeDistribution" id="WdTypeDisResult">
@@ -20,26 +20,25 @@
     <select id="searchAddrDisByMulti" resultMap="WdAddrDisResult">
         SELECT
             addr_code,
-            type_code_gd,
+            type_code_by,
             COUNT(*) count
         FROM
-            `ddt_origin_wd_info`
+            `ddt_wd_info`
         WHERE
-            wd_type_code = 1
-          AND type_code_gd IS NOT NULL
+            type_code_by 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=")">
+            <foreach collection="typeCodes" item="typeCode" open="AND type_code_by IN (" separator="," close=")">
                 #{typeCode,jdbcType=VARCHAR}
             </foreach>
         </if>
         GROUP BY
             addr_code,
-            type_code_gd
+            type_code_by
         ORDER BY count DESC;
     </select>
     <select id="searchWdTypeDisByMulti" resultMap="WdTypeDisResult">
@@ -48,7 +47,7 @@
             wd_type_code,
             COUNT(*) count
         FROM
-            `ddt_origin_wd_info`
+            `ddt_wd_info`
         <trim prefix="WHERE" prefixOverrides="AND">
             <if test="addrCodes != null">
                 <foreach collection="addrCodes" item="addrCode" open="AND addr_code IN (" separator="," close=")">
@@ -71,7 +70,7 @@
             wd_type_code,
             COUNT(*) count
         FROM
-            `ddt_origin_wd_info`
+            `ddt_wd_info`
         GROUP BY
             wd_type_code
         ORDER BY count DESC

+ 2 - 6
benyun-core/src/test/java/com/benyun/core/service/BrandServiceImplTest.java

@@ -19,13 +19,9 @@ public class BrandServiceImplTest {
     @Test
     public void searchByLikeNameTest(){
         List<BrandSearch> list = brandService.searchByLikeName("益禾堂");
-        for (BrandSearch brand : list) {
-            System.out.println(brand.toString());
-        }
+        System.out.println(list);
         list = brandService.searchByLikeName("sdfasdfasdf");
-        for (BrandSearch brand : list) {
-            System.out.println(brand.toString());
-        }
+        System.out.println(list);
     }
 
     @Test

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

@@ -18,15 +18,9 @@ public class CategoryServiceImplTest {
         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();
+        List<Category> typeCategory = categoryService.getTypeByCategory();
         System.out.println(typeCategory);
     }
 
@@ -35,4 +29,10 @@ public class CategoryServiceImplTest {
         List<Category> categories = categoryService.getWdTypeCategory();
         System.out.println(categories);
     }
+
+    @Test
+    public void getManageCategoryTest(){
+        List<Category> manageCategory = categoryService.getManageCategory();
+        System.out.println(manageCategory);
+    }
 }

+ 3 - 1
benyun-core/src/test/java/com/benyun/core/service/WdInfoServiceImplTest.java

@@ -18,7 +18,9 @@ public class WdInfoServiceImplTest {
         List<String> addrCodes = new ArrayList<>();
         addrCodes.add("450902000000");
         addrCodes.add("451302000000");
-        List<String> typeCodes = null;
+        List<String> typeCodes = new ArrayList<>();
+        typeCodes.add("020400");
+        typeCodes.add("020103");
         List<WdAddrTypeDistribution> list = wdInfoService.searchAddrTypeDistribution(addrCodes, typeCodes);
         System.out.println(list);
     }