原因:
本想实现动态sql
","marks":[]}]}]},{"type":"block","id":"oTNi-1657854333785","name":"code-line","data":{},"nodes":[{"type":"text","id":"f6Ow-1657854333784","leaves":[{"text":" username like \"%\"#{username}\"%\"","marks":[]}]}]},{"type":"block","id":"ODdE-1657854333787","name":"code-line","data":{},"nodes":[{"type":"text","id":"CgaU-1657854333786","leaves":[{"text":" ","marks":[]}]}]},{"type":"block","id":"5gjx-1657854333789","name":"code-line","data":{},"nodes":[{"type":"text","id":"YIRc-1657854333788","leaves":[{"text":" ","marks":[]}]}]},{"type":"block","id":"sUpT-1657854333791","name":"code-line","data":{},"nodes":[{"type":"text","id":"wsFy-1657854333790","leaves":[{"text":" ","marks":[]}]}]}],"state":{}}]'>
<select id="selectUserList" resultType="cn.gxz.xly2022.pojo.User" parameterType="java.lang.String"> select id, username, password from user <where> <if test="username!=null and username!=''"> username like "%"#{username}"%" </if> </where> </select>
结果直接报500
解决:
发现List<User> selectUserList(@Param("username")String username);中之前没有添加@Param("username")注解