@ -7,15 +7,16 @@
<result column= "device_no" jdbcType= "VARCHAR" property= "deviceNo" />
<result column= "device_no" jdbcType= "VARCHAR" property= "deviceNo" />
<result column= "device_name" jdbcType= "VARCHAR" property= "deviceName" />
<result column= "device_name" jdbcType= "VARCHAR" property= "deviceName" />
<result column= "device_status" jdbcType= "INTEGER" property= "deviceStatus" />
<result column= "device_status" jdbcType= "INTEGER" property= "deviceStatus" />
<result column= "device_id" jdbcType= "INTEGER" property= "deviceId" />
<result column= "device_ip" jdbcType= "VARCHAR" property= "deviceIp" />
<result column= "device_ip" jdbcType= "VARCHAR" property= "deviceIp" />
<result column= "success_rate" jdbcType= "VARCHAR" property= "successRate" />
<result column= "success_rate" jdbcType= "VARCHAR" property= "successRate" />
<result column= "lost_rate" jdbcType= "VARCHAR" property= "lostRate" />
<result column= "lost_rate" jdbcType= "VARCHAR" property= "lostRate" />
<result column= "direction" jdbcType= "VARCHAR" property= "direction" />
<result column= "direction" jdbcType= "VARCHAR" property= "direction" />
<result column= "production " jdbcType= "VARCHAR" property= "production" />
<result column= "product_name " jdbcType= "VARCHAR" property= "production" />
<result column= "model" jdbcType= "VARCHAR" property= "model" />
<result column= "model" jdbcType= "VARCHAR" property= "model" />
<result column= "network " jdbcType= "VARCHAR" property= "network" />
<result column= "facilities_type " jdbcType= "VARCHAR" property= "network" />
<result column= "content " jdbcType= "VARCHAR" property= "content" />
<result column= "remark " jdbcType= "VARCHAR" property= "content" />
<result column= "type" jdbcType= "VARCHAR" property= "type" />
<result column= "type" jdbcType= "VARCHAR" property= "type" />
</resultMap>
</resultMap>
@ -33,6 +34,9 @@
<if test= "status.deviceStatus != null" >
<if test= "status.deviceStatus != null" >
device_status,
device_status,
</if>
</if>
<if test= "status.deviceId != null" >
device_id,
</if>
<if test= "status.time != null" >
<if test= "status.time != null" >
time,
time,
</if>
</if>
@ -57,6 +61,9 @@
<if test= "status.deviceStatus != null" >
<if test= "status.deviceStatus != null" >
#{status.deviceStatus,jdbcType=INTEGER},
#{status.deviceStatus,jdbcType=INTEGER},
</if>
</if>
<if test= "status.deviceId != null" >
#{status.deviceId,jdbcType=BIGINT},
</if>
<if test= "status.time != null" >
<if test= "status.time != null" >
#{status.time,jdbcType=DATE},
#{status.time,jdbcType=DATE},
</if>
</if>
@ -68,7 +75,7 @@
</if>
</if>
<if test= "status.deviceIp != null" >
<if test= "status.deviceIp != null" >
#{status.deviceIp,jdbcType=VARCHAR},
#{status.deviceIp,jdbcType=VARCHAR}
</if>
</if>
</trim>
</trim>
</insert>
</insert>
@ -78,9 +85,10 @@
</sql>
</sql>
<select id= "listStatus" parameterType= "com.zc.business.domain.Status" resultMap= "BaseResultMap" >
<select id= "listStatus" parameterType= "com.zc.business.domain.Status" resultMap= "BaseResultMap" >
select s.id, s.device_no, s.device_name, s.device_status,s.time, d.device_ip,s.success_rate,s.lost_rate,d.direction,d.production,d.model,d.network,d.content,d.type
select s.id, s.device_no, s.device_name, s.device_status,s.time, d.device_ip,s.success_rate,s.lost_rate,d.direction,e.product_name,e.model,d.facilities_type,d.remark,COALESCE(d.child_type, d.device_type) AS type
from status s
from dc_device d
LEFT JOIN device d on s.device_ip = d.device_ip
LEFT JOIN status s on (s.device_id=d.id)
LEFT JOIN dc_product e on e.id=d.product_id
<where >
<where >
<if test= "status.time != null" >
<if test= "status.time != null" >
AND s.time BETWEEN #{status.startTime,jdbcType=DATE} AND #{status.time,jdbcType=DATE}
AND s.time BETWEEN #{status.startTime,jdbcType=DATE} AND #{status.time,jdbcType=DATE}
@ -89,7 +97,7 @@
AND s.device_no = #{status.deviceNo}
AND s.device_no = #{status.deviceNo}
</if>
</if>
<if test= "status.type != null" >
<if test= "status.type != null" >
AND d.type = #{status.type}
AND ( d.device_ type = #{status.type} or d.child_type=#{status.type})
</if>
</if>
</where>
</where>
</select>
</select>