fuxingfan 3 年前
父节点
当前提交
c99b6d03c1

+ 14
- 3
src/main/java/com/yunzhi/marketing/xlk/controller/BrandController.java 查看文件

60
      * @return
60
      * @return
61
      */
61
      */
62
     @ApiOperation(value = "admin-品牌开发商表列表", notes = "admin-品牌开发商表列表")
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
                                   @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
65
                                   @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize,
67
                                   @RequestParam(value ="brandName",required = false) String brandName,
66
                                   @RequestParam(value ="brandName",required = false) String brandName,
68
                                   @RequestHeader("authorization") String token,HttpServletRequest request){
67
                                   @RequestHeader("authorization") String token,HttpServletRequest request){
85
         return responseBean;
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
      * @param brandDTO 实体对象
101
      * @param brandDTO 实体对象

+ 9
- 0
src/main/java/com/yunzhi/marketing/xlk/mapper/BrandMapper.java 查看文件

1
 package com.yunzhi.marketing.xlk.mapper;
1
 package com.yunzhi.marketing.xlk.mapper;
2
 
2
 
3
+import com.yunzhi.marketing.base.ResponseBean;
3
 import com.yunzhi.marketing.xlk.entity.Brand;
4
 import com.yunzhi.marketing.xlk.entity.Brand;
4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
 import org.apache.ibatis.annotations.Mapper;
6
 import org.apache.ibatis.annotations.Mapper;
7
+import org.apache.ibatis.annotations.Param;
6
 
8
 
7
 /**
9
 /**
8
  * <p>
10
  * <p>
15
 @Mapper
17
 @Mapper
16
 public interface BrandMapper extends BaseMapper<Brand> {
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 查看文件

1
 package com.yunzhi.marketing.xlk.service;
1
 package com.yunzhi.marketing.xlk.service;
2
 
2
 
3
+import com.yunzhi.marketing.base.ResponseBean;
3
 import com.yunzhi.marketing.xlk.entity.Brand;
4
 import com.yunzhi.marketing.xlk.entity.Brand;
4
 import com.baomidou.mybatisplus.extension.service.IService;
5
 import com.baomidou.mybatisplus.extension.service.IService;
5
 
6
 
13
  */
14
  */
14
 public interface IBrandService extends IService<Brand> {
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 查看文件

1
 package com.yunzhi.marketing.xlk.service.impl;
1
 package com.yunzhi.marketing.xlk.service.impl;
2
 
2
 
3
+import com.yunzhi.marketing.base.ResponseBean;
3
 import com.yunzhi.marketing.xlk.entity.Brand;
4
 import com.yunzhi.marketing.xlk.entity.Brand;
4
 import com.yunzhi.marketing.xlk.mapper.BrandMapper;
5
 import com.yunzhi.marketing.xlk.mapper.BrandMapper;
5
 import com.yunzhi.marketing.xlk.service.IBrandService;
6
 import com.yunzhi.marketing.xlk.service.IBrandService;
17
 @Service
18
 @Service
18
 public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements IBrandService {
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 查看文件

2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.yunzhi.marketing.xlk.mapper.BrandMapper">
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
 </mapper>
30
 </mapper>