<!-- oracle --> <select id="searchUserBySearchName" parameterType="java.lang.String" resultType="com.urm.entity.User"> select * from t_user where user_name like CONCAT('%',#{search_name},'%') </select> <!-- 或者 --> <select id="searchUserBySearchName" parameterType="java.lang.String" resultType="com.urm.entity.User"> select * from t_user where user_name like '%'||#{search_name}||'%' </select> <!-- mysql --> <select id="searchUserBySearchName" parameterType="java.lang.String" resultType="com.urm.entity.User"> select * from t_user where user_name like CONCAT('%',#{search_name},'%') </select> <!-- sql server --> <select id="searchUserBySearchName" parameterType="java.lang.String" resultType="com.urm.entity.User"> select * from t_user where user_name like '%'+#{search_name}+'%' </select> <!-- db2 --> <select id="searchUserBySearchName" parameterType="java.lang.String" resultType="com.urm.entity.User"> select * from t_user where user_name like CONCAT('%',#{search_name},'%') </select> <!-- 或者 --> <select id="searchUserBySearchName" parameterType="java.lang.String" resultType="com.urm.entity.User"> select * from t_user where user_name like '%'||#{search_name}||'%' </select>
版权声明:本文博客原创文章,博客,未经同意,不得转载。
时间: 2024-11-06 09:38:18