|
@@ -1,63 +0,0 @@
|
|
|
-<?xml version="1.0" encoding="UTF-8"?>
|
|
|
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
-<mapper namespace="org.king.modules.ad.mapper.AdChargingRecordMapper">
|
|
|
-
|
|
|
- <select id="listMonth" resultType="org.king.modules.ad.entity.ComChargingMonth">
|
|
|
- select t2.COM_NAME, shipNum, consumption, chargeLength
|
|
|
- from (
|
|
|
- select com_no,
|
|
|
- count(1) as shipNum,
|
|
|
- sum(consumption) as consumption,
|
|
|
- ifnull(sum(timestampdiff(minute, real_start_time, real_end_time)), 0) as chargeLength
|
|
|
- from ad_charging_record
|
|
|
- where date_format(create_time, '%Y-%m') = #{month}
|
|
|
- <if test="comNos != null and comNos.size()>0">
|
|
|
- and com_no in
|
|
|
- <foreach item="key" collection="comNos" open="(" separator="," close=")">
|
|
|
- #{key}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- group by com_no) t1
|
|
|
- left join web_company t2 on t1.com_no = t2.COM_NO
|
|
|
- <where>
|
|
|
- <if test="comNo != null and comNo != ''">
|
|
|
- COM_NAME like concat ('%',#{comNo},'%')
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="listDevice" resultType="org.king.modules.ad.entity.ComChargingDevice">
|
|
|
- select t2.service_name,
|
|
|
- t3.area_name,
|
|
|
- t4.COM_NAME,
|
|
|
- t2.type,
|
|
|
- t2.status,
|
|
|
- t2.voltage,
|
|
|
- ifnull(consumption, 0) as consumption,
|
|
|
- ifnull(shipNum, 0) as shipNum
|
|
|
- from (
|
|
|
- select ad_device_id,
|
|
|
- count(1) as shipNum,
|
|
|
- sum(consumption) as consumption
|
|
|
- from ad_charging_record
|
|
|
- group by ad_device_id) t1
|
|
|
- right join ad_device t2 on t1.ad_device_id = t2.id
|
|
|
- left join hhad.ent_company_geom t3 on t2.berth_id = t3.ecg_no
|
|
|
- left join web_company t4 on t3.com_no = t4.COM_NO
|
|
|
- <where>
|
|
|
- <if test="comNos != null and comNos.size()>0">
|
|
|
- t4.com_no in
|
|
|
- <foreach item="key" collection="comNos" open="(" separator="," close=")">
|
|
|
- #{key}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="type != null and type != ''">
|
|
|
- and t2.type = #{type}
|
|
|
- </if>
|
|
|
- <if test="status != null and status != ''">
|
|
|
- and t2.status = #{status}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
-
|
|
|
- </select>
|
|
|
-</mapper>
|