Dynamic SQL in Spring Boot + MyBatis: How to Write where, set, trim, choose, bind, and foreach, and How to Fix "Leading AND Left Behind", "Trailing Comma", and "Empty IN Clause Crashes"
A walkthrough of Spring Boot + MyBatis dynamic SQL tags (where/set/trim/choose/bind/foreach), showing the XML you write side by side with the SQL actually issued. Covers a search Mapper that doesn't break even when every condition is empty, partial updates that never leave a trailing comma, and defensive patterns so foreach doesn't fail when given an empty list or null, organized as fixes by error type.