1. 参数中直接加入%% param.setUsername("%CD%"); param.setPassword("%11%"); <select id="selectPersons" resultType="person" parameterType="person"> select id,sex,age,username,password from person where true &…
1. 参数中直接加入%% param.setUsername("%CD%"); param.setPassword("%11%"); <select id="selectPersons" resultType="person" parameterType="person"> select id,sex,age,username,password from person where t…
正文: 在Java中使用Mybatis自动生成的方法,like需要自己写通配符 public List<TableA> query(String name) { Example example = new Example(TableA.class); example.createCriteria() .andLike("name", "%"+ name +"%"); example.setOrderByClause("CRE…