|
@@ -4,6 +4,9 @@
|
|
<resultMap id="queryPageMap" type="com.xy.mapper.entity.DeviceInfoQueryPage">
|
|
<resultMap id="queryPageMap" type="com.xy.mapper.entity.DeviceInfoQueryPage">
|
|
<id column="device_id" property="deviceId"/>
|
|
<id column="device_id" property="deviceId"/>
|
|
<result column="device_name" property="deviceName"/>
|
|
<result column="device_name" property="deviceName"/>
|
|
|
|
+ <result column="m" property="m"/>
|
|
|
|
+ <result column="lon" property="lon"/>
|
|
|
|
+ <result column="lat" property="lat"/>
|
|
<result column="device_type" property="deviceType"/>
|
|
<result column="device_type" property="deviceType"/>
|
|
<result column="merc_device_code" property="mercDeviceCode"/>
|
|
<result column="merc_device_code" property="mercDeviceCode"/>
|
|
<result column="merc_id" property="mercId"/>
|
|
<result column="merc_id" property="mercId"/>
|
|
@@ -111,14 +114,14 @@
|
|
POW(
|
|
POW(
|
|
SIN(
|
|
SIN(
|
|
(
|
|
(
|
|
- #{queryPage.lat} * PI() / 180 - lat * PI() / 180
|
|
|
|
|
|
+ #{queryPage.lat} * PI() / 180 - info.lat * PI() / 180
|
|
) / 2
|
|
) / 2
|
|
),
|
|
),
|
|
2
|
|
2
|
|
- ) + COS(#{queryPage.lat} * PI() / 180) * COS(lat * PI() / 180) * POW(
|
|
|
|
|
|
+ ) + COS(#{queryPage.lat} * PI() / 180) * COS(info.lat * PI() / 180) * POW(
|
|
SIN(
|
|
SIN(
|
|
(
|
|
(
|
|
- #{queryPage.lon} * PI() / 180 - lon * PI() / 180
|
|
|
|
|
|
+ #{queryPage.lon} * PI() / 180 - info.lon * PI() / 180
|
|
) / 2
|
|
) / 2
|
|
),
|
|
),
|
|
2
|
|
2
|
|
@@ -153,7 +156,8 @@
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.deviceIdName != null and queryPage.deviceIdName != ''">
|
|
<if test="queryPage.deviceIdName != null and queryPage.deviceIdName != ''">
|
|
and (
|
|
and (
|
|
- LOCATE(#{queryPage.deviceIdName}, info.device_id) > 0 or LOCATE(#{queryPage.deviceIdName}, info.device_name) > 0
|
|
|
|
|
|
+ LOCATE(#{queryPage.deviceIdName}, info.device_id) > 0 or LOCATE(#{queryPage.deviceIdName}, info.device_name)
|
|
|
|
+ > 0
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.deviceId != null">
|
|
<if test="queryPage.deviceId != null">
|
|
@@ -171,7 +175,8 @@
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.no != null and queryPage.no != ''">
|
|
<if test="queryPage.no != null and queryPage.no != ''">
|
|
and (
|
|
and (
|
|
- LOCATE(#{queryPage.no}, info.merc_device_code) > 0 or LOCATE(#{queryPage.no}, sysinfo.device_sn) > 0 or LOCATE(#{queryPage.no}, sysinfo.sim_iccid) > 0
|
|
|
|
|
|
+ LOCATE(#{queryPage.no}, info.merc_device_code) > 0 or LOCATE(#{queryPage.no}, sysinfo.device_sn) > 0 or
|
|
|
|
+ LOCATE(#{queryPage.no}, sysinfo.sim_iccid) > 0
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.activeState != null">
|
|
<if test="queryPage.activeState != null">
|
|
@@ -203,7 +208,8 @@
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.merc != null and queryPage.merc != ''">
|
|
<if test="queryPage.merc != null and queryPage.merc != ''">
|
|
and (
|
|
and (
|
|
- info.merc_id = #{queryPage.merc} or info.merc_code = #{queryPage.merc} or LOCATE(#{queryPage.merc}, mr.name) > 0
|
|
|
|
|
|
+ info.merc_id = #{queryPage.merc} or info.merc_code = #{queryPage.merc} or LOCATE(#{queryPage.merc}, mr.name)
|
|
|
|
+ > 0
|
|
)
|
|
)
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.placeId != null">
|
|
<if test="queryPage.placeId != null">
|
|
@@ -222,7 +228,7 @@
|
|
and info.busy_state = #{queryPage.busyState}
|
|
and info.busy_state = #{queryPage.busyState}
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.appUpmVersion != null and queryPage.appUpmVersion != ''">
|
|
<if test="queryPage.appUpmVersion != null and queryPage.appUpmVersion != ''">
|
|
- and sysinfo.app_upm_version = #{appUpmVersion}
|
|
|
|
|
|
+ and sysinfo.app_upm_version = #{queryPage.appUpmVersion}
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.appDownmVersion != null and queryPage.appDownmVersion != ''">
|
|
<if test="queryPage.appDownmVersion != null and queryPage.appDownmVersion != ''">
|
|
and sysinfo.app_downm_version = #{queryPage.appDownmVersion}
|
|
and sysinfo.app_downm_version = #{queryPage.appDownmVersion}
|
|
@@ -234,7 +240,7 @@
|
|
and info.active_time <= #{queryPage.endActiveTime}
|
|
and info.active_time <= #{queryPage.endActiveTime}
|
|
</if>
|
|
</if>
|
|
<if test="queryPage.lon != null and queryPage.lon != ''">
|
|
<if test="queryPage.lon != null and queryPage.lon != ''">
|
|
- <if test="queryPage.nearby != null and queryPage.nearby != ''">
|
|
|
|
|
|
+ <if test="queryPage.nearby != null">
|
|
HAVING `m` <= #{queryPage.nearby}
|
|
HAVING `m` <= #{queryPage.nearby}
|
|
</if>
|
|
</if>
|
|
</if>
|
|
</if>
|
|
@@ -246,6 +252,9 @@
|
|
order by info.create_time desc
|
|
order by info.create_time desc
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
|
|
+ <if test="queryPage.limitNum != null">
|
|
|
|
+ limit #{queryPage.limitNum }
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 小程序首页设备列表线路分组 -->
|
|
<!-- 小程序首页设备列表线路分组 -->
|