fix: 修复生成sql错误

This commit is contained in:
h7ml 2022-05-10 14:56:31 +08:00
parent eaf881f048
commit 4f815d4e66

View File

@ -501,25 +501,25 @@ generateSelect(Condition, _Trigger, _FROM) ->
PropertyName = maps:get(<<"propertyName">>, Params, <<"test">>),
case Acc of
<<"">> ->
PropertyName;
<<"payload.", PropertyName/binary, " as ", PropertyName/binary>>;
_ ->
<<Acc/binary, ",\r\n ", PropertyName/binary>>
<<Acc/binary, ",\r\n ", "payload.", PropertyName/binary, " as ", PropertyName/binary>>
end;
#{<<"uri">> := <<"condition/device/stateContinue">>, <<"params">> := Params} ->
PropertyName = maps:get(<<"propertyName">>, Params, <<"test">>),
case Acc of
<<"">> ->
PropertyName;
<<"payload.", PropertyName/binary, " as ", PropertyName/binary>>;
_ ->
<<Acc/binary, ",\r\n ", PropertyName/binary>>
<<Acc/binary, ",\r\n ", "payload.", PropertyName/binary, " as ", PropertyName/binary>>
end;
#{<<"uri">> := <<"condition/device/time">>, <<"params">> := Params} ->
PropertyName = maps:get(<<"propertyName">>, Params, <<"test">>),
case Acc of
<<"">> ->
PropertyName;
<<"payload.", PropertyName/binary, " as ", PropertyName/binary>>;
_ ->
<<Acc/binary, ",\r\n ", PropertyName/binary>>
<<Acc/binary, ",\r\n ", "payload.", PropertyName/binary, " as ", PropertyName/binary>>
end;
_ ->
Acc