mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-12 05:50:16 +08:00
update查询用户常去站点(最近半年)
This commit is contained in:
@@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class UserFrquentedStationInfo {
|
||||
public class UserFrequentedStationInfo {
|
||||
/**
|
||||
* 站点id
|
||||
*/
|
||||
@@ -3,7 +3,7 @@ package com.jsowell.pile.mapper;
|
||||
import com.alipay.api.domain.ChargeOrderInfo;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.domain.UserFrquentedStationInfo;
|
||||
import com.jsowell.pile.domain.UserFrequentedStationInfo;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.dto.nanrui.NRQueryOrderDTO;
|
||||
import com.jsowell.pile.dto.ningxiajiaotou.NXJTQueryOrdersInfoDTO;
|
||||
@@ -408,7 +408,9 @@ public interface OrderBasicInfoMapper {
|
||||
/**
|
||||
* 查询用户常用站点信息
|
||||
* @param memberId
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
List<UserFrquentedStationInfo> queryUserFrquentedStation(String memberId);
|
||||
List<UserFrequentedStationInfo> queryUserFrequentedStation(@Param("memberId") String memberId ,@Param("startTime") LocalDateTime startTime ,@Param("endTime") LocalDateTime endTime);
|
||||
}
|
||||
@@ -549,5 +549,5 @@ public interface OrderBasicInfoService{
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
List<UserFrquentedStationInfo> queryUserFrquentedStation(String memberId);
|
||||
List<UserFrequentedStationInfo> queryUserFrequentedStation(String memberId);
|
||||
}
|
||||
|
||||
@@ -4957,13 +4957,15 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
|
||||
|
||||
/**
|
||||
* 查询用户常用充电站
|
||||
* 查询用户常用站点信息
|
||||
* @param memberId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<UserFrquentedStationInfo> queryUserFrquentedStation(String memberId) {
|
||||
return orderBasicInfoMapper.queryUserFrquentedStation(memberId);
|
||||
public List<UserFrequentedStationInfo> queryUserFrequentedStation(String memberId) {
|
||||
LocalDateTime endTime = LocalDateTime.now();
|
||||
LocalDateTime startTime = endTime.minusMonths(6);
|
||||
return orderBasicInfoMapper.queryUserFrequentedStation(memberId, startTime, endTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3119,20 +3119,20 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryUserFrquentedStation" resultType="com.jsowell.pile.domain.UserFrquentedStationInfo">
|
||||
<select id="queryUserFrequentedStation" resultType="com.jsowell.pile.domain.UserFrequentedStationInfo">
|
||||
SELECT
|
||||
obi.station_id AS stationId,
|
||||
psi.station_name AS stationName,
|
||||
COUNT(obi.id) AS chargeNum
|
||||
t1.station_id AS stationId,
|
||||
t2.station_name AS stationName,
|
||||
COUNT(t1.id) AS chargeNum
|
||||
FROM
|
||||
order_basic_info obi
|
||||
order_basic_info t1
|
||||
JOIN
|
||||
pile_station_info psi ON obi.station_id = psi.id
|
||||
pile_station_info t2 ON t1.station_id = t2.id
|
||||
WHERE
|
||||
obi.member_id = #{memberId}
|
||||
AND obi.create_time >= DATE_SUB(NOW(), INTERVAL 6 MONTH)
|
||||
t1.member_id = #{memberId}
|
||||
AND t1.create_time BETWEEN #{startTime} AND #{endTime}
|
||||
GROUP BY
|
||||
obi.station_id, psi.station_name
|
||||
t1.station_id, t2.station_name
|
||||
ORDER BY
|
||||
chargeNum DESC;
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user