update 首页订单列表数据更换接口

This commit is contained in:
Lemon
2023-08-03 13:49:50 +08:00
parent 963adbe46e
commit 382d9bdcac
5 changed files with 301 additions and 232 deletions

View File

@@ -116,11 +116,11 @@ public class AgentDevService {
} }
String redisKey = CacheConstants.COMPONENT_VERIFY_TICKET + PLATFORM_APP_ID; String redisKey = CacheConstants.COMPONENT_VERIFY_TICKET + PLATFORM_APP_ID;
// 查缓存,看是否已经过期 // 查缓存,看是否已经过期
String verifyTicket = redisCache.getCacheObject(redisKey); // String verifyTicket = redisCache.getCacheObject(redisKey);
if (verifyTicket != null) { // if (verifyTicket != null) {
// 先删除旧缓存 // // 先删除旧缓存
redisCache.deleteObject(redisKey); // redisCache.deleteObject(redisKey);
} // }
// 存入Redis 过期时间: 官方12小时但十分钟推送一次, 因此可设置 20 分钟过期 // 存入Redis 过期时间: 官方12小时但十分钟推送一次, 因此可设置 20 分钟过期
redisCache.setCacheObject(redisKey, componentVerifyTicket, 20, TimeUnit.MINUTES); redisCache.setCacheObject(redisKey, componentVerifyTicket, 20, TimeUnit.MINUTES);
String newVerifyTicket = redisCache.getCacheObject(redisKey); String newVerifyTicket = redisCache.getCacheObject(redisKey);

View File

@@ -159,6 +159,13 @@ public interface OrderBasicInfoMapper {
*/ */
List<IndexOrderInfoVO> getIndexOrderInfo(@Param("dto") IndexQueryDTO dto); List<IndexOrderInfoVO> getIndexOrderInfo(@Param("dto") IndexQueryDTO dto);
/**
* 首页订单数据展示 V2
* @param dto 首页信息查询dto
* @return
*/
List<IndexOrderInfoVO> getIndexOrderInfoV2(@Param("dto") IndexQueryDTO dto);
/** /**
* 获取超过15分钟的待支付状态订单 * 获取超过15分钟的待支付状态订单
* @return * @return
@@ -225,4 +232,11 @@ public interface OrderBasicInfoMapper {
* @return * @return
*/ */
List<OrderBasicInfo> queryOrderList(@Param("orderCodeList") List<String> orderCodeList); List<OrderBasicInfo> queryOrderList(@Param("orderCodeList") List<String> orderCodeList);
/**
* 获取首页订单详情
* @param orderCodeList
* @return
*/
IndexOrderInfoVO getIndexOrderDetail(@Param("list") List<String> orderCodeList);
} }

View File

@@ -1546,7 +1546,27 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
} }
} }
dto.setStationIdList(stationIdList); dto.setStationIdList(stationIdList);
return orderBasicInfoMapper.getIndexOrderInfo(dto); // return orderBasicInfoMapper.getIndexOrderInfo(dto);
List<IndexOrderInfoVO> voList = orderBasicInfoMapper.getIndexOrderInfoV2(dto);
for (IndexOrderInfoVO indexOrderInfoVO : voList) {
String orderCodes = indexOrderInfoVO.getOrderCodes();
// 获取到所有的订单号列表
if (StringUtils.isBlank(orderCodes)) {
continue;
}
List<String> orderCodeList = Arrays.asList(orderCodes.split(","));
// 查询对应数据
IndexOrderInfoVO detailInfo = orderBasicInfoMapper.getIndexOrderDetail(orderCodeList);
if (detailInfo == null) {
continue;
}
indexOrderInfoVO.setTotalSharpUsedElectricity(detailInfo.getTotalSharpUsedElectricity());
indexOrderInfoVO.setTotalPeakUsedElectricity(detailInfo.getTotalPeakUsedElectricity());
indexOrderInfoVO.setTotalFlatUsedElectricity(detailInfo.getTotalFlatUsedElectricity());
indexOrderInfoVO.setTotalValleyUsedElectricity(detailInfo.getTotalValleyUsedElectricity());
}
return voList;
} }
/** /**

View File

@@ -15,6 +15,11 @@ public class IndexOrderInfoVO {
*/ */
private String date; private String date;
/**
* 订单号数组
*/
private String orderCodes;
/** /**
* 总用电量 * 总用电量
*/ */

View File

@@ -40,7 +40,8 @@
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
</resultMap> </resultMap>
<resultMap id="OrderBasicInfoOrderDetailResult" type="com.jsowell.pile.domain.OrderBasicInfo" extends="OrderBasicInfoResult"> <resultMap id="OrderBasicInfoOrderDetailResult" type="com.jsowell.pile.domain.OrderBasicInfo"
extends="OrderBasicInfoResult">
<collection property="orderDetailList" notNullColumn="sub_id" javaType="java.util.List" <collection property="orderDetailList" notNullColumn="sub_id" javaType="java.util.List"
resultMap="OrderDetailResult"/> resultMap="OrderDetailResult"/>
</resultMap> </resultMap>
@@ -156,9 +157,9 @@
del_flag del_flag
</sql> </sql>
<select id="selectOrderBasicInfoList" parameterType="com.jsowell.pile.dto.QueryOrderDTO" resultType="com.jsowell.pile.vo.web.OrderListVO"> <select id="selectOrderBasicInfoList" parameterType="com.jsowell.pile.dto.QueryOrderDTO"
SELECT resultType="com.jsowell.pile.vo.web.OrderListVO">
t1.id as id, SELECT t1.id as id,
t1.order_code as orderCode, t1.order_code as orderCode,
t1.transaction_code as transactionCode, t1.transaction_code as transactionCode,
t1.order_status as orderStatus, t1.order_status as orderStatus,
@@ -234,12 +235,12 @@
and t1.merchant_id = #{merchantId,jdbcType=VARCHAR} and t1.merchant_id = #{merchantId,jdbcType=VARCHAR}
</if> </if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
<!-- <if test="merchantDeptIds != null and merchantDeptIds.size() != 0">--> <!-- <if test="merchantDeptIds != null and merchantDeptIds.size() != 0">-->
<!-- and t3.dept_id in--> <!-- and t3.dept_id in-->
<!-- <foreach collection="merchantDeptIds" item="merchantDeptId" open="(" separator="," close=")">--> <!-- <foreach collection="merchantDeptIds" item="merchantDeptId" open="(" separator="," close=")">-->
<!-- #{merchantDeptId}--> <!-- #{merchantDeptId}-->
<!-- </foreach>--> <!-- </foreach>-->
<!-- </if>--> <!-- </if>-->
<if test="stationDeptIds != null and stationDeptIds.size() != 0"> <if test="stationDeptIds != null and stationDeptIds.size() != 0">
and t3.dept_id in and t3.dept_id in
<foreach collection="stationDeptIds" item="stationDeptId" open="(" separator="," close=")"> <foreach collection="stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
@@ -297,7 +298,8 @@
where a.id = #{id} where a.id = #{id}
</select> </select>
<insert id="insertOrderBasicInfo" parameterType="com.jsowell.pile.domain.OrderBasicInfo" useGeneratedKeys="true" keyProperty="id"> <insert id="insertOrderBasicInfo" parameterType="com.jsowell.pile.domain.OrderBasicInfo" useGeneratedKeys="true"
keyProperty="id">
insert into order_basic_info insert into order_basic_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null"> <if test="orderCode != null">
@@ -629,19 +631,29 @@
</delete> </delete>
<insert id="batchOrderDetail"> <insert id="batchOrderDetail">
insert into order_detail(id, order_code, total_used_electricity, total_order_amount, total_electricity_amount,total_service_amount, insert into order_detail(id, order_code, total_used_electricity, total_order_amount, total_electricity_amount,
sharp_price, sharp_used_electricity, sharp_electricity_price, sharp_service_price, sharp_amount, total_service_amount,
peak_price, peak_used_electricity, peak_electricity_price, peak_service_price, peak_amount, sharp_price, sharp_used_electricity, sharp_electricity_price, sharp_service_price,
flat_price, flat_used_electricity, flat_electricity_price, flat_service_price, flat_amount, sharp_amount,
valley_price, valley_used_electricity, valley_electricity_price, valley_service_price, valley_amount, peak_price, peak_used_electricity, peak_electricity_price, peak_service_price,
create_by,update_by) peak_amount,
flat_price, flat_used_electricity, flat_electricity_price, flat_service_price,
flat_amount,
valley_price, valley_used_electricity, valley_electricity_price, valley_service_price,
valley_amount,
create_by, update_by)
values values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
(#{item.id}, #{item.orderCode}, #{item.totalUsedElectricity}, #{item.totalOrderAmount}, #{item.totalElectricityAmount}, #{item.totalServiceAmount}, (#{item.id}, #{item.orderCode}, #{item.totalUsedElectricity}, #{item.totalOrderAmount},
#{item.sharpPrice}, #{item.sharpUsedElectricity}, #{item.sharpElectricityPrice}, #{item.sharpServicePrice}, #{item.sharpAmount}, #{item.totalElectricityAmount}, #{item.totalServiceAmount},
#{item.peakPrice}, #{item.peakUsedElectricity}, #{item.peakElectricityPrice}, #{item.peakServicePrice}, #{item.peakAmount}, #{item.sharpPrice}, #{item.sharpUsedElectricity}, #{item.sharpElectricityPrice}, #{item.sharpServicePrice},
#{item.flatPrice}, #{item.flatUsedElectricity}, #{item.flatElectricityPrice}, #{item.flatServicePrice}, #{item.flatAmount}, #{item.sharpAmount},
#{item.valleyPrice}, #{item.valleyUsedElectricity}, #{item.valleyElectricityPrice}, #{item.valleyServicePrice}, #{item.valleyAmount}, #{item.peakPrice}, #{item.peakUsedElectricity}, #{item.peakElectricityPrice}, #{item.peakServicePrice},
#{item.peakAmount},
#{item.flatPrice}, #{item.flatUsedElectricity}, #{item.flatElectricityPrice}, #{item.flatServicePrice},
#{item.flatAmount},
#{item.valleyPrice}, #{item.valleyUsedElectricity}, #{item.valleyElectricityPrice},
#{item.valleyServicePrice}, #{item.valleyAmount},
#{item.createBy}, #{item.updateBy}) #{item.createBy}, #{item.updateBy})
</foreach> </foreach>
</insert> </insert>
@@ -777,8 +789,7 @@
</select> </select>
<select id="getListByMemberIdAndOrderStatus" resultType="com.jsowell.pile.vo.uniapp.OrderVO"> <select id="getListByMemberIdAndOrderStatus" resultType="com.jsowell.pile.vo.uniapp.OrderVO">
SELECT SELECT t1.id,
t1.id,
t1.order_code as orderCode, t1.order_code as orderCode,
t1.order_status as orderStatus, t1.order_status as orderStatus,
t1.reason, t1.reason,
@@ -818,26 +829,24 @@
</select> </select>
<update id="updateOrderStatusByOrderCode"> <update id="updateOrderStatusByOrderCode">
update order_basic_info set order_status = #{orderStatus,jdbcType=VARCHAR} update order_basic_info
set order_status = #{orderStatus,jdbcType=VARCHAR}
where del_flag = '0' where del_flag = '0'
and order_code = #{orderCode,jdbcType=VARCHAR} and order_code = #{orderCode,jdbcType=VARCHAR}
</update> </update>
<select id="getIndexOrderInfo" resultType="com.jsowell.pile.vo.web.IndexOrderInfoVO"> <select id="getIndexOrderInfo" resultType="com.jsowell.pile.vo.web.IndexOrderInfoVO">
SELECT SELECT DATE_FORMAT(t1.create_time, '%Y-%m-%d') as date,
DATE_FORMAT(t1.create_time,'%Y-%m-%d') as date, sum(t2.total_used_electricity) AS totalElectricity,
sum( t2.total_used_electricity ) AS totalElectricity, sum(t2.total_order_amount) AS totalOrderAmount,
sum( t2.total_order_amount ) AS totalOrderAmount, sum(t2.sharp_used_electricity) AS totalSharpUsedElectricity,
sum( t2.sharp_used_electricity ) AS totalSharpUsedElectricity, sum(t2.peak_used_electricity) AS totalPeakUsedElectricity,
sum( t2.peak_used_electricity ) AS totalPeakUsedElectricity, sum(t2.flat_used_electricity) AS totalFlatUsedElectricity,
sum( t2.flat_used_electricity ) AS totalFlatUsedElectricity, sum(t2.valley_used_electricity) AS totalValleyUsedElectricity
sum( t2.valley_used_electricity ) AS totalValleyUsedElectricity FROM order_basic_info t1
FROM
order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code JOIN order_detail t2 ON t1.order_code = t2.order_code
AND t1.del_flag = '0' AND t1.del_flag = '0'
WHERE WHERE date(t1.create_time) >= DATE_SUB(CURDATE(), INTERVAL 30 day)
date(t1.create_time) >= DATE_SUB(CURDATE(),INTERVAL 30 day)
and t1.order_status = '6' and t1.order_status = '6'
<if test="dto.stationId != null and dto.stationId != ''"> <if test="dto.stationId != null and dto.stationId != ''">
and t1.station_id = #{dto.stationId,jdbcType=VARCHAR} and t1.station_id = #{dto.stationId,jdbcType=VARCHAR}
@@ -848,7 +857,7 @@
#{item,jdbcType=VARCHAR} #{item,jdbcType=VARCHAR}
</foreach> </foreach>
</if> </if>
group by DATE_FORMAT(t1.create_time,'%Y-%m-%d') group by DATE_FORMAT(t1.create_time, '%Y-%m-%d')
</select> </select>
<select id="getUnpaidOrderListOver15Min" resultMap="OrderBasicInfoResult"> <select id="getUnpaidOrderListOver15Min" resultMap="OrderBasicInfoResult">
@@ -881,17 +890,17 @@
</select> </select>
<update id="updateOrderStatusById"> <update id="updateOrderStatusById">
update order_basic_info set order_status = #{orderStatus,jdbcType=VARCHAR} update order_basic_info
set order_status = #{orderStatus,jdbcType=VARCHAR}
where del_flag = '0' where del_flag = '0'
and id in and id in
<foreach collection="orderIds" item="orderId" open="(" separator="," close=")" > <foreach collection="orderIds" item="orderId" open="(" separator="," close=")">
#{orderId,jdbcType=VARCHAR} #{orderId,jdbcType=VARCHAR}
</foreach> </foreach>
</update> </update>
<select id="selectOrderInfoByOrderCode" resultType="com.jsowell.pile.vo.uniapp.SendMessageVO"> <select id="selectOrderInfoByOrderCode" resultType="com.jsowell.pile.vo.uniapp.SendMessageVO">
SELECT SELECT t1.order_code as orderCode,
t1.order_code as orderCode,
t1.pile_sn as pileSn, t1.pile_sn as pileSn,
t1.connector_code as connectorCode, t1.connector_code as connectorCode,
t1.charge_start_time as chargeStartTime, t1.charge_start_time as chargeStartTime,
@@ -902,8 +911,7 @@
t3.total_order_amount as orderAmount, t3.total_order_amount as orderAmount,
t3.total_used_electricity as chargingDegree, t3.total_used_electricity as chargingDegree,
t4.open_id as openId t4.open_id as openId
FROM FROM order_basic_info t1
order_basic_info t1
JOIN pile_station_info t2 ON t1.station_id = t2.id JOIN pile_station_info t2 ON t1.station_id = t2.id
join order_detail t3 on t1.order_code = t3.order_code join order_detail t3 on t1.order_code = t3.order_code
join member_basic_info t4 on t1.member_id = t4.member_id join member_basic_info t4 on t1.member_id = t4.member_id
@@ -933,18 +941,15 @@
<select id="getAccumulativeInfo" resultType="com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO"> <select id="getAccumulativeInfo" resultType="com.jsowell.pile.vo.uniapp.PersonPileConnectorSumInfoVO">
SELECT SELECT t1.member_id as memberId,
t1.member_id as memberId,
t1.pile_connector_code as pileConnectorCode, t1.pile_connector_code as pileConnectorCode,
t1.pile_sn as pileSn, t1.pile_sn as pileSn,
t1.charge_start_time as chargeStartTime, t1.charge_start_time as chargeStartTime,
t1.charge_end_time as chargeEndTime, t1.charge_end_time as chargeEndTime,
t2.total_used_electricity as sumChargingDegree t2.total_used_electricity as sumChargingDegree
FROM FROM order_basic_info t1
order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code JOIN order_detail t2 ON t1.order_code = t2.order_code
WHERE WHERE t1.pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
t1.pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
AND t1.member_id = #{memberId,jdbcType=VARCHAR} AND t1.member_id = #{memberId,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR} AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR} AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
@@ -964,8 +969,7 @@
</select> </select>
<select id="getListByOrderCodes" resultType="com.jsowell.pile.vo.uniapp.OrderVO"> <select id="getListByOrderCodes" resultType="com.jsowell.pile.vo.uniapp.OrderVO">
SELECT SELECT t1.order_code as orderCode,
t1.order_code as orderCode,
t1.order_status as orderStatus, t1.order_status as orderStatus,
t1.reason, t1.reason,
t1.station_id, t1.station_id,
@@ -991,21 +995,17 @@
</select> </select>
<select id="getAccumulativeInfoForLianLian" resultType="com.jsowell.pile.vo.lianlian.AccumulativeInfoVO"> <select id="getAccumulativeInfoForLianLian" resultType="com.jsowell.pile.vo.lianlian.AccumulativeInfoVO">
SELECT SELECT t1.order_code as orderCode,
t1.order_code as orderCode,
t1.pile_connector_code as pileConnectorCode, t1.pile_connector_code as pileConnectorCode,
t1.pile_sn as pileSn, t1.pile_sn as pileSn,
t1.station_id as stationId, t1.station_id as stationId,
IFNULL(t2.total_used_electricity,0.00) as connectorElectricity IFNULL(t2.total_used_electricity, 0.00) as connectorElectricity
FROM FROM order_basic_info t1
order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code JOIN order_detail t2 ON t1.order_code = t2.order_code
WHERE WHERE t1.del_flag = '0'
t1.del_flag = '0'
AND t1.station_id = #{stationID,jdbcType=VARCHAR} AND t1.station_id = #{stationID,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR} AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR} AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</select> </select>
<select id="queryElecAmountNullList" resultMap="OrderDetailResult"> <select id="queryElecAmountNullList" resultMap="OrderDetailResult">
@@ -1023,22 +1023,22 @@
<trim prefix="set" suffixOverrides=","> <trim prefix="set" suffixOverrides=",">
<trim prefix="total_electricity_amount =case" suffix="end,"> <trim prefix="total_electricity_amount =case" suffix="end,">
<foreach collection="list" item="item" index="index"> <foreach collection="list" item="item" index="index">
<if test="item.totalElectricityAmount!=null"> <if test="item.totalElectricityAmount != null">
when id=#{item.id} then #{item.totalElectricityAmount} when id = #{item.id} then #{item.totalElectricityAmount}
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="total_service_amount =case" suffix="end,"> <trim prefix="total_service_amount =case" suffix="end,">
<foreach collection="list" item="item" index="index"> <foreach collection="list" item="item" index="index">
<if test="item.totalServiceAmount!=null"> <if test="item.totalServiceAmount != null">
when id=#{item.id} then #{item.totalServiceAmount} when id = #{item.id} then #{item.totalServiceAmount}
</if> </if>
</foreach> </foreach>
</trim> </trim>
</trim> </trim>
where where
<foreach collection="list" separator="or" item="i" index="index" > <foreach collection="list" separator="or" item="i" index="index">
id=#{i.id} id = #{i.id}
</foreach> </foreach>
</update> </update>
@@ -1063,8 +1063,7 @@
</select> </select>
<select id="getMerchantOrderInfoList" resultType="com.jsowell.pile.vo.base.MerchantOrderInfoVO"> <select id="getMerchantOrderInfoList" resultType="com.jsowell.pile.vo.base.MerchantOrderInfoVO">
select select t1.order_code as orderCode,
t1.order_code as orderCode,
t1.transaction_code as transactionCode, t1.transaction_code as transactionCode,
t1.order_status as orderStatus, t1.order_status as orderStatus,
t1.station_id as stationId, t1.station_id as stationId,
@@ -1073,29 +1072,26 @@
t1.settlement_time as orderSettleTime t1.settlement_time as orderSettleTime
from order_basic_info t1 from order_basic_info t1
left join pile_station_info t2 on t1.station_id = t2.id left join pile_station_info t2 on t1.station_id = t2.id
where where t1.del_flag = '0'
t1.del_flag = '0'
and t1.merchant_id = #{dto.merchantId,jdbcType=VARCHAR} and t1.merchant_id = #{dto.merchantId,jdbcType=VARCHAR}
<if test="dto.startTime != null" > <if test="dto.startTime != null">
and t1.create_time <![CDATA[ >= ]]> #{dto.startTime,jdbcType=VARCHAR} and t1.create_time <![CDATA[ >= ]]> #{dto.startTime,jdbcType=VARCHAR}
</if> </if>
<if test="dto.endTime != null" > <if test="dto.endTime != null">
and t1.settlement_time <![CDATA[ <= ]]> #{dto.endTime,jdbcType=VARCHAR} and t1.settlement_time <![CDATA[ <= ]]> #{dto.endTime,jdbcType=VARCHAR}
</if> </if>
order by t1.create_time desc order by t1.create_time desc
</select> </select>
<select id="batchRefundQuery" resultType="com.jsowell.pile.vo.web.RefundOrder"> <select id="batchRefundQuery" resultType="com.jsowell.pile.vo.web.RefundOrder">
SELECT SELECT t1.order_code as orderCode,
t1.order_code as orderCode,
t1.`order_status` as orderStatus, t1.`order_status` as orderStatus,
t1.station_id as stationId, t1.station_id as stationId,
t2.station_name AS stationName, t2.station_name AS stationName,
t1.pay_amount AS payAmount, t1.pay_amount AS payAmount,
t1.order_amount AS orderAmount, t1.order_amount AS orderAmount,
t1.refund_amount AS refundAmount t1.refund_amount AS refundAmount
FROM FROM order_basic_info t1
order_basic_info t1
JOIN pile_station_info t2 ON t1.station_id = t2.id JOIN pile_station_info t2 ON t1.station_id = t2.id
WHERE WHERE
t1.order_code IN t1.order_code IN
@@ -1114,4 +1110,38 @@
#{item,jdbcType=VARCHAR} #{item,jdbcType=VARCHAR}
</foreach> </foreach>
</select> </select>
<select id="getIndexOrderInfoV2" resultType="com.jsowell.pile.vo.web.IndexOrderInfoVO">
SELECT trade_date AS date,
order_codes as orderCodes,
use_electricity AS totalElectricity,
total_amount as totalOrderAmount
from settle_order_report
where date(trade_date) >= DATE_SUB(CURDATE(), INTERVAL 30 day)
<if test="dto.stationId != null and dto.stationId != ''">
and station_id = #{dto.stationId,jdbcType=VARCHAR}
</if>
<if test="dto.stationIdList != null and dto.stationIdList.size() != 0">
and station_id in
<foreach collection="dto.stationIdList" item="item" open="(" separator="," close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
group by trade_date
</select>
<select id="getIndexOrderDetail" resultType="com.jsowell.pile.vo.web.IndexOrderInfoVO">
select
sum(sharp_used_electricity) AS totalSharpUsedElectricity,
sum(peak_used_electricity) AS totalPeakUsedElectricity,
sum(flat_used_electricity) AS totalFlatUsedElectricity,
sum(valley_used_electricity) AS totalValleyUsedElectricity
from order_detail
<if test="list != null and list.size() != 0">
where order_code in
<foreach collection="list" item="orderCode" open="(" separator="," close=")">
#{orderCode,jdbcType=VARCHAR}
</foreach>
</if>
</select>
</mapper> </mapper>