33 lines
2.2 KiB
XML
33 lines
2.2 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.charging.station.mapper.XhpcTerminalMapper">
|
||
|
|
|
||
|
|
<resultMap id="BaseResultMap" type="com.xhpc.charging.station.domain.XhpcTerminal">
|
||
|
|
<result property="terminalId" column="terminal_id" />
|
||
|
|
<result property="chargingPileId" column="charging_pile_id" />
|
||
|
|
<result property="chargingStationId" column="charging_station_id" />
|
||
|
|
<result property="name" column="name" />
|
||
|
|
<result property="serialNumber" column="serial_number" />
|
||
|
|
<result property="pileSerialNumber" column="pile_serial_number" />
|
||
|
|
<result property="gunStatus" column="gun_status" />
|
||
|
|
<result property="workStatus" column="work_status" />
|
||
|
|
<result property="status" column="status" />
|
||
|
|
<result property="delFlag" column="del_flag" />
|
||
|
|
<result property="createTime" column="create_time" />
|
||
|
|
<result property="createBy" column="create_by" />
|
||
|
|
<result property="updateTime" column="update_time" />
|
||
|
|
<result property="updateBy" column="update_by" />
|
||
|
|
<result property="remark" column="remark" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<select id="countXhpcTerminalWorkStatus" resultType="map">
|
||
|
|
select
|
||
|
|
(select count(terminal_id) from xhpc_terminal where status=0 and del_flag=0 and work_status=0 and charging_station_id=#{chargingStationId}) offLine,
|
||
|
|
(select count(terminal_id) from xhpc_terminal where status=0 and del_flag=0 and work_status=1 and charging_station_id=#{chargingStationId}) fault,
|
||
|
|
(select count(terminal_id) from xhpc_terminal where status=0 and del_flag=0 and work_status=2 and charging_station_id=#{chargingStationId}) freeTime,
|
||
|
|
(select count(terminal_id) from xhpc_terminal where status=0 and del_flag=0 and work_status=3 and charging_station_id=#{chargingStationId}) charge
|
||
|
|
from xhpc_terminal LIMIT 1
|
||
|
|
</select>
|
||
|
|
</mapper>
|