fix: fix sql tpl

This commit is contained in:
h7ml 2022-05-10 17:03:26 +08:00
parent 8573afc448
commit d82a80e524

View File

@ -266,9 +266,9 @@ device_sql(Select, From, Where, _Method) ->
#{<<"productid">> := ProductId, <<"devaddr">> := Devaddr} ->
case Devaddr of
<<"#">> ->
<<"$dg/user/", ProductId/binary, "/", Devaddr/binary>>;
<<"$dg/alarm/", ProductId/binary, "/", Devaddr/binary>>;
_ ->
<<"$dg/user/", ProductId/binary, "/", Devaddr/binary, "/#">>
<<"$dg/alarm/", ProductId/binary, "/", Devaddr/binary, "/#">>
end;
_ ->
<<"thing/", "test/#">>
@ -464,7 +464,7 @@ generateFrom(Trigger) ->
<<"$dg/alarm/", ProductId/binary, "/", Devaddr/binary, "/#">>
end;
_ ->
<<"$dg/user/", "test/#">>
<<"$dg/alarm/", "test/#">>
end;
<<"trigger/product/event">> ->
case Params of
@ -478,7 +478,7 @@ generateFrom(Trigger) ->
<<"$dg/alarm/", ProductId/binary, "/", Devaddr/binary, "/#">>
end;
_ ->
<<"$dg/user/", "test/#">>
<<"$dg/alarm/", "test/#">>
end;
<<"trigger/mqtt/event">> ->
case Params of
@ -490,7 +490,7 @@ generateFrom(Trigger) ->
<<"$events/", Mqtt/binary, "/", ProductId/binary, "/", Devaddr/binary, "/#">>
end;
_ ->
<<"$dg/user/", "test/#">>
<<"$dg/alarm/", "test/#">>
end;
<<"trigger/timer">> ->
<<"$dg/alarm/", "test/#">>;