张延森 3 years ago
parent
commit
57eb3ef174

+ 1
- 1
deploy/bootstrap View File

2
 #
2
 #
3
 #
3
 #
4
 
4
 
5
-appVer="2.0.0"
5
+appVer="3.0.2"
6
 
6
 
7
 java -jar ./shigongli-${appVer}.jar
7
 java -jar ./shigongli-${appVer}.jar

+ 1
- 1
deploy/template.yml View File

11
       Properties:
11
       Properties:
12
         Handler: com.yunzhi.shigongli.SpringApplication::main
12
         Handler: com.yunzhi.shigongli.SpringApplication::main
13
         Runtime: custom
13
         Runtime: custom
14
-        CodeUri: 'oss://yz-serverless/shigongli/shigongli-2.0.0.zip'
14
+        CodeUri: 'oss://yz-serverless/shigongli/shigongli-3.0.2.zip'
15
         MemorySize: 1024
15
         MemorySize: 1024
16
         Timeout: 30
16
         Timeout: 30
17
         InitializationTimeout: 30
17
         InitializationTimeout: 30

+ 1
- 1
pom.xml View File

10
 	</parent>
10
 	</parent>
11
 	<groupId>com.yunzhi</groupId>
11
 	<groupId>com.yunzhi</groupId>
12
 	<artifactId>shigongli</artifactId>
12
 	<artifactId>shigongli</artifactId>
13
-	<version>3.0.1</version>
13
+	<version>3.0.2</version>
14
 	<name>shigongli</name>
14
 	<name>shigongli</name>
15
 	<description>Shi Gong Li</description>
15
 	<description>Shi Gong Li</description>
16
 
16
 

+ 3
- 1
src/main/java/com/yunzhi/shigongli/common/WxPayUtils.java View File

15
 import org.springframework.stereotype.Component;
15
 import org.springframework.stereotype.Component;
16
 
16
 
17
 import java.time.LocalDateTime;
17
 import java.time.LocalDateTime;
18
+import java.time.ZoneOffset;
18
 
19
 
19
 @Component
20
 @Component
20
 public class WxPayUtils {
21
 public class WxPayUtils {
32
      * @throws Exception
33
      * @throws Exception
33
      */
34
      */
34
     public WxPayMpOrderResult createOrder(TaPerson person, TaOrderPay orderPay) throws Exception {
35
     public WxPayMpOrderResult createOrder(TaPerson person, TaOrderPay orderPay) throws Exception {
35
-        LocalDateTime now = LocalDateTime.now();
36
+        // 北京时间
37
+        LocalDateTime now = LocalDateTime.now(ZoneOffset.ofHours(8));
36
         WxPayService payService = wxUtils.getPayService();
38
         WxPayService payService = wxUtils.getPayService();
37
 
39
 
38
         WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();
40
         WxPayUnifiedOrderRequest orderRequest = new WxPayUnifiedOrderRequest();

+ 25
- 0
src/main/java/com/yunzhi/shigongli/config/CorsConfig.java View File

1
+package com.yunzhi.shigongli.config;
2
+
3
+import org.springframework.boot.SpringBootConfiguration;
4
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
5
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6
+
7
+@SpringBootConfiguration
8
+public class CorsConfig implements WebMvcConfigurer {
9
+    @Override
10
+    public void addCorsMappings(CorsRegistry registry) {
11
+        //添加映射路径
12
+        registry.addMapping("/**")
13
+                //是否发送Cookie
14
+                .allowCredentials(true)
15
+                //设置放行哪些原始域
16
+                .allowedOrigins("*")
17
+                //放行哪些请求方式
18
+                .allowedMethods("GET", "POST", "PUT", "DELETE")
19
+                //.allowedMethods("*") //或者放行全部
20
+                //放行哪些原始请求头部信息
21
+                .allowedHeaders("*")
22
+                //暴露哪些原始请求头部信息
23
+                .exposedHeaders("X-Authorization-JWT");
24
+    }
25
+}

+ 54
- 11
src/main/java/com/yunzhi/shigongli/controller/TaTravelController.java View File

5
 import com.yunzhi.shigongli.common.*;
5
 import com.yunzhi.shigongli.common.*;
6
 import com.yunzhi.shigongli.entity.TaPerson;
6
 import com.yunzhi.shigongli.entity.TaPerson;
7
 import com.yunzhi.shigongli.entity.TaTravel;
7
 import com.yunzhi.shigongli.entity.TaTravel;
8
-import com.yunzhi.shigongli.entity.TaTravelItem;
9
 import com.yunzhi.shigongli.entity.TaTravelPerson;
8
 import com.yunzhi.shigongli.entity.TaTravelPerson;
10
-import com.yunzhi.shigongli.service.ITaPvService;
11
 import com.yunzhi.shigongli.service.ITaTravelItemService;
9
 import com.yunzhi.shigongli.service.ITaTravelItemService;
12
 import com.yunzhi.shigongli.service.ITaTravelPersonService;
10
 import com.yunzhi.shigongli.service.ITaTravelPersonService;
13
 import com.yunzhi.shigongli.service.ITaTravelService;
11
 import com.yunzhi.shigongli.service.ITaTravelService;
17
 import io.swagger.annotations.Api;
15
 import io.swagger.annotations.Api;
18
 import io.swagger.annotations.ApiOperation;
16
 import io.swagger.annotations.ApiOperation;
19
 import io.swagger.annotations.ApiParam;
17
 import io.swagger.annotations.ApiParam;
20
-import org.apache.ibatis.annotations.Delete;
21
 import org.slf4j.Logger;
18
 import org.slf4j.Logger;
22
 import org.slf4j.LoggerFactory;
19
 import org.slf4j.LoggerFactory;
23
 import org.springframework.beans.BeanUtils;
20
 import org.springframework.beans.BeanUtils;
25
 import org.springframework.web.bind.annotation.*;
22
 import org.springframework.web.bind.annotation.*;
26
 
23
 
27
 import java.time.LocalDateTime;
24
 import java.time.LocalDateTime;
28
-import java.util.ArrayList;
29
 import java.util.List;
25
 import java.util.List;
30
 
26
 
31
 /**
27
 /**
102
     }
98
     }
103
 
99
 
104
 
100
 
101
+    /**
102
+     * 删除行程
103
+     * @return
104
+     * @throws Exception
105
+     */
106
+    @DeleteMapping("/admin/travel/{id}")
107
+    @ApiOperation(value="删除行程", notes = "行程详情", httpMethod = "DELETE", response = TravelDataVO.class)
108
+    public ResponseBean deleteTravel(@ApiParam("行程ID") @PathVariable String id) throws Exception {
109
+        TaTravel taTravel = iTaTravelService.getById(id);
110
+        if (null == taTravel || taTravel.getStatus() == Constants.STATUS_DELETED) {
111
+            return ResponseBean.error("没有找到行程信息", ResponseBean.ERROR_ILLEGAL_PARAMS);
112
+        }
113
+
114
+        iTaTravelService.removeLogicById(id);
115
+
116
+        return ResponseBean.success(null);
117
+    }
118
+
119
+
120
+    /**
121
+     * 行程发布/取消发布
122
+     * @return
123
+     * @throws Exception
124
+     */
125
+    @PutMapping("/admin/travel/{id}/publish/{status}")
126
+    @ApiOperation(value="行程发布/取消发布", notes = "行程发布/取消发布", httpMethod = "PUT", response = TravelDataVO.class)
127
+    public ResponseBean publishTravel(@ApiParam("行程ID") @PathVariable String id,
128
+                                      @ApiParam(value = "发布状态", allowableValues = "on,off") @PathVariable String status) throws Exception {
129
+        TaTravel taTravel = iTaTravelService.getById(id);
130
+        if (null == taTravel || taTravel.getStatus() == Constants.STATUS_DELETED) {
131
+            return ResponseBean.error("没有找到行程信息", ResponseBean.ERROR_ILLEGAL_PARAMS);
132
+        }
133
+
134
+        if ("on".equals(status.toLowerCase())) {
135
+            taTravel.setStatus(Constants.STATUS_NORMAL);
136
+        } else {
137
+            taTravel.setStatus(Constants.STATUS_READY);
138
+        }
139
+
140
+        if (iTaTravelService.updateById(taTravel)) {
141
+            return ResponseBean.success(null);
142
+        } else {
143
+            return ResponseBean.error("操作失败, 请重试", ResponseBean.ERROR_UNAVAILABLE);
144
+        }
145
+    }
146
+
105
     /**
147
     /**
106
      * 行程详情
148
      * 行程详情
107
      * @return
149
      * @return
118
         TravelDataVO travelDataVO = new TravelDataVO();
160
         TravelDataVO travelDataVO = new TravelDataVO();
119
         BeanUtils.copyProperties(taTravel, travelDataVO);
161
         BeanUtils.copyProperties(taTravel, travelDataVO);
120
 
162
 
121
-        List<TravelItemDataVO> travelItemDetails = iTaTravelItemService.getTravelItemDetails(id);
163
+        List<TravelItemDataVO> travelItemDetails = iTaTravelItemService.getTravelItemDetails(id, null);
122
         travelDataVO.setTravelItemList(travelItemDetails);
164
         travelDataVO.setTravelItemList(travelItemDetails);
123
 
165
 
124
         return ResponseBean.success(travelDataVO);
166
         return ResponseBean.success(travelDataVO);
139
             return ResponseBean.success(null);
181
             return ResponseBean.success(null);
140
         }
182
         }
141
 
183
 
142
-        List<TravelItemDataVO> itemDataVOList = iTaTravelItemService.getTravelItemDetails(travelData.getTravelId());
184
+        List<TravelItemDataVO> itemDataVOList = iTaTravelItemService.getTravelItemDetails(travelData.getTravelId(), taPerson.getPersonId());
143
 
185
 
144
         travelData.setTravelItemList(itemDataVOList);
186
         travelData.setTravelItemList(itemDataVOList);
145
 
187
 
160
         TravelDataVO travelDataVO = new TravelDataVO();
202
         TravelDataVO travelDataVO = new TravelDataVO();
161
         BeanUtils.copyProperties(travel, travelDataVO);
203
         BeanUtils.copyProperties(travel, travelDataVO);
162
 
204
 
163
-        List<TravelItemDataVO> itemDataVOList = iTaTravelItemService.getTravelItemDetails(travel.getTravelId());
205
+        List<TravelItemDataVO> itemDataVOList = iTaTravelItemService.getTravelItemDetails(travel.getTravelId(), taPerson.getPersonId());
164
 
206
 
165
         travelDataVO.setTravelItemList(itemDataVOList);
207
         travelDataVO.setTravelItemList(itemDataVOList);
166
 
208
 
331
      */
373
      */
332
     @PutMapping("/wx/travel/{id}")
374
     @PutMapping("/wx/travel/{id}")
333
     @ApiOperation(value="更新我的行程", notes = "更新我的行程", httpMethod = "PUT", response = TaTravel.class)
375
     @ApiOperation(value="更新我的行程", notes = "更新我的行程", httpMethod = "PUT", response = TaTravel.class)
334
-    public ResponseBean updateTravel(@ApiParam("行程ID") @PathVariable String id,
376
+    public ResponseBean updateMyTravel(@ApiParam("行程ID") @PathVariable String id,
335
                                      @ApiParam("保存内容") @RequestBody TaTravel taTravel) throws Exception {
377
                                      @ApiParam("保存内容") @RequestBody TaTravel taTravel) throws Exception {
336
         TaTravelPerson taTravelPerson = iTaTravelPersonService.getByPerson(getCurrentPerson().getPersonId(), id);
378
         TaTravelPerson taTravelPerson = iTaTravelPersonService.getByPerson(getCurrentPerson().getPersonId(), id);
337
         if (null == taTravelPerson) {
379
         if (null == taTravelPerson) {
359
      */
401
      */
360
     @DeleteMapping("/wx/travel/{id}")
402
     @DeleteMapping("/wx/travel/{id}")
361
     @ApiOperation(value="删除我的行程", notes = "删除我的行程", httpMethod = "DELETE", response = TaTravel.class)
403
     @ApiOperation(value="删除我的行程", notes = "删除我的行程", httpMethod = "DELETE", response = TaTravel.class)
362
-    public ResponseBean deleteTravel(@ApiParam("行程ID") @PathVariable String id) throws Exception {
404
+    public ResponseBean deleteMyTravel(@ApiParam("行程ID") @PathVariable String id) throws Exception {
363
         TaTravelPerson taTravelPerson = iTaTravelPersonService.getByPerson(getCurrentPerson().getPersonId(), id);
405
         TaTravelPerson taTravelPerson = iTaTravelPersonService.getByPerson(getCurrentPerson().getPersonId(), id);
364
         if (null == taTravelPerson) {
406
         if (null == taTravelPerson) {
365
             return ResponseBean.error("未找到删除内容", ResponseBean.ERROR_UNAVAILABLE);
407
             return ResponseBean.error("未找到删除内容", ResponseBean.ERROR_UNAVAILABLE);
386
     @GetMapping("/wx/travel/{id}")
428
     @GetMapping("/wx/travel/{id}")
387
     @ApiOperation(value="我的行程详情", notes = "我的行程详情", httpMethod = "GET", response = TaTravel.class)
429
     @ApiOperation(value="我的行程详情", notes = "我的行程详情", httpMethod = "GET", response = TaTravel.class)
388
     public ResponseBean getMineTravel(@ApiParam("行程ID") @PathVariable String id) throws Exception {
430
     public ResponseBean getMineTravel(@ApiParam("行程ID") @PathVariable String id) throws Exception {
389
-        TaTravelPerson taTravelPerson = iTaTravelPersonService.getByPerson(getCurrentPerson().getPersonId(), id);
431
+        String personId = getCurrentPerson().getPersonId();
432
+        TaTravelPerson taTravelPerson = iTaTravelPersonService.getByPerson(personId, id);
390
         if (null == taTravelPerson) {
433
         if (null == taTravelPerson) {
391
             return ResponseBean.error("未找到行程内容", ResponseBean.ERROR_UNAVAILABLE);
434
             return ResponseBean.error("未找到行程内容", ResponseBean.ERROR_UNAVAILABLE);
392
         }
435
         }
399
         TravelDataVO travelDataVO = new TravelDataVO();
442
         TravelDataVO travelDataVO = new TravelDataVO();
400
         BeanUtils.copyProperties(origin, travelDataVO);
443
         BeanUtils.copyProperties(origin, travelDataVO);
401
 
444
 
402
-        List<TravelItemDataVO> travelItemDetails = iTaTravelItemService.getTravelItemDetails(id);
445
+        List<TravelItemDataVO> travelItemDetails = iTaTravelItemService.getTravelItemDetails(id, personId);
403
         travelDataVO.setTravelItemList(travelItemDetails);
446
         travelDataVO.setTravelItemList(travelItemDetails);
404
 
447
 
405
         return ResponseBean.success(travelDataVO);
448
         return ResponseBean.success(travelDataVO);

+ 1
- 1
src/main/java/com/yunzhi/shigongli/mapper/TaTravelItemMapper.java View File

21
 
21
 
22
     int copyTravelItems(@Param("srcId") String srcId, @Param("targId") String targId);
22
     int copyTravelItems(@Param("srcId") String srcId, @Param("targId") String targId);
23
 
23
 
24
-    List<TravelItemDataVO> getTravelItemDetails(@Param("travelId") String travelId);
24
+    List<TravelItemDataVO> getTravelItemDetails(@Param("travelId") String travelId, @Param("personId") String personId);
25
 
25
 
26
     Integer getMaxNoOf(@Param("travelId") String travelId, @Param("dayOrder") Integer dayOrder);
26
     Integer getMaxNoOf(@Param("travelId") String travelId, @Param("dayOrder") Integer dayOrder);
27
 }
27
 }

+ 1
- 1
src/main/java/com/yunzhi/shigongli/service/ITaTravelItemService.java View File

18
 
18
 
19
     Integer getMaxNoOf(String travelId, Integer dayOrder);
19
     Integer getMaxNoOf(String travelId, Integer dayOrder);
20
 
20
 
21
-    List<TravelItemDataVO> getTravelItemDetails(String travelId);
21
+    List<TravelItemDataVO> getTravelItemDetails(String travelId, String personId);
22
 
22
 
23
     List<TravelItemDataVO> updateTravelItems(String travelId, List<TravelItemDataVO> travelItemList) throws Exception;
23
     List<TravelItemDataVO> updateTravelItems(String travelId, List<TravelItemDataVO> travelItemList) throws Exception;
24
 }
24
 }

+ 3
- 4
src/main/java/com/yunzhi/shigongli/service/impl/TaTravelItemServiceImpl.java View File

1
 package com.yunzhi.shigongli.service.impl;
1
 package com.yunzhi.shigongli.service.impl;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
3
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
-import com.yunzhi.shigongli.entity.TaTravel;
5
 import com.yunzhi.shigongli.entity.TaTravelItem;
4
 import com.yunzhi.shigongli.entity.TaTravelItem;
6
 import com.yunzhi.shigongli.mapper.TaTravelItemMapper;
5
 import com.yunzhi.shigongli.mapper.TaTravelItemMapper;
7
 import com.yunzhi.shigongli.mapper.TaTravelMapper;
6
 import com.yunzhi.shigongli.mapper.TaTravelMapper;
33
     }
32
     }
34
 
33
 
35
     @Override
34
     @Override
36
-    public List<TravelItemDataVO> getTravelItemDetails(String travelId) {
37
-        return baseMapper.getTravelItemDetails(travelId);
35
+    public List<TravelItemDataVO> getTravelItemDetails(String travelId, String personId) {
36
+        return baseMapper.getTravelItemDetails(travelId, personId);
38
     }
37
     }
39
 
38
 
40
     /**
39
     /**
69
         // 保存明细
68
         // 保存明细
70
         saveBatch(travelItems);
69
         saveBatch(travelItems);
71
 
70
 
72
-        return getTravelItemDetails(travelId);
71
+        return getTravelItemDetails(travelId, null);
73
     }
72
     }
74
 }
73
 }

+ 2
- 2
src/main/java/com/yunzhi/shigongli/service/impl/TaTravelServiceImpl.java View File

37
         }
37
         }
38
 
38
 
39
         TravelDataVO travelDataVO = travelDataVOList.get(0);
39
         TravelDataVO travelDataVO = travelDataVOList.get(0);
40
-        List<TravelItemDataVO> itemDataVOList = taTravelItemMapper.getTravelItemDetails(travelId);
40
+        List<TravelItemDataVO> itemDataVOList = taTravelItemMapper.getTravelItemDetails(travelId, personId);
41
         travelDataVO.setTravelItemList(itemDataVOList);
41
         travelDataVO.setTravelItemList(itemDataVOList);
42
 
42
 
43
         return travelDataVO;
43
         return travelDataVO;
49
         if (simple || null == travelDataVOPage || null == travelDataVOPage.getRecords()) return travelDataVOPage;
49
         if (simple || null == travelDataVOPage || null == travelDataVOPage.getRecords()) return travelDataVOPage;
50
 
50
 
51
         for (TravelDataVO travelDataVO : travelDataVOPage.getRecords()) {
51
         for (TravelDataVO travelDataVO : travelDataVOPage.getRecords()) {
52
-            List<TravelItemDataVO> itemDataVOList = taTravelItemMapper.getTravelItemDetails(travelDataVO.getTravelId());
52
+            List<TravelItemDataVO> itemDataVOList = taTravelItemMapper.getTravelItemDetails(travelDataVO.getTravelId(), personId);
53
             travelDataVO.setTravelItemList(itemDataVOList);
53
             travelDataVO.setTravelItemList(itemDataVOList);
54
         }
54
         }
55
 
55
 

+ 3
- 0
src/main/java/com/yunzhi/shigongli/vo/TravelItemDataVO.java View File

66
 
66
 
67
     @ApiModelProperty(value = "区位父级名称")
67
     @ApiModelProperty(value = "区位父级名称")
68
     private String areaPName;
68
     private String areaPName;
69
+
70
+    @ApiModelProperty(value = "是否收藏")
71
+    private Integer isSaved;
69
 }
72
 }

+ 1
- 1
src/main/resources/application-prod.yml View File

25
     mchKey: fUbYPldU5bUCYRl97vMv69JQujsJ8dj5
25
     mchKey: fUbYPldU5bUCYRl97vMv69JQujsJ8dj5
26
     subAppId:
26
     subAppId:
27
     subMchId:
27
     subMchId:
28
-    keyPath: /opt/yunzhi/sgl-v2/cert/apiclient_cert.p12
28
+    keyPath: classpath:/cert/apiclient_cert.p12
29
     notifyUrl: https://sgl-v2.njyunzhi.com/api/wxpay/notify/order
29
     notifyUrl: https://sgl-v2.njyunzhi.com/api/wxpay/notify/order
30
     refundNotifyUrl: https://sgl-v2.njyunzhi.com/api/wxpay/notify/refund
30
     refundNotifyUrl: https://sgl-v2.njyunzhi.com/api/wxpay/notify/refund

+ 1
- 1
src/main/resources/application.yml View File

66
     mchKey: fUbYPldU5bUCYRl97vMv69JQujsJ8dj5
66
     mchKey: fUbYPldU5bUCYRl97vMv69JQujsJ8dj5
67
     subAppId:
67
     subAppId:
68
     subMchId:
68
     subMchId:
69
-    keyPath: E:/work/shigongli/v2/service/cert/apiclient_cert.p12
69
+    keyPath: classpath:/cert/apiclient_cert.p12
70
     notifyUrl: https://sgl-v2-test.njyunzhi.com/api/wxpay/notify/order
70
     notifyUrl: https://sgl-v2-test.njyunzhi.com/api/wxpay/notify/order
71
     refundNotifyUrl: https://sgl-v2-test.njyunzhi.com/api/wxpay/notify/refund
71
     refundNotifyUrl: https://sgl-v2-test.njyunzhi.com/api/wxpay/notify/refund
72
 
72
 

src/main/resources/logback.xml.bak → src/main/resources/logback.xml View File


+ 16
- 0
src/main/resources/mapper/TaNoteResourceMapper.xml View File

7
             s.*,
7
             s.*,
8
             <if test="personId != null and personId != ''">
8
             <if test="personId != null and personId != ''">
9
                 IFNULL(m.visited_num, 0) as is_visited,
9
                 IFNULL(m.visited_num, 0) as is_visited,
10
+                IFNULL(n.saved_num, 0) as is_saved,
10
             </if>
11
             </if>
11
             <if test="personId == null or personId == ''">
12
             <if test="personId == null or personId == ''">
12
                 0 as is_visited,
13
                 0 as is_visited,
14
+                0 as is_saved,
13
             </if>
15
             </if>
14
             c.area_name,
16
             c.area_name,
15
             d.area_id,
17
             d.area_id,
33
                         b.target_id
35
                         b.target_id
34
                 ) m ON m.target_type = s.target_type
36
                 ) m ON m.target_type = s.target_type
35
                     AND m.target_id = s.target_id
37
                     AND m.target_id = s.target_id
38
+                LEFT JOIN (
39
+                    SELECT
40
+                        a.target_type,
41
+                        a.target_id,
42
+                        count( 1 ) AS saved_num
43
+                    FROM
44
+                        ta_save a
45
+                    WHERE
46
+                        a.person_id = #{personId}
47
+                    GROUP BY
48
+                        a.target_type,
49
+                        a.target_id
50
+                    ) n ON n.target_type = s.target_type
51
+                        AND n.target_id = s.target_id
36
                 </if>
52
                 </if>
37
                 LEFT JOIN td_city c ON c.area_id = s.city_id
53
                 LEFT JOIN td_city c ON c.area_id = s.city_id
38
                 LEFT JOIN td_city d ON d.area_id = c.area_p_id
54
                 LEFT JOIN td_city d ON d.area_id = c.area_p_id

+ 19
- 0
src/main/resources/mapper/TaTravelItemMapper.xml View File

31
             s.weight,
31
             s.weight,
32
             s.city_id,
32
             s.city_id,
33
             s.save_num,
33
             s.save_num,
34
+            <if test="personId != null and personId != ''">
35
+                IFNULL(n.saved_num, 0) as is_saved,
36
+            </if>
34
             s.target_name,
37
             s.target_name,
35
             c.area_name,
38
             c.area_name,
36
             d.area_id,
39
             d.area_id,
41
                     AND s.target_id = t.target_id
44
                     AND s.target_id = t.target_id
42
                 LEFT JOIN td_city c ON c.area_id = s.city_id
45
                 LEFT JOIN td_city c ON c.area_id = s.city_id
43
                 LEFT JOIN td_city d ON d.area_id = c.area_p_id
46
                 LEFT JOIN td_city d ON d.area_id = c.area_p_id
47
+            <if test="personId != null and personId != ''">
48
+                LEFT JOIN (
49
+                    SELECT
50
+                        a.target_type,
51
+                        a.target_id,
52
+                        count( 1 ) AS saved_num
53
+                    FROM
54
+                        ta_save a
55
+                    WHERE
56
+                        a.person_id = #{personId}
57
+                    GROUP BY
58
+                        a.target_type,
59
+                        a.target_id
60
+                    ) n ON n.target_type = s.target_type
61
+                        AND n.target_id = s.target_id
62
+            </if>
44
         WHERE
63
         WHERE
45
             t.travel_id = #{travelId}
64
             t.travel_id = #{travelId}
46
           AND s.`status` &gt; -1
65
           AND s.`status` &gt; -1

+ 1
- 0
src/main/resources/mapper/TaTravelPersonMapper.xml View File

14
         WHERE
14
         WHERE
15
             s.person_id = #{personId}
15
             s.person_id = #{personId}
16
           AND t.is_destiny = 1
16
           AND t.is_destiny = 1
17
+          AND t.status &gt; -1
17
     </select>
18
     </select>
18
 </mapper>
19
 </mapper>