add >= <= mysql where encoding

This commit is contained in:
hippp 2015-05-27 08:16:16 +08:00
parent aa3f882edf
commit 35a29994fb
1 changed files with 6 additions and 0 deletions

View File

@ -384,9 +384,15 @@ encode_where({like, Field, Value}) ->
encode_where({'<', Field, Value}) ->
atom_to_list(Field) ++ " < " ++ encode(Value);
encode_where({'<=', Field, Value}) ->
atom_to_list(Field) ++ " <= " ++ encode(Value);
encode_where({'>', Field, Value}) ->
atom_to_list(Field) ++ " > " ++ encode(Value);
encode_where({'>=', Field, Value}) ->
atom_to_list(Field) ++ " >= " ++ encode(Value);
encode_where({'in', Field, Values}) ->
InStr = string:join([encode(Value) || Value <- Values], ","),
atom_to_list(Field) ++ " in (" ++ InStr ++ ")";