评论新增了标题111111

This commit is contained in:
wucongxing8150 2025-06-09 15:24:54 +08:00
parent 468b99c27e
commit 8c8b779ab3

View File

@ -14,7 +14,7 @@
LEFT JOIN user c ON c.user_id = a.user_id
WHERE a.exchange_status = 1
<if test="isSelected != null and isSelected != ''">
AND c.is_selected = ${isSelected}
AND a.is_selected = ${isSelected}
</if>
<if test="keyword != null and keyword != ''">
AND (
@ -36,4 +36,41 @@
</foreach>
</if>
</select>
<select id="getCaseExchangeSearchList" resultType="com.example.caseData.dto.caseExchange.CaseExchangeDto">
SELECT
a.*,
c.user_name,
c.avatar,
c.hospital_id
FROM (
SELECT DISTINCT a.exchange_id
FROM case_exchange a
LEFT JOIN case_exchange_label b ON a.exchange_id = b.exchange_id
LEFT JOIN user c ON c.user_id = a.user_id
WHERE a.exchange_status = 1
<if test="isSelected != null and isSelected != ''">
AND c.is_selected = #{isSelected}
</if>
<if test="keyword != null and keyword != ''">
AND (
a.exchange_title LIKE CONCAT('%', #{keyword}, '%')
OR c.user_name LIKE CONCAT('%', #{keyword}, '%')
OR b.label_name LIKE CONCAT('%', #{keyword}, '%')
)
</if>
<!-- <if test="userId != null and userId != ''">-->
<!-- AND c.user_id = ${userId}-->
<!-- </if>-->
) AS result
JOIN case_exchange a ON result.exchange_id = a.exchange_id
LEFT JOIN user c ON c.user_id = a.user_id
<if test="order != null and !order.isEmpty()">
ORDER BY
<foreach item="entry" index="key" collection="order" separator=",">
${key} ${entry}
</foreach>
</if>
LIMIT #{limit}
</select>
</mapper>