fix(hjm):修复车辆查询逻辑并优化返回结果- 修复 HjmCarMapper 中 getByGpsNo 和 getByCode 查询方法缺少 LIMIT 1限制的问题

- 在 CmsArticleController 中补充文章查询成功时的返回结果处理
-优化数据库查询逻辑,避免返回多余数据影响性能
This commit is contained in:
2025-10-29 15:48:22 +08:00
parent be2bda8e53
commit 8132aa3ab1
2 changed files with 3 additions and 1 deletions

View File

@@ -87,6 +87,7 @@ public class CmsArticleController extends BaseController {
if (ObjectUtil.isNotEmpty(item)) {
article.setContent(item.getContent());
}
return success(article);
}
return fail("文章ID不存在",null);
}

View File

@@ -116,7 +116,7 @@
<select id="getByGpsNo" resultType="com.gxwebsoft.hjm.entity.HjmCar">
SELECT a.*
FROM hjm_car a
WHERE a.gps_no = #{gpsNo} AND a.deleted = 0
WHERE a.gps_no = #{gpsNo} AND a.deleted = 0 LIMIT 1
</select>
<select id="getByCode" resultType="com.gxwebsoft.hjm.entity.HjmCar">
@@ -134,6 +134,7 @@
</if>
AND a.deleted = 0
</where>
LIMIT 1
</select>
<update id="updateByGpsNo" parameterType="com.gxwebsoft.hjm.entity.HjmCar">