mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 优化汇总数据接口
This commit is contained in:
@@ -11,10 +11,7 @@ import com.jsowell.pile.vo.nanrui.NROrderInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.OrderVO;
|
||||
import com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO;
|
||||
import com.jsowell.pile.vo.uniapp.SendMessageVO;
|
||||
import com.jsowell.pile.vo.web.IndexOrderInfoVO;
|
||||
import com.jsowell.pile.vo.web.OrderListVO;
|
||||
import com.jsowell.pile.vo.web.OrderPayDetailVO;
|
||||
import com.jsowell.pile.vo.web.RefundOrder;
|
||||
import com.jsowell.pile.vo.web.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -266,4 +263,6 @@ public interface OrderBasicInfoMapper {
|
||||
* @return
|
||||
*/
|
||||
List<OrderVO> getOrderInfoByNXJT(NXJTQueryOrdersInfoDTO dto);
|
||||
|
||||
OrderTotalDataVO getOrderTotalData(QueryOrderDTO dto);
|
||||
}
|
||||
|
||||
@@ -373,13 +373,13 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
// @DataScope(deptAlias = "t3")
|
||||
public OrderTotalDataVO getOrderTotalData(QueryOrderDTO dto) {
|
||||
public OrderTotalDataVO getOrderTotalDataOld(QueryOrderDTO dto) {
|
||||
OrderTotalDataVO vo = new OrderTotalDataVO();
|
||||
// 只计算订单完成状态的
|
||||
dto.setOrderStatus(OrderStatusEnum.ORDER_COMPLETE.getValue());
|
||||
// 查询出所有符合条件的订单
|
||||
OrderTotalDataVO resultVO = orderBasicInfoMapper.getOrderTotalData(dto);
|
||||
List<OrderListVO> list = selectOrderBasicInfoList(dto);
|
||||
BigDecimal sumOrderAmount = BigDecimal.ZERO;
|
||||
BigDecimal sumUsedElectricity = BigDecimal.ZERO;
|
||||
@@ -410,6 +410,14 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
return vo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderTotalDataVO getOrderTotalData(QueryOrderDTO dto) {
|
||||
// 只计算订单完成状态的
|
||||
dto.setOrderStatus(OrderStatusEnum.ORDER_COMPLETE.getValue());
|
||||
OrderTotalDataVO resultVO = orderBasicInfoMapper.getOrderTotalData(dto);
|
||||
return resultVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询时间段内订单总金额和总用电量V2
|
||||
*
|
||||
|
||||
@@ -254,6 +254,64 @@
|
||||
order by t1.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getOrderTotalData" parameterType="com.jsowell.pile.dto.QueryOrderDTO" resultType="com.jsowell.pile.vo.web.OrderTotalDataVO">
|
||||
select
|
||||
IFNULL(sum(t1.order_amount),0) as sumOrderAmount,
|
||||
IFNULL(sum(t4.total_used_electricity),0) as sumUsedElectricity,
|
||||
IFNULL(sum(t1.settle_amount),0) as sumSettleAmount
|
||||
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'
|
||||
<if test="pileSn != null and pileSn != ''">
|
||||
and t1.pile_sn = #{pileSn,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="connectorCode != null and connectorCode != ''">
|
||||
and t1.connector_code = #{connectorCode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="memberId != null and memberId != ''">
|
||||
and t1.member_id = #{memberId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="orderStatus != null and orderStatus != ''">
|
||||
and t1.order_status = #{orderStatus,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="orderCode != null and orderCode != ''">
|
||||
and t1.order_code = #{orderCode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="transactionCode != null and transactionCode != ''">
|
||||
and t1.transaction_code = #{transactionCode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="mobileNumber != null and mobileNumber != ''">
|
||||
and t2.mobile_number = #{mobileNumber,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="stationId != null and stationId != ''">
|
||||
and t1.station_id = #{stationId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="startTime != null and startTime != ''">
|
||||
and t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="startSettleTime != null and startSettleTime != ''">
|
||||
and t1.settlement_time <![CDATA[ >= ]]> #{startSettleTime,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="endSettleTime != null and endSettleTime != ''">
|
||||
and t1.settlement_time <![CDATA[ <= ]]> #{endSettleTime,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="merchantId != null and merchantId != ''">
|
||||
and t1.merchant_id = #{merchantId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
|
||||
and t3.dept_id in
|
||||
<foreach collection="stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
|
||||
#{stationDeptId}
|
||||
</foreach>
|
||||
</if>
|
||||
order by t1.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectOrderBasicInfoById" parameterType="Long" resultMap="OrderBasicInfoOrderDetailResult">
|
||||
select a.id,
|
||||
a.order_code,
|
||||
@@ -1239,4 +1297,6 @@
|
||||
AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user