java110 пре 3 година
родитељ
комит
62e08ecce2

+ 1 - 1
java110-db/src/main/resources/mapper/common/ChargeMachineOrderAcctV1ServiceDaoImplMapper.xml

@@ -19,7 +19,7 @@
     <select id="getChargeMachineOrderAcctInfo" parameterType="Map" resultType="Map">
         select t.amount,t.cmoa_id,t.cmoa_id cmoaId,t.order_id,t.order_id orderId,t.acct_detail_id,t.acct_detail_id
         acctDetailId,t.acct_id,t.acct_id acctId,t.start_time,t.start_time startTime,t.remark,t.status_cd,t.status_cd
-        statusCd,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.energy
+        statusCd,t.end_time,t.end_time endTime,t.community_id,t.community_id communityId,t.energy,t.create_time createTime
         from charge_machine_order_acct t
         where 1 =1
         <if test="amount !=null and amount != ''">

+ 7 - 2
java110-db/src/main/resources/mapper/common/ChargeMachineOrderV1ServiceDaoImplMapper.xml

@@ -17,17 +17,18 @@
 
     <!-- 查询充电桩订单信息 add by wuxw 2018-07-03 -->
     <select id="getChargeMachineOrderInfo" parameterType="Map" resultType="Map">
-        select t.amount,t.order_id,t.order_id orderId,t.remark,t.status_cd,t.status_cd statusCd,t.port_id,t.port_id
+        select t.order_id,t.order_id orderId,t.remark,t.port_id,t.port_id
         portId,t.person_name,t.person_name personName,t.machine_id,t.machine_id
         machineId,t.acct_detail_id,t.acct_detail_id acctDetailId,t.person_id,t.person_id
         personId,t.charge_hours,t.charge_hours chargeHours,t.start_time,t.start_time startTime,t.end_time,t.end_time
         endTime,t.state,t.person_tel,t.person_tel personTel,t.community_id,t.community_id communityId,t.energy,
         cm.machine_name machineName,cm.machine_code machineCode,cm.duration_price durationPrice,
-        cmp.port_code portCode,cmp.port_name portName,td.`name` stateName
+        cmp.port_code portCode,cmp.port_name portName,td.`name` stateName,SUM(cmoa.amount) amount
         from charge_machine_order t
         left join charge_machine cm on t.machine_id = cm.machine_id and cm.status_cd = '0'
         left join charge_machine_port cmp on t.port_id = cmp.port_id and cmp.status_cd = '0'
         left join t_dict td on td.status_cd = t.state and td.table_name = 'charge_machine_order' and td.table_columns = 'state'
+        left join charge_machine_order_acct cmoa on t.order_id = cmoa.order_id and cmoa.status_cd = '0'
         where 1 =1
         <if test="amount !=null and amount != ''">
             and t.amount= #{amount}
@@ -77,6 +78,10 @@
         <if test="energy !=null and energy != ''">
             and t.energy= #{energy}
         </if>
+        GROUP BY t.order_id,t.remark,t.port_id,t.person_name,t.machine_id,t.acct_detail_id,t.person_id,
+        t.charge_hours,t.start_time,t.end_time,t.state,t.person_tel,t.community_id,t.energy,
+        cm.machine_name ,cm.machine_code ,cm.duration_price ,
+        cmp.port_code ,cmp.port_name ,td.`name`
         order by t.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}