|
@@ -85,14 +85,15 @@ public interface ZoneInfoRepository extends JpaRepository<ZoneInfo, Integer> {
|
85
|
85
|
@Modifying
|
86
|
86
|
@Query(nativeQuery = true,
|
87
|
87
|
value = "with t1 as (update zone_info set share_count = coalesce(share_count, 0) + 1 where zone_id = :zoneId)" +
|
88
|
|
- "insert into share_info(record_id, zone_id, user_id, share_code, share_time, can_use, shared_user_id) " +
|
89
|
|
- "select nextval('share_info_record_id_seq'), :zoneId, user_id, :shareCode, now(), 7 , :sharedUserId " +
|
|
88
|
+ "insert into share_info(record_id, zone_id, user_id, share_code, share_time, can_use, shared_user_id, share_type) " +
|
|
89
|
+ "select nextval('share_info_record_id_seq'), :zoneId, user_id, :shareCode, now(), 7 , :sharedUserId, :shareType " +
|
90
|
90
|
"from user_info where user_code = :userCode"
|
91
|
91
|
)
|
92
|
92
|
void share(@Param("zoneId") Integer zoneId,
|
93
|
93
|
@Param("userCode") String userCode,
|
94
|
94
|
@Param("shareCode") String shareCode,
|
95
|
|
- @Param("sharedUserId") Integer sharedUserId);
|
|
95
|
+ @Param("sharedUserId") Integer sharedUserId,
|
|
96
|
+ @Param("shareType") Integer shareType);
|
96
|
97
|
|
97
|
98
|
@Modifying
|
98
|
99
|
@Query(nativeQuery = true,
|
|
@@ -194,7 +195,7 @@ public interface ZoneInfoRepository extends JpaRepository<ZoneInfo, Integer> {
|
194
|
195
|
@Param("zoneId") Integer zoneId);
|
195
|
196
|
|
196
|
197
|
@Query(nativeQuery = true,
|
197
|
|
- value = "select zi.*, ui.display_name from zone_info zi, share_info si, user_info ui " +
|
|
198
|
+ value = "select zi.*, ui.display_name, si.share_type from zone_info zi, share_info si, user_info ui " +
|
198
|
199
|
"where zi.zone_id = si.zone_id and si.shared_user_id = :userId " +
|
199
|
200
|
"and si.accept_status = true " +
|
200
|
201
|
"and zi.zone_name like concat('%', :name, '%') " +
|