Bladeren bron

新需求

傅行帆 5 jaren geleden
bovenliggende
commit
c688c4a795

+ 14
- 11
src/main/java/com/huiju/estateagents/controller/TdCityController.java Bestand weergeven

@@ -1,10 +1,8 @@
1 1
 package com.huiju.estateagents.controller;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.baomidou.mybatisplus.core.metadata.IPage;
5
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4
+import com.huiju.estateagents.base.BaseController;
6 5
 import com.huiju.estateagents.base.ResponseBean;
7
-import com.huiju.estateagents.common.CommConstant;
8 6
 import com.huiju.estateagents.entity.TaMiniapp;
9 7
 import com.huiju.estateagents.entity.TaOrgCity;
10 8
 import com.huiju.estateagents.entity.TdCity;
@@ -14,14 +12,7 @@ import com.huiju.estateagents.service.ITdCityService;
14 12
 import org.slf4j.Logger;
15 13
 import org.slf4j.LoggerFactory;
16 14
 import org.springframework.beans.factory.annotation.Autowired;
17
-import org.springframework.web.bind.annotation.PathVariable;
18
-import org.springframework.web.bind.annotation.RequestBody;
19
-import org.springframework.web.bind.annotation.RequestMapping;
20
-import org.springframework.web.bind.annotation.RequestMethod;
21
-import org.springframework.web.bind.annotation.RequestParam;
22
-import org.springframework.web.bind.annotation.ResponseBody;
23
-import org.springframework.web.bind.annotation.RestController;
24
-import com.huiju.estateagents.base.BaseController;
15
+import org.springframework.web.bind.annotation.*;
25 16
 
26 17
 import javax.servlet.http.HttpServletRequest;
27 18
 import java.util.List;
@@ -78,6 +69,18 @@ public class TdCityController extends BaseController {
78 69
         return responseBean;
79 70
     }
80 71
 
72
+    /**
73
+     * 业务端城市
74
+     */
75
+    @RequestMapping(value = "/admin/tdCityList/tdAreaCity", method = RequestMethod.GET)
76
+    public ResponseBean adminTdAreaCityList(@RequestParam(value = "cityId", required = false) Integer cityId,
77
+                                    HttpServletRequest request) {
78
+        ResponseBean responseBean = new ResponseBean<>();
79
+        List<TaOrgCity> taOrgCityList = taOrgCityMapper.selectAdminTdAreaCityList(getOrgId(request),cityId);
80
+        responseBean.addSuccess(taOrgCityList);
81
+        return responseBean;
82
+    }
83
+
81 84
 
82 85
     /**
83 86
      * 查询列表

+ 8
- 0
src/main/java/com/huiju/estateagents/mapper/TaOrgCityMapper.java Bestand weergeven

@@ -27,4 +27,12 @@ public interface TaOrgCityMapper extends BaseMapper<TaOrgCity> {
27 27
      * @return
28 28
      */
29 29
     List<TaOrgCity> selectAdminTdCityList(Integer orgId);
30
+
31
+    /**
32
+     * 查询市下的区信息
33
+     * @param orgId
34
+     * @param cityId
35
+     * @return
36
+     */
37
+    List<TaOrgCity> selectAdminTdAreaCityList(Integer orgId, Integer cityId);
30 38
 }

+ 11
- 0
src/main/resources/mapper/TaOrgCity.xml Bestand weergeven

@@ -23,4 +23,15 @@
23 23
                 ORDER BY
24 24
                 c.pinyin
25 25
     </select>
26
+    <select id="selectAdminTdAreaCityList" resultType="com.huiju.estateagents.entity.TaOrgCity">
27
+        SELECT
28
+        id,
29
+        NAME,
30
+        parentid,
31
+        LEFT ( pinyin, 1 ) AS initial
32
+        FROM
33
+        td_city
34
+        WHERE
35
+        parentid = #{cityId}
36
+    </select>
26 37
 </mapper>