Commit 0d9cf0ac by tyfanchz

修改设备列表过滤条件

1 parent b55e66cc
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
<select id="getDeviceCount" resultType="java.lang.Integer"> <select id="getDeviceCount" resultType="java.lang.Integer">
select count(1) select count(1)
from t_platform_device from t_platform_device
where status != 9
</select> </select>
<select id="getDeviceGraphData" resultType="java.util.Map"> <select id="getDeviceGraphData" resultType="java.util.Map">
...@@ -83,6 +84,7 @@ ...@@ -83,6 +84,7 @@
from t_platform_device a from t_platform_device a
left join t_platform_customer b on a.customer_id = b.id left join t_platform_customer b on a.customer_id = b.id
<where> <where>
and a.status != 9
<if test="customerName != null and customerName != ''"> <if test="customerName != null and customerName != ''">
and b.customer_name = #{customerName,jdbcType=VARCHAR} and b.customer_name = #{customerName,jdbcType=VARCHAR}
</if> </if>
...@@ -95,6 +97,7 @@ ...@@ -95,6 +97,7 @@
from t_platform_device from t_platform_device
where activat_time >= #{statisticStartTime,jdbcType=TIMESTAMP} where activat_time >= #{statisticStartTime,jdbcType=TIMESTAMP}
and activat_time &lt; #{statisticEndTime,jdbcType=TIMESTAMP} and activat_time &lt; #{statisticEndTime,jdbcType=TIMESTAMP}
and status != 9
group by activatTime group by activatTime
order by activatTime order by activatTime
</select> </select>
...@@ -105,7 +108,8 @@ ...@@ -105,7 +108,8 @@
from t_platform_device pd from t_platform_device pd
left join t_platform_customer pc on pc.id = pd.customer_id left join t_platform_customer pc on pc.id = pd.customer_id
<where> <where>
pd.activat_time >= #{startTime,jdbcType=TIMESTAMP} and pd.status != 9
and pd.activat_time >= #{startTime,jdbcType=TIMESTAMP}
and pd.activat_time &lt; #{endTime,jdbcType=TIMESTAMP} and pd.activat_time &lt; #{endTime,jdbcType=TIMESTAMP}
<if test="customerName != null and customerName != ''"> <if test="customerName != null and customerName != ''">
and pc.customer_name = #{customerName,jdbcType=VARCHAR} and pc.customer_name = #{customerName,jdbcType=VARCHAR}
...@@ -119,6 +123,7 @@ ...@@ -119,6 +123,7 @@
select count(1) select count(1)
from t_platform_device from t_platform_device
where customer_id = #{customerId,jdbcType=INTEGER} where customer_id = #{customerId,jdbcType=INTEGER}
and status != 9
<if test="deviceTypeStr != null and deviceTypeStr != ''"> <if test="deviceTypeStr != null and deviceTypeStr != ''">
and device_type = #{deviceTypeStr,jdbcType=VARCHAR} and device_type = #{deviceTypeStr,jdbcType=VARCHAR}
</if> </if>
...@@ -127,7 +132,7 @@ ...@@ -127,7 +132,7 @@
<select id="getacticveDeviceCountByCustomerId" resultType="java.lang.Integer"> <select id="getacticveDeviceCountByCustomerId" resultType="java.lang.Integer">
select count(1) select count(1)
from t_platform_device from t_platform_device
where status = 1 where status = 1 and status != 9
and customer_id = #{customerId,jdbcType=INTEGER} and customer_id = #{customerId,jdbcType=INTEGER}
<if test="deviceTypeStr != null and deviceTypeStr != ''"> <if test="deviceTypeStr != null and deviceTypeStr != ''">
and device_type = #{deviceTypeStr,jdbcType=VARCHAR} and device_type = #{deviceTypeStr,jdbcType=VARCHAR}
...@@ -135,20 +140,24 @@ ...@@ -135,20 +140,24 @@
</select> </select>
<select id="getDeviceByTimeRangeAndCustID" resultType="cn.com.glsx.openplatform.vo.OpenDeviceVo"> <select id="getDeviceByTimeRangeAndCustID" resultType="cn.com.glsx.openplatform.vo.OpenDeviceVo">
select tpd.device_sn as sn,tpu.nickname as username,tpu.contact_number as mobile from t_platform_device tpd inner join t_platform_user tpu select tpd.device_sn as sn,tpu.nickname as username,tpu.contact_number as mobile
on tpd.user_id = tpu.id from t_platform_device tpd
inner join t_platform_user tpu on tpd.user_id = tpu.id
where tpd.activat_time >= #{startTime,jdbcType=TIMESTAMP} where tpd.activat_time >= #{startTime,jdbcType=TIMESTAMP}
and tpd.activat_time &lt; #{endTime,jdbcType=TIMESTAMP} and tpd.activat_time &lt; #{endTime,jdbcType=TIMESTAMP}
and tpd.customer_id = #{customerID,jdbcType=INTEGER} and tpd.customer_id = #{customerID,jdbcType=INTEGER}
and tpd.status != 9
order by tpd.activat_time desc order by tpd.activat_time desc
</select> </select>
<select id="getCountDeviceByTimeRangeAndCustID" resultType="java.lang.Integer"> <select id="getCountDeviceByTimeRangeAndCustID" resultType="java.lang.Integer">
select count(1) from t_platform_device tpd inner join t_platform_user tpu select count(1)
on tpd.user_id = tpu.id from t_platform_device tpd
inner join t_platform_user tpu on tpd.user_id = tpu.id
where tpd.activat_time >= #{startTime,jdbcType=TIMESTAMP} where tpd.activat_time >= #{startTime,jdbcType=TIMESTAMP}
and tpd.activat_time &lt; #{endTime,jdbcType=TIMESTAMP} and tpd.activat_time &lt; #{endTime,jdbcType=TIMESTAMP}
and tpd.customer_id = #{customerID,jdbcType=INTEGER} and tpd.customer_id = #{customerID,jdbcType=INTEGER}
and tpd.status != 9
order by tpd.activat_time desc order by tpd.activat_time desc
</select> </select>
</mapper> </mapper>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!