Skip to content

Commit

Permalink
fix search
Browse files Browse the repository at this point in the history
  • Loading branch information
s39f4lt committed Jan 6, 2021
1 parent ecb759e commit de57059
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,9 @@
SELECT *
FROM "user"
WHERE id != #{userId} AND id NOT IN (SELECT "to" FROM black_list WHERE "from" = #{userId})
<if test="form.man">AND gender ilike 'man'</if>
<if test="form.woman">AND gender ilike 'woman'</if>
<if test="form.man and !form.woman">AND gender ilike 'man'</if>
<if test="form.woman and !form.man">AND gender ilike 'woman'</if>
<if test="form.man and form.woman">AND gender ILIKE 'man' OR gender ILIKE 'woman'</if>
<if test="!form.man and !form.woman">AND gender ILIKE 'man' OR gender ILIKE 'woman'</if>
<if test="form.rateFrom != null">AND rate &gt;= #{form.rateFrom}</if>
<if test="form.rateTo != null">AND rate &lt;= #{form.rateTo}</if>) as users
Expand Down

0 comments on commit de57059

Please sign in to comment.