<select id="getlike" parameterType="ConditionUser" resultType="User"> select * from d_user where <if test="name != null"> <!-- 如下格式 --> name like ‘%‘ #{name} ‘%‘ and </if> age between #{minAge} and #{maxAge} </select>
时间: 2024-10-12 17:01:11
<select id="getlike" parameterType="ConditionUser" resultType="User"> select * from d_user where <if test="name != null"> <!-- 如下格式 --> name like ‘%‘ #{name} ‘%‘ and </if> age between #{minAge} and #{maxAge} </select>