|
@@ -0,0 +1,68 @@
|
|
|
+<?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.xy.mapper.DeviceSimMapper">
|
|
|
+
|
|
|
+ <resultMap id="queryPageMap" type="com.xy.dto.DeviceSimDto$PageVo">
|
|
|
+ <association property="deviceInfo" javaType="com.xy.dto.DeviceInfoDto$Vo">
|
|
|
+ <id column="device_id" property="deviceId"/>
|
|
|
+ <result column="device_name" property="deviceName"/>
|
|
|
+ <result column="lon" property="lon"/>
|
|
|
+ <result column="lat" property="lat"/>
|
|
|
+ <result column="device_type" property="deviceType"/>
|
|
|
+ <result column="merc_device_code" property="mercDeviceCode"/>
|
|
|
+ <result column="merc_id" property="mercId"/>
|
|
|
+ <result column="merc_code" property="mercCode"/>
|
|
|
+ <result column="place_id" property="placeId"/>
|
|
|
+ <result column="place_line_id" property="placeLineId"/>
|
|
|
+ <result column="district_id" property="districtId"/>
|
|
|
+ <result column="active_state" property="activeState"/>
|
|
|
+ <result column="active_time" property="activeTime"/>
|
|
|
+ <result column="busy_state" property="busyState"/>
|
|
|
+ <result column="show_status" property="showStatus"/>
|
|
|
+ <result column="freeze_status" property="freezeStatus"/>
|
|
|
+ <result column="device_img" property="deviceImg"/>
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
+ <result column="merc_name" property="mercName"/>
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
+ <association property="deviceStatus" javaType="com.xy.dto.DeviceStatusDto$Vo">
|
|
|
+ <result column="net_state" property="netState"/>
|
|
|
+ </association>
|
|
|
+ </association>
|
|
|
+ <association property="sim" javaType="com.xy.dto.DeviceSimDto$Vo">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="type" property="type" />
|
|
|
+ <result column="activate_time" property="activateTime" />
|
|
|
+ <result column="timeout" property="timeout" />
|
|
|
+ <result column="last_renewal_time" property="lastRenewalTime" />
|
|
|
+ </association>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="page" resultMap="queryPageMap">
|
|
|
+ select di.*,
|
|
|
+ ds.net_state,
|
|
|
+ dsim.id, dsim.type, dsim.activate_time, dsim.timeout, dsim.last_renewal_time
|
|
|
+ from device_info di
|
|
|
+ join device_status ds on (di.device_id = ds.device_id)
|
|
|
+ join device_sysinfo dsys on(di.device_id = dsys.device_id)
|
|
|
+ join device_sim dsim on(dsim.id = dsys.sim_iccid)
|
|
|
+ where
|
|
|
+ 1 = 1
|
|
|
+ <if test="queryPage.mercId != null">
|
|
|
+ and di.merc_id = #{queryPage.mercId}
|
|
|
+ </if>
|
|
|
+ <if test="queryPage.deviceId != null">
|
|
|
+ and di.device_id = #{queryPage.deviceId}
|
|
|
+ </if>
|
|
|
+ <if test="queryPage.chargingStatus != null and queryPage.chargingStatus != ''">
|
|
|
+ <!-- 即将过期 -->
|
|
|
+ <if test="queryPage.chargingStatus == 1">
|
|
|
+ and dsim.timeout >= #{queryPage.thisTime} and dc.timeout <= #{queryPage.theTime}
|
|
|
+ </if>
|
|
|
+ <!-- 已过期 -->
|
|
|
+ <if test="queryPage.chargingStatus == 2">
|
|
|
+ and dsim.timeout <= #{queryPage.thisTime}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ order by dsim.timeout asc
|
|
|
+ </select>
|
|
|
+</mapper>
|