2021-12-31 16:31:03 +08:00
|
|
|
<?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="com.xhpc.log.mapper.XhpcDeviceMessageMapper">
|
|
|
|
|
|
|
|
|
|
<select id="selectListByTypeAndSerialNumber" resultType="map">
|
|
|
|
|
select
|
|
|
|
|
device_message_id as 'deviceMessageId',
|
|
|
|
|
type as 'type',
|
|
|
|
|
serial_number as 'serialNumber',
|
|
|
|
|
content as 'content',
|
2022-01-12 18:19:25 +08:00
|
|
|
charge_order_no as 'chargeOrderNo',
|
2021-12-31 16:31:03 +08:00
|
|
|
status as 'status',
|
|
|
|
|
remark as 'remark',
|
|
|
|
|
create_time as 'createTime',
|
|
|
|
|
create_by as 'createBy',
|
|
|
|
|
update_time as 'updateTime',
|
|
|
|
|
update_by as 'updateBy'
|
|
|
|
|
from xhpc_device_message
|
|
|
|
|
where type=#{type} and serial_number=#{serialNumber}
|
2022-01-19 13:04:40 +08:00
|
|
|
<if test="startTime !=null and startTime!=''">
|
|
|
|
|
and create_time <![CDATA[ >= ]]> #{startTime}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endTime !=null and endTime!=''">
|
|
|
|
|
and create_time <![CDATA[ <= ]]> #{endTime}
|
|
|
|
|
</if>
|
2022-01-18 18:08:27 +08:00
|
|
|
order by create_time desc
|
2021-12-31 16:31:03 +08:00
|
|
|
</select>
|
|
|
|
|
|
2022-01-04 15:36:00 +08:00
|
|
|
|
|
|
|
|
<select id="selectListByParams" resultType="java.util.Map">
|
|
|
|
|
select
|
|
|
|
|
concat(cp.name,'号桩') as 'chargingPileName',
|
|
|
|
|
st.name as 'chargingStationName',
|
|
|
|
|
cp.brand_model as 'brandModel',
|
|
|
|
|
cp.type as 'pileType',
|
|
|
|
|
cp.power as 'power',
|
|
|
|
|
cp.serial_number as 'serialNumber',
|
|
|
|
|
m.device_message_id as 'deviceMessageId',
|
|
|
|
|
m.type as 'type',
|
|
|
|
|
m.serial_number as 'serialNumber',
|
|
|
|
|
m.content as 'content',
|
2022-01-12 18:19:25 +08:00
|
|
|
m.charge_order_no as 'chargeOrderNo',
|
2022-01-04 15:36:00 +08:00
|
|
|
m.status as 'status',
|
|
|
|
|
m.remark as 'remark',
|
|
|
|
|
m.create_time as 'createTime',
|
|
|
|
|
m.create_by as 'createBy',
|
2022-01-19 13:04:40 +08:00
|
|
|
m.update_time as 'updateTime'
|
2022-01-04 15:36:00 +08:00
|
|
|
from xhpc_device_message m
|
|
|
|
|
left join xhpc_charging_pile cp on cp.serial_number=m.serial_number
|
|
|
|
|
left join xhpc_charging_station st on st.charging_station_id =cp.charging_station_id
|
|
|
|
|
where cp.del_flag =0
|
|
|
|
|
<if test="params.number ==1">
|
|
|
|
|
and cp.charging_station_id in(select charging_station_id from xhpc_charging_station where operator_id=#{params.operatorId})
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.number ==2">
|
|
|
|
|
and cp.charging_station_id in(select charging_station_id from xhpc_user_privilege where user_id=#{params.operatorId})
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.type!=null and params.type!=''">
|
|
|
|
|
and m.type=#{params.type}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.tenantId != null and params.tenantId != ''">
|
|
|
|
|
and cp.tenant_id = #{params.tenantId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.serialNumber !=null and params.serialNumber!=''">
|
|
|
|
|
and cp.serial_number=#{params.serialNumber}
|
|
|
|
|
</if>
|
2022-01-12 18:19:25 +08:00
|
|
|
<if test="params.chargeOrderNo !=null and params.chargeOrderNo!=''">
|
|
|
|
|
and m.charge_order_no=#{params.chargeOrderNo}
|
|
|
|
|
</if>
|
2022-01-19 13:04:40 +08:00
|
|
|
<if test="params.startTime !=null and params.startTime!=''">
|
|
|
|
|
and m.create_time <![CDATA[ >= ]]> #{params.startTime}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.endTime !=null and params.endTime!=''">
|
|
|
|
|
and m.create_time <![CDATA[ <= ]]> #{params.endTime}
|
|
|
|
|
</if>
|
|
|
|
|
order by m.create_time desc
|
2022-01-12 18:27:20 +08:00
|
|
|
|
2022-01-04 15:36:00 +08:00
|
|
|
</select>
|
|
|
|
|
|
2021-12-31 16:31:03 +08:00
|
|
|
</mapper>
|