Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

Commit 261c943

Browse files
committed
Remove suffixOverrides in set element
1 parent 393d5d6 commit 261c943

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mybatis_mapper2sql/convert.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def convert_trim_where_set(mybatis_mapper, child):
146146
convert_string = re.sub(regex, '', convert_string, count=1, flags=re.I)
147147
# Remove suffixOverrides
148148
if suffix_overrides:
149-
regex = suffix_overrides + '$'
150-
convert_string = re.sub(regex, '', convert_string, count=1, flags=re.I)
149+
regex = suffix_overrides + '(\s+--.+)?$'
150+
convert_string = re.sub(regex, r'\1', convert_string, count=1, flags=re.I)
151151
# Add Prefix if String is not empty
152152
if re.search('\S', convert_string):
153153
convert_string = prefix + ' ' + convert_string

0 commit comments

Comments
 (0)