说明:在mybatis中默认是不区分大小写的,
@Select({"select role_id as roleId,role_name as roleName,role_duty as roleDuty,role_status as roleStatus,sort_num as sortNum,created as created,updated as updated from role a where role_name like concat('%',#{roleName},'%')"})
List<Role> findLike(@Param(value = "roleName") String roleName);
说明:区分大小写的sql模糊查询
注意: 如果传入的是小写则会将大写和小写组合的都查询出来,但是纯大写的(即只有大写没有小写)字符串则不查询,如果传入的是大写字母则查询大写和小写组合的字符,但是不会查询纯小写的字符串
@Select({"select role_id as roleId,role_name as roleName,role_duty as roleDuty,role_status as roleStatus,sort_num as sortNum,created as created,updated as updated from role a where role_name like concat BINARY ('%',#{roleName},'%')"})
List<Role> findLike(@Param(value = "roleName") String roleName);