fix(hjm):修复车辆查询逻辑并优化返回结果- 修复 HjmCarMapper 中 getByGpsNo 和 getByCode 查询方法缺少 LIMIT 1限制的问题
- 在 CmsArticleController 中补充文章查询成功时的返回结果处理 -优化数据库查询逻辑,避免返回多余数据影响性能
This commit is contained in:
@@ -87,6 +87,7 @@ public class CmsArticleController extends BaseController {
|
|||||||
if (ObjectUtil.isNotEmpty(item)) {
|
if (ObjectUtil.isNotEmpty(item)) {
|
||||||
article.setContent(item.getContent());
|
article.setContent(item.getContent());
|
||||||
}
|
}
|
||||||
|
return success(article);
|
||||||
}
|
}
|
||||||
return fail("文章ID不存在",null);
|
return fail("文章ID不存在",null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@
|
|||||||
<select id="getByGpsNo" resultType="com.gxwebsoft.hjm.entity.HjmCar">
|
<select id="getByGpsNo" resultType="com.gxwebsoft.hjm.entity.HjmCar">
|
||||||
SELECT a.*
|
SELECT a.*
|
||||||
FROM hjm_car 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>
|
||||||
|
|
||||||
<select id="getByCode" resultType="com.gxwebsoft.hjm.entity.HjmCar">
|
<select id="getByCode" resultType="com.gxwebsoft.hjm.entity.HjmCar">
|
||||||
@@ -134,6 +134,7 @@
|
|||||||
</if>
|
</if>
|
||||||
AND a.deleted = 0
|
AND a.deleted = 0
|
||||||
</where>
|
</where>
|
||||||
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<update id="updateByGpsNo" parameterType="com.gxwebsoft.hjm.entity.HjmCar">
|
<update id="updateByGpsNo" parameterType="com.gxwebsoft.hjm.entity.HjmCar">
|
||||||
|
|||||||
Reference in New Issue
Block a user