fix:修复查询为null的问题

This commit is contained in:
2025-07-23 19:33:55 +08:00
parent e34a2ccae7
commit 9dd7b4e146

View File

@@ -33,11 +33,11 @@
</select>
<select id="queryMomentComment" resultMap="commentResultMap">
SELECT a.id AS id,
b.username AS username,
b.avatar AS avatar,
a.content AS content,
a.create_time AS date
SELECT a.id AS id,
b.username AS username,
COALESCE(b.avatar, '') AS avatar,
a.content AS content,
a.create_time AS date
FROM comment_record AS a
LEFT JOIN user AS b ON a.create_by = b.id
WHERE subject_id = #{id}
@@ -45,12 +45,12 @@
</select>
<select id="queryMomentList" resultMap="momentResultMap">
SELECT a.id AS id,
b.id AS userId,
b.username AS username,
b.avatar AS avatar,
a.content AS content,
a.create_time AS date
SELECT a.id AS id,
b.id AS userId,
b.username AS username,
COALESCE(b.avatar, '') AS avatar,
a.content AS content,
a.create_time AS date
FROM moment AS a
LEFT JOIN user AS b ON a.create_by = b.id
ORDER BY a.create_time DESC
@@ -60,7 +60,7 @@
SELECT a.id AS id,
b.id AS userId,
b.username AS username,
b.avatar AS avatar,
COALESCE(b.avatar, '') AS avatar,
a.content AS content,
a.create_time AS date
FROM moment AS a