This commit is contained in:
Lemon
2024-07-16 15:42:12 +08:00
5 changed files with 64 additions and 1 deletions

View File

@@ -366,4 +366,6 @@ public interface OrderBasicInfoMapper {
* @return
*/
List<SupStationStatsVO> queryOrderListByStationId(String stationId);
List<OrderListVO> queryOrderByOccupyTime(QueryOrderDTO dto);
}

View File

@@ -453,4 +453,11 @@ public interface OrderBasicInfoService{
* @return
*/
List<SupStationStatsVO> queryOrderListByStationId(String stationId);
/**
* 按占用时间查询订单
* @param dto
* @return
*/
List<OrderListVO> queryOrderByOccupyTime(QueryOrderDTO dto);
}

View File

@@ -3727,5 +3727,10 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
return orderVOS;
}
@Override
public List<OrderListVO> queryOrderByOccupyTime(QueryOrderDTO dto) {
return orderBasicInfoMapper.queryOrderByOccupyTime(dto);
}
}

View File

@@ -324,7 +324,7 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService {
// 查询在占桩期间创建的订单
dto.setStartTime(DateUtils.formatDateTime(startTime));
dto.setEndTime(DateUtils.formatDateTime(endTime));
List<OrderListVO> orderListVOS = orderBasicInfoService.selectOrderBasicInfoList(dto);
List<OrderListVO> orderListVOS = orderBasicInfoService.queryOrderByOccupyTime(dto);
/*
计算充电时长

View File

@@ -2904,4 +2904,53 @@
AND t1.charge_start_time <![CDATA[ >= ]]> DATE_SUB( CURDATE(), INTERVAL 1 DAY )
AND t1.charge_start_time <![CDATA[ < ]]> CURDATE()
</select>
<select id="queryOrderByOccupyTime" resultType="com.jsowell.pile.vo.web.OrderListVO">
SELECT t1.id as id,
t1.order_code as orderCode,
t1.transaction_code as transactionCode,
t1.order_status as orderStatus,
t1.member_id as memberId,
t2.nick_name as nickName,
t2.mobile_number as mobileNumber,
t1.station_id as stationId,
t3.station_name as stationName,
t1.pile_sn as pileSn,
t1.connector_code as connectorCode,
t1.logic_card as logicCard,
t1.vin_code as vinCode,
t1.plate_number as plateNumber,
t1.start_mode as startMode,
t1.third_party_type as thirdPartyType,
t1.pay_mode as payMode,
t1.pay_status as payStatus,
t1.pay_amount as payAmount,
t1.pay_time as payTime,
t1.order_amount as orderAmount,
t1.virtual_amount as virtualAmount,
t1.discount_amount as discountAmount,
t1.settle_amount as settleAmount,
t1.settlement_time as settlementTime,
t1.start_soc as startSoc,
t1.end_soc as endSoc,
t1.charge_start_time as chargeStartTime,
t1.charge_end_time as chargeEndTime,
t1.create_time as createTime,
t4.total_used_electricity as chargingDegree,
t4.total_electricity_amount as totalElectricityAmount,
t4.total_service_amount as totalServiceAmount,
t4.sharp_used_electricity as sharpElectricity,
t4.peak_used_electricity as peakElectricity,
t4.flat_used_electricity as flatElectricity,
t4.valley_used_electricity as valleyElectricity
from order_basic_info t1
left join member_basic_info t2 on t1.member_id = t2.member_id and t2.del_flag = '0'
join pile_station_info t3 on t1.station_id = t3.id and t3.del_flag = '0'
join order_detail t4 on t4.order_code = t1.order_code and t4.del_flag = '0'
where t1.del_flag = '0'
and `t1`.`member_id` = #{memberId,jdbcType=VARCHAR}
and `t1`.`station_id` = #{stationId,jdbcType=VARCHAR}
and `t1`.`create_time` <![CDATA[ >= ]]> #{endTime,jdbcType=VARCHAR}
and `t1`.`update_time` <![CDATA[ <= ]]> #{startTime,jdbcType=VARCHAR}
</select>
</mapper>