64 lines
2.6 KiB
XML
64 lines
2.6 KiB
XML
<?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',
|
|
reply_content as 'replyContent',
|
|
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}
|
|
</select>
|
|
|
|
|
|
<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',
|
|
m.reply_content as 'replyContent',
|
|
m.status as 'status',
|
|
m.remark as 'remark',
|
|
m.create_time as 'createTime',
|
|
m.create_by as 'createBy',
|
|
m.update_time as 'updateTime',
|
|
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>
|
|
</select>
|
|
|
|
</mapper>
|