<?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.ycl.platform.mapper.PlatformOnlineMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ycl.platform.domain.vo.PlatformOnlineVO">
|
<result column="platform_name" property="platformName" />
|
<result column="platform_ip" property="platformIp" />
|
<result column="create_date" property="createDate" />
|
<result column="today_outline_sed" property="todayOutlineSed" />
|
<result column="update_time" property="updateTime" />
|
<result column="create_time" property="createTime" />
|
<result column="area" property="area" />
|
</resultMap>
|
|
<select id="getById" resultMap="BaseResultMap">
|
SELECT
|
TP.platform_name,
|
TP.platform_ip,
|
TP.area,
|
TPO.create_date,
|
TPO.today_outline_sed,
|
TPO.update_time,
|
TPO.create_time,
|
TPO.id
|
FROM
|
t_platform_online TPO
|
INNER JOIN t_platform TP ON TP.id = TPO.platform_id
|
WHERE
|
TPO.id = #{id} AND TPO.deleted = 0
|
</select>
|
|
|
<select id="getPage" resultMap="BaseResultMap">
|
SELECT
|
TP.platform_name,
|
TP.platform_ip,
|
TP.area,
|
TPO.create_date,
|
TPO.today_outline_sed,
|
TPO.update_time,
|
TPO.create_time,
|
TPO.id
|
FROM
|
t_platform_online TPO
|
INNER JOIN t_platform TP ON TP.id = TPO.platform_id
|
WHERE
|
TPO.deleted = 0
|
<if test="query.startTime != null and query.endTime != null">
|
AND TPO.create_date between #{query.startTime} and #{query.endTime}
|
</if>
|
</select>
|
|
|
<select id="yesterdayData" resultMap="BaseResultMap">
|
select po.*,p.area from t_platform_online po inner join t_platform p on po.platform_id = p.id
|
where po.create_date between #{startDate} and #{endDate}
|
</select>
|
</mapper>
|