|
@@ -58,14 +58,15 @@
|
|
|
) t
|
|
|
LEFT JOIN kl_concept_common e ON t.sonId = e.concept_id
|
|
|
AND e.is_deleted = 'N'
|
|
|
- <if test="sexType != null and sexType != 3 and sexType != ''">
|
|
|
- and e.sex_type in (3, #{sexType})
|
|
|
- </if>
|
|
|
- <if test="age != null and age != ''">
|
|
|
- <![CDATA[ and ((e.min_age <= #{age} and e.max_age >= #{age})
|
|
|
- OR e.min_age IS NULL
|
|
|
- OR e.max_age IS NULL)]]>
|
|
|
- </if>
|
|
|
+ <where>
|
|
|
+ <if test="sexType != null and sexType != 3 and sexType != ''">
|
|
|
+ and (e.sex_type in (3, #{sexType}) or e.sex_type is null)
|
|
|
+ </if>
|
|
|
+ <if test="age != null and age != ''">
|
|
|
+ <![CDATA[ and ((e.min_age <= #{age} and e.max_age >= #{age})
|
|
|
+ OR (e.min_age IS NULL and e.max_age IS NULL))]]>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
ORDER BY
|
|
|
t.relation_id,
|
|
|
t.order_no
|