insert into xhpc_device_message(
type,
serial_number,
content,
charge_order_no,
status,
create_by,
remark,
update_by,
create_time,
update_time
)values(
#{type},
#{serialNumber},
#{content},
#{chargeOrderNo},
#{status},
#{createBy},
#{remark},
#{updateBy},
sysdate(),
sysdate()
)
delete from xhpc_message
where create_time #{expireDate};
select
xcp.charging_pile_id as id,
xcp.charging_station_id as chargingStationId,
xcp.name name,
xcp.national_standard as nationalStandard,
xcp.power power,
xcp.auxiliary_power_supply auxiliaryPowerSupply,
xcp.input_voltage inputVoltage,
xcp.max_voltage maxVoltage,
xcp.min_voltage minVoltage,
xcp.max_electric_current maxElectricCurrent,
xcp.min_electric_current minElectricCurrent,
xcp.serial_number serialNumber,
xcp.type type,
xcp.program_version programVersion,
xcp.network_link_type networkLinkType,
xcp.gun_number gunNumber,
xcp.communication_protocol_version communicationProtocolVersion,
xcp.communication_operator communicationOperator,
xcp.sim_card simCard,
xcp.status status,
xcp.del_flag delFlag,
xcp.rate_model_id rateModelId,
xcp.brand_model brandModel,
date_format(xcp.production_date,'%Y-%m-%d') productionDate,
xcp.manufacture_name manufactureName,
xcp.connector_type connectorType,
xcp.equipment_type equipmentType,
xcp.current as current,
xcp.search_value searchValue,
xcp.equipment_product_code equipmentProductCode,
xcp.transformer_id transformerID,
xcp.new_national_standard newNationalStandard,
xcp.vin_flag vinFlag,
xcp.equipment_status equipmentStatus,
xcp.equipment_purpose equipmentPurpose,
xcp.manufacturer_id manufacturerId,
xcp.equipment_classificatlon equipmentClassificatlon,
xcp.aux_power auxPower,
date_format(xcs.construction_time,'%Y-%m-%d') as constructionTime
from xhpc_charging_pile xcp
left join xhpc_charging_station xcs on xcs.charging_station_id = xcp.charging_station_id
where xcp.serial_number =#{pileNo} and xcp.del_flag =0 limit 1
select CAST(ct.charging_station_id AS CHAR(10)) as stationId,
ct.chengdu_name as stationName,
ct.operator_id_evcs as operatorId,
ct.internet_equipment_owner_id as equipmentOwnerId,
ct.is_alone_apply as isAloneApply,
ct.account_number as accountNumber,
ct.capacity as capacity,
ct.country_code as countryCcode,
CAST(ct.area_code AS CHAR(10)) as areaCode,
ct.area_code_countryside as areaCodeCountryside,
ct.address as address,
ct.service_tel as serviceTel,
ct.station_type as stationType,
ct.is_open as isOpen,
ct.station_status as stationStatus,
ct.park_nums as parkNums,
ROUND(ct.longitude,6) as stationLng,
ROUND(ct.latitude,6) as stationLat,
ct.construction_site as construction,
ct.swap_match_cars_name as swapMatchCarsName,
ct.open_all_day as openAllDay,
ct.busine_hours as busineHours,
ct.electricity_fee as electricityFee,
ct.service_fee as serviceFee,
ct.park_free as parkFree,
ct.park_fee as parkFee,
ct.payment as payment,
ct.park_fee_type as parkFeeType,
ct.toilet_flag as toiletFlag,
ct.store_flag as storeFlag,
ct.lounge_flag as loungeFlag,
ct.canopy_flag as canopyFlag,
ct.printer_flag as printerFlag,
ct.barrier_flag as barrierFlag,
ct.parking_lock_flag as parkingLockFlag,
ct.is_demand_response as isDemandResponse,
ct.is_support_orderly_charging as isSupportOrderlyCharging,
ct.is_energy_storage as isEnergyStorage,
ct.station_classification as stationClassification,
ct.general_application_type as generalApplicationType,
ct.round_the_clock as roundTheClock,
ct.park_type as parkType,
ct.electncity_type as electncityType,
ct.business_expand_type as businessExpandType,
ct.rated_power as ratedPower,
ct.period_fee as periodFee,
ct.official_run_time as officialRunTime,
ct.video_monitor as videoMonitor
from xhpc_charging_station as ct
where ct.charging_station_id = #{chargingStationId}
and ct.del_flag = 0
select
round(ifnull(sum(xho.total_power),0),1)as connectorElectricity
from xhpc_history_order xho
where xho.charging_station_id =#{stationId}
and date_format(xho.end_time,'%Y-%m-%d') >=#{startTime} and date_format(xho.end_time,'%Y-%m-%d') <=#{endTime}
and xho.terminal_id =#{terminalId}
select
round(ifnull(sum(total_power),0),1)as connectorElectricity
from xhpc_history_order
where terminal_id in(select terminal_id from xhpc_terminal where charging_pile_id =#{chargingPileId} and charging_station_id =#{stationId} and del_flag=0)
and charging_station_id =#{stationId} and date_format(end_time,'%Y-%m-%d') >=#{startTime} and date_format(end_time,'%Y-%m-%d') <=#{endTime}
select
xco.charging_station_id as stationID,
round(sum(xco.charging_degree),1) as stationElectricity,
xcs.station_classification as stationClassification,
count(xco.charge_order_id) as stationTotalChargeNum,
round(sum(xco.charging_time_number/60),2) as stationTotalChargeTime,
sum(xco.station_total_warning_num) as stationTotalWarningNum,
xo.operator_id_evcs as operatorID,
xcs.equipment_owner_id as equipmentOnwerID
from xhpc_charge_order xco
left join xhpc_charging_station xcs on xcs.charging_station_id = xco.charging_station_id
left join xhpc_operator xo on xo.operator_id = xcs.operator_id
where xco.charging_station_id =#{stationId}
and date_format(xco.end_time,'%Y-%m-%d') >=#{startTime} and date_format(xco.end_time,'%Y-%m-%d') <=#{endTime}
GROUP BY xco.charging_station_id
select
xcp.serial_number as equipmentID,
xcp.equipment_classificatlon as equipmentClassification,
round(sum(xco.charging_degree),2) as equipmentElectncity,
round(sum(xco.charging_time_number/60),0) as equipmentTotalChargeTime,
count(xco.charge_order_id) as equipmentTotalChargeNum,
sum(xco.station_total_warning_num) as equipmentTotalWarningNum
from xhpc_charge_order xco
left join xhpc_charging_station xcs on xcs.charging_station_id = xco.charging_station_id
left join xhpc_operator xo on xo.operator_id = xcs.operator_id
left join xhpc_terminal xt on xco.terminal_id = xt.terminal_id
left join xhpc_charging_pile xcp on xt.charging_pile_id = xcp.charging_pile_id
where xco.charging_station_id =#{stationId} and xco.terminal_id in (select terminal_id from xhpc_terminal where charging_pile_id =#{chargingPileId})
and xco.end_time >=#{startTime} and xco.end_time <=#{endTime}
select
xt.serial_number as connectorID,
xcp.equipment_classificatlon as equipmentClassification,
round(sum(xco.charging_degree),2) as connectorElectricity,
round(sum(xco.charging_time_number/60),0) as connectorTotalChargeTime,
count(xco.charge_order_id) as connectorTotalChargeNum,
sum(xco.station_total_warning_num) as connectorTotalWarningNum
from xhpc_charge_order xco
left join xhpc_charging_station xcs on xcs.charging_station_id = xco.charging_station_id
left join xhpc_terminal xt on xco.terminal_id = xt.terminal_id
left join xhpc_charging_pile xcp on xt.charging_pile_id = xcp.charging_pile_id
where xco.charging_station_id =#{stationId}
and xco.terminal_id in (select terminal_id from xhpc_terminal where charging_pile_id =#{chargingPileId})
and xco.end_time >=#{startTime} and xco.end_time <=#{endTime}
GROUP BY xco.terminal_id
select charging_station_id chargingStationId
from xhpc_charging_station where charging_station_id not in (select charging_station_id from xhpc_station_internet_blacklist where internet_user_id =(
select internet_user_id from xhpc_internet_user where operator_id_evcs =#{operatorIdEvcs} LIMIT 1) )
select charging_pile_id chargingPileId
from xhpc_charging_pile where charging_station_id =#{stationId} and del_flag =0
SELECT
xt.terminal_id as connectorID
from xhpc_terminal xt
where xt.charging_pile_id =#{chargingPileId} and xt.charging_station_id=#{stationId} and xt.del_flag=0
SELECT
DATE_FORMAT(xrt.start_time,'%H:%i') startTime,
replace(DATE_FORMAT(xrt.end_time,'%H:%i'),'00:00','23:59') endTime,
xr.power_fee electricityFee,
xr.service_fee serviceFee,
xcs.equipment_type equipmentType
from xhpc_rate_time xrt
LEFT JOIN xhpc_rate xr on xrt.rate_id = xr.rate_id
LEFT JOIN xhpc_charging_station xcs on xcs.charging_station_id = xrt.charging_station_id
where xrt.charging_station_id=#{stationId} and xrt.del_flag =0
select
xcs.operator_id_evcs as operatorlD,
xcs.equipment_owner_id as equipmentOnwerID,
xcs.charging_station_id as stationID,
xcs.station_classification as stationClassification,
ADDTIME(NOW(),10) dataTime,
ROUND(sum(xcsp.voltage*xcsp.current),1)as stationRealTimePower
from xhpc_charging_station_power as xcsp
left join xhpc_charging_station as xcs on xcs.charging_station_id = xcsp.charging_station_id
where xcsp.del_flag = 0
and DATE_FORMAT(xcsp.create_time,'%Y-%m-%d') >=#{subTime}
and DATE_FORMAT(xcsp.create_time,'%Y-%m-%d') <= #{subTime}
and xcsp.status =#{number} and xcsp.charging_station_id in
#{stationId}
GROUP BY xcsp.charging_station_id,DATE_FORMAT(xcsp.create_time,'%Y-%m-%d')
ORDER BY DATE_FORMAT(xcsp.create_time,'%Y-%m-%d'),xcsp.charging_station_id
select
xcp.charging_pile_id as pileID,
xcp.serial_number as equipmentID,
xcp.equipment_classificatlon as equipmentClassification,
ADDTIME(NOW(),10) dataTime,
ROUND(sum(xcsp.voltage*xcsp.current), 1)as equipRealTimePower
from xhpc_charging_station_power as xcsp
left join xhpc_charging_station as xcs on xcs.charging_station_id = xcsp.charging_station_id
left join xhpc_charging_pile as xcp on xcp.charging_pile_id = xcsp.charging_pile_id
where xcsp.del_flag = 0
and DATE_FORMAT(xcsp.create_time,'%Y-%m-%d') >=#{subTime}
and DATE_FORMAT(xcsp.create_time,'%Y-%m-%d') <= #{subTime}
and xcsp.status =#{number}
and xcsp.charging_station_id =#{chargingStationId}
GROUP BY xcsp.charging_pile_id,DATE_FORMAT(xcsp.create_time,'%Y-%m-%d')
ORDER BY DATE_FORMAT(xcsp.create_time,'%Y-%m-%d'),xcsp.charging_pile_id
select
xt.serial_number as connectorID,
xcp.equipment_classificatlon as equipmentClassification,
ADDTIME(NOW(),10) dataTime,
ROUND(sum(xcsp.voltage*xcsp.current), 1)as connectorRealTimePower
from xhpc_charging_station_power as xcsp
left join xhpc_charging_station as xcs on xcs.charging_station_id = xcsp.charging_station_id
left join xhpc_charging_pile as xcp on xcp.charging_pile_id = xcsp.charging_pile_id
left join xhpc_terminal as xt on xt.terminal_id = xcsp.terminal_id
where xcsp.del_flag = 0
and DATE_FORMAT(xcsp.create_time,'%Y-%m-%d') >=#{subTime}
and DATE_FORMAT(xcsp.create_time,'%Y-%m-%d') <= #{subTime}
and xcsp.status =#{number}
and xcsp.charging_pile_id =#{chargingPileId}
GROUP BY xcsp.terminal_id,DATE_FORMAT(xcsp.create_time,'%Y-%m-%d')
ORDER BY DATE_FORMAT(xcsp.create_time,'%Y-%m-%d'),xcsp.terminal_id
select
area_code as areaCode,
address as address,
accident_entitya as accidentEntity,
type as type,
accident_reason as accidentReason,
level as level,
accident_time as accidentTime,
description as description,
pictures as picturesName,
analysisReport as analysisReportName
from xhpc_equipment_accident where del_flag =0
order by create_time desc
select
xco.charging_station_id as stationID,
concat(DATE_FORMAT(xco.end_time,'%Y-%m-%d')," 00:00:00") as startTime,
concat(DATE_FORMAT(xco.end_time,'%Y-%m-%d')," 23:59:59") as endTime,
round(sum(xco.charging_degree),1) as stationElectricity,
xcs.station_classification as stationClassification,
xo.operator_id_evcs as operatorID,
xcs.equipment_owner_id as equipmentOnwerID,
round(sum(xco.charging_time_number/60),2) as stationTotalChargeTime,
count(xco.charge_order_id) as stationTotalChargeNum,
sum(xco.station_total_warning_num) as stationTotalWarningNum
from xhpc_charge_order xco
left join xhpc_charging_station xcs on xcs.charging_station_id = xco.charging_station_id
left join xhpc_operator xo on xo.operator_id = xcs.operator_id
where xco.end_time >=#{startTime} and xco.end_time <=#{endTime}
GROUP BY xco.charging_station_id
update xhpc_charging_pile set power_number=#{powerNumber} where serial_number =#{serialNumber}