fuxingfan 3 vuotta sitten
vanhempi
commit
c99b6d03c1

+ 14
- 3
src/main/java/com/yunzhi/marketing/xlk/controller/BrandController.java Näytä tiedosto

@@ -60,9 +60,8 @@ public class BrandController extends BaseController {
60 60
      * @return
61 61
      */
62 62
     @ApiOperation(value = "admin-品牌开发商表列表", notes = "admin-品牌开发商表列表")
63
-    @RequestMapping(value="/{plat}/brand",method= RequestMethod.GET)
64
-    public ResponseBean brandList(@PathVariable String plat,
65
-                                  @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
63
+    @RequestMapping(value="/admin/brand",method= RequestMethod.GET)
64
+    public ResponseBean brandList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
66 65
                                   @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
67 66
                                   @RequestParam(value ="brandName",required = false) String brandName,
68 67
                                   @RequestHeader("authorization") String token,HttpServletRequest request){
@@ -85,6 +84,18 @@ public class BrandController extends BaseController {
85 84
         return responseBean;
86 85
     }
87 86
 
87
+    /**
88
+     *
89
+     * @return
90
+     */
91
+    @ApiOperation(value = "wx-品牌开发商表列表", notes = "wx-品牌开发商表列表")
92
+    @RequestMapping(value="/wx/brand",method= RequestMethod.GET)
93
+    public ResponseBean wxBrandList(@RequestParam(value ="brandName",required = false) String brandName,
94
+                                  @RequestParam(value ="cityId",required = false) Integer cityId,
95
+                                  @RequestHeader("authorization") String token,HttpServletRequest request){
96
+        return iBrandService.getWxBrandList(cityId,brandName,getOrgId(request));
97
+    }
98
+
88 99
     /**
89 100
      * 保存对象
90 101
      * @param brandDTO 实体对象

+ 9
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/BrandMapper.java Näytä tiedosto

@@ -1,8 +1,10 @@
1 1
 package com.yunzhi.marketing.xlk.mapper;
2 2
 
3
+import com.yunzhi.marketing.base.ResponseBean;
3 4
 import com.yunzhi.marketing.xlk.entity.Brand;
4 5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
6 8
 
7 9
 /**
8 10
  * <p>
@@ -15,4 +17,11 @@ import org.apache.ibatis.annotations.Mapper;
15 17
 @Mapper
16 18
 public interface BrandMapper extends BaseMapper<Brand> {
17 19
 
20
+    /**
21
+     * 获取品牌开发商列表
22
+     * @param cityId
23
+     * @param brandName
24
+     * @return
25
+     */
26
+    ResponseBean getWxBrandList(Integer cityId, String brandName,Integer orgId);
18 27
 }

+ 8
- 0
src/main/java/com/yunzhi/marketing/xlk/service/IBrandService.java Näytä tiedosto

@@ -1,5 +1,6 @@
1 1
 package com.yunzhi.marketing.xlk.service;
2 2
 
3
+import com.yunzhi.marketing.base.ResponseBean;
3 4
 import com.yunzhi.marketing.xlk.entity.Brand;
4 5
 import com.baomidou.mybatisplus.extension.service.IService;
5 6
 
@@ -13,4 +14,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
13 14
  */
14 15
 public interface IBrandService extends IService<Brand> {
15 16
 
17
+    /**
18
+     * 获取微信端的品牌开发商
19
+     * @param cityId
20
+     * @param brandName
21
+     * @return
22
+     */
23
+    ResponseBean getWxBrandList(Integer cityId, String brandName, Integer orgId);
16 24
 }

+ 12
- 0
src/main/java/com/yunzhi/marketing/xlk/service/impl/BrandServiceImpl.java Näytä tiedosto

@@ -1,5 +1,6 @@
1 1
 package com.yunzhi.marketing.xlk.service.impl;
2 2
 
3
+import com.yunzhi.marketing.base.ResponseBean;
3 4
 import com.yunzhi.marketing.xlk.entity.Brand;
4 5
 import com.yunzhi.marketing.xlk.mapper.BrandMapper;
5 6
 import com.yunzhi.marketing.xlk.service.IBrandService;
@@ -17,4 +18,15 @@ import org.springframework.stereotype.Service;
17 18
 @Service
18 19
 public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements IBrandService {
19 20
 
21
+    /**
22
+     * 获取微信端的品牌开发商
23
+     *
24
+     * @param cityId
25
+     * @param brandName
26
+     * @return
27
+     */
28
+    @Override
29
+    public ResponseBean getWxBrandList(Integer cityId, String brandName,Integer orgId) {
30
+        return this.baseMapper.getWxBrandList(cityId, brandName,orgId);
31
+    }
20 32
 }

+ 25
- 0
src/main/resources/mapper/xlk/BrandMapper.xml Näytä tiedosto

@@ -2,4 +2,29 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.yunzhi.marketing.xlk.mapper.BrandMapper">
4 4
 
5
+    <select id="getWxBrandList" resultType="com.yunzhi.marketing.base.ResponseBean">
6
+        SELECT
7
+            b.*
8
+        FROM
9
+            xlk_brand b
10
+            INNER JOIN (
11
+            SELECT
12
+                t.building_id,
13
+                t.brand_id
14
+            FROM
15
+                ta_building t
16
+            WHERE
17
+                t.org_id = #{orgId}
18
+            <if test="cityId != null and cityId != ''">
19
+                AND t.city_id = #{cityId}
20
+            </if>
21
+            GROUP BY
22
+                t.brand_id
23
+            ) c ON b.brand_id = c.brand_id
24
+        WHERE
25
+            b.ORG_ID = #{orgId}
26
+        <if test="brandName != null and brandName != ''">
27
+            and b.brand_name like CONCAT('%', #{brandName}, '%')
28
+        </if>
29
+    </select>
5 30
 </mapper>