<?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.sandu.ximon.dao.mapper.LightPoleHeelingMapper">
|
|
<resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightPoleHeeling">
|
<id property="warningNumber" column="warning_number" jdbcType="BIGINT"/>
|
<result property="mac" column="mac" jdbcType="VARCHAR"/>
|
<result property="warningLevel" column="warning_level" jdbcType="VARCHAR"/>
|
<result property="theXAxis" column="the_x_axis" jdbcType="DOUBLE"/>
|
<result property="theYAxis" column="the_y_axis" jdbcType="DOUBLE"/>
|
<result property="theZAxis" column="the_z_axis" jdbcType="DOUBLE"/>
|
<result property="processingState" column="processing_state" jdbcType="INTEGER"/>
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
id,mac,warning_number,
|
warning_level,the_x_axis,the_y_axis,
|
the_z_axis,processing_state,create_time
|
</sql>
|
<select id="listLightPoleHeeling" resultType="com.sandu.ximon.dao.domain.LightPoleHeeling">
|
SELECT *
|
FROM light_pole_heeling
|
WHERE warning_number IN (
|
SELECT MAX(warning_number)
|
FROM light_pole_heeling
|
<where>
|
<if test="keyword != null and keyword != ''">
|
AND warning_number LIKE CONCAT(CONCAT('%', #{keyword}), '%')
|
</if>
|
<if test="processingState != null and keyword != 2">
|
AND processing_state = #{processingState}
|
</if>
|
</where>
|
GROUP BY mac
|
ORDER BY warning_number DESC)
|
</select>
|
</mapper>
|