- 알림 자동등록 시 memo(가맹점) 키워드로 과거에 '확정'한 내역의 분류를
찾아(가장 많이 쓴 분류) pending 내역에 미리 채운다.
- 메모 포함관계 매칭('스타벅스' ↔ '스타벅스 강남점'), 같은 type(수입/지출)만.
- 안전상 '확인 필요' 상태는 유지(분류만 선반영) — 무검토 오확정 방지.
- AccountEntryMapper.findLearnedCategory 추가.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -160,6 +160,24 @@
|
||||
SELECT COUNT(*) FROM account_entry WHERE member_id = #{memberId} AND pending = 1
|
||||
</select>
|
||||
|
||||
<!-- 자동인식 분류 학습: 같은 메모 키워드로 과거에 확정된 분류 중 가장 많이 쓴 1건.
|
||||
메모가 서로 포함관계여도(예: '스타벅스' ↔ '스타벅스 강남점') 매칭. -->
|
||||
<select id="findLearnedCategory" resultType="string">
|
||||
SELECT category
|
||||
FROM account_entry
|
||||
WHERE member_id = #{memberId}
|
||||
AND type = #{type}
|
||||
AND pending = 0
|
||||
AND category IS NOT NULL AND category != ''
|
||||
AND memo IS NOT NULL AND memo != ''
|
||||
AND (memo = #{memo}
|
||||
OR memo LIKE CONCAT('%', #{memo}, '%')
|
||||
OR #{memo} LIKE CONCAT('%', memo, '%'))
|
||||
GROUP BY category
|
||||
ORDER BY COUNT(*) DESC, MAX(entry_date) DESC, MAX(id) DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<update id="confirm">
|
||||
UPDATE account_entry
|
||||
SET pending = 0,
|
||||
|
||||
Reference in New Issue
Block a user