Commit 8b3ba539 by 林永健

fix(violation): 添加违规导出请求中的二级品牌ID字段

- 在 ReceptionViolationExportRequest 中新增 carBrandId 字段用于标识二级品牌
- 修改 RecordingBatchModelCallWghsMapper.xml 中的关联查询条件
- 扩展业务类型匹配范围从单一值 11 到包含 11 和 1107 的列表
- 确保数据查询能够覆盖新的业务场景需求
1 parent 43df9751
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
select select
t2.*,t1.result_json t2.*,t1.result_json
from recording_batch_model_call_wghs t2 from recording_batch_model_call_wghs t2
left join recording_batch_model_call t1 on (t1.recording_batch_id = t2.batch_id and t1.business_type=11) left join recording_batch_model_call t1 on (t1.recording_batch_id = t2.batch_id and t1.business_type in (11,1107))
where t2.batch_id = #{batchId} where t2.batch_id = #{batchId}
</select> </select>
......
  • @wangxw1
    commented
    Master

    一、关键问题与优化建议(仅限 Top 1)

    • 问题 1:Commit 信息与实际代码变更内容不匹配
      • 问题描述:提交信息(Commit Message)中提到“在 ReceptionViolationExportRequest 中新增 carBrandId 字段”,但在本次提交的代码变更中,仅看到了 MyBatis XML 的 SQL 修改,完全没有 Java 实体类或 Request 对象的变更。
      • 影响分析:导致代码库的提交历史与实际代码变动不一致,增加后续代码回溯、审计和排查问题的难度。如果 Java 代码漏提,将直接导致编译或运行时错误;如果是分批提交,则破坏了提交的原子性。
      • 优化建议:确保单次 Commit 包含该功能点的所有相关变更(原子性)。如果 Java 类已在其他 Commit 中提交,应修正本次 Commit 信息,仅描述 SQL 逻辑的变更。

    二、评分明细

    • 功能实现的正确性与健壮性(38/40分):SQL 逻辑修改正确,扩展了 business_type 的匹配范围,未发现子查询。扣除 2 分是因为无法从当前 diff 确认 1107 类型的引入是否会导致 t2 关联出多条 t1 记录(导致 t2 数据翻倍),需结合业务场景确认是否存在 1:N 风险。
    • 安全性与潜在风险(30/30分):使用 #{batchId} 预编译处理,无 SQL 注入风险。
    • 最佳实践与可维护性(20/20分):SQL 结构清晰,IN 查询符合规范。
    • 性能与资源利用(5/5分):关联查询条件直接,命中索引概率高(前提是 recording_batch_id 和 business_type 有索引),无明显性能瓶颈。
    • 提交信息质量(2/5分):提交信息描述的内容与实际 diff 内容严重不符(缺少 Java 文件变更),误导性较强。

    总分:95分

Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!