SSM fuzzy queries with dynamic SQL statements

SSM written inside dynamic fuzzy query, when there is no condition then check all, according to the conditions of inquiry.

<select id="findAll" parameterType="string">
		select * from employee 
		<where>
			<if test="name != null">
				name like concat('%', #{name}, '%')
			</if>
		</where>
</select>

The above code is one of the most simple dynamic SQL queries.

Published 15 original articles · won praise 11 · views 2797

Guess you like

Origin blog.csdn.net/YCarlos/article/details/99484713