|
@@ -189,13 +189,31 @@
|
|
|
join device_sysinfo ds on(di.device_id = ds.device_id)
|
|
|
join device_sim dsim on(ds.sim_iccid = dsim.id)
|
|
|
where
|
|
|
- di.merc_id = #{query.mercId} and dsim.timeout >= #{query.begin1} and dsim.timeout <= #{query.end1}) as beTimeoutCout,
|
|
|
+ dsim.timeout >= #{query.begin1} and dsim.timeout <= #{query.end1}
|
|
|
+ <if test="query.mercId != null">
|
|
|
+ and di.merc_id = #{query.mercId}
|
|
|
+ </if>
|
|
|
+ ) as beTimeoutCout,
|
|
|
(select count(*)
|
|
|
from device_info di
|
|
|
join device_sysinfo ds on(di.device_id = ds.device_id)
|
|
|
join device_sim dsim on(ds.sim_iccid = dsim.id)
|
|
|
where
|
|
|
- di.merc_id = #{query.mercId} and dsim.timeout <= #{query.end2}) as timeoutCout
|
|
|
+ dsim.timeout <= #{query.end2}
|
|
|
+ <if test="query.mercId != null">
|
|
|
+ and di.merc_id = #{query.mercId}
|
|
|
+ </if>
|
|
|
+ ) as timeoutCout,
|
|
|
+ (select count(*)
|
|
|
+ from device_info di
|
|
|
+ join device_sysinfo ds on(di.device_id = ds.device_id)
|
|
|
+ join device_sim dsim on(ds.sim_iccid = dsim.id)
|
|
|
+ <where>
|
|
|
+ <if test="query.mercId != null">
|
|
|
+ and di.merc_id = #{query.mercId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ) as totalNum
|
|
|
from dual
|
|
|
</select>
|
|
|
</mapper>
|