<?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.moral.api.mapper.HistorySecondCruiserMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.moral.api.entity.HistorySecondCruiser">
|
<result column="mac" property="mac"/>
|
<result column="time" property="time"/>
|
<result column="value" property="value"/>
|
<result column="organization_id" property="organizationId"/>
|
<result column="batch" property="batch"/>
|
</resultMap>
|
|
<select id="getDates" resultType="java.lang.String">
|
SELECT DISTINCT DATE_FORMAT(`time`,'%Y-%m-%d') `time`
|
FROM history_second_cruiser
|
WHERE mac = #{mac}
|
AND organization_id = #{orgId}
|
AND `time` <![CDATA[>=]]> #{start}
|
ORDER BY `time`
|
</select>
|
|
<select id="getCruiserData" resultType="java.util.Map">
|
SELECT
|
DATE_FORMAT(`time`, #{dateFormat}) AS `time`,
|
`value`
|
FROM `history_second_cruiser`
|
WHERE mac = #{mac}
|
AND `time` LIKE #{time}"%"
|
AND organization_id = #{orgId}
|
</select>
|
|
</mapper>
|