Commit f1bf388fab36b29a78fe638a4875e4ea331377ea

Authored by xp.Huang
2 parents 6d1dad5f dc048b8a

Merge branch '20230914' into 'master_dev'

20230914

See merge request yunteng/thingskit!234
... ... @@ -41,9 +41,13 @@
41 41 SELECT d.name AS device_name,d.alias AS device_alias,d.id device_id,m.*,d.organization_id,org.name organization_name
42 42 FROM alarm m
43 43 LEFT JOIN tk_device d ON m.originator_id = d.tb_device_id::uuid
  44 + LEFT JOIN device bd ON bd.id = d.tb_device_id::uuid
44 45 LEFT JOIN tk_organization org ON org.id = d.organization_id
45 46 <where>
46 47 m.tenant_id = #{tenantId}
  48 + <if test="customerId!=null">
  49 + AND bd.customer_id = #{customerId}
  50 + </if>
47 51 <if test="severity!=null">
48 52 AND severity = #{severity}
49 53 </if>
... ... @@ -51,10 +55,10 @@
51 55 AND type LIKE CONCAT('%',#{alarmType},'%')
52 56 </if>
53 57 <if test="startTime!=null">
54   - AND created_time >= #{startTime}
  58 + AND m.created_time >= #{startTime}
55 59 </if>
56 60 <if test="endTime!=null">
57   - AND created_time &lt;= #{endTime}
  61 + AND m.created_time &lt;= #{endTime}
58 62 </if>
59 63 <if test="status!=null">
60 64 AND status IN
... ...