1
這是我的接口方法:MyBatis的一個結果包含大寫和小寫
HashMap<String,Object> getUserById(int id);
,這是我的XML方法:
<select id="getUserById" parameterType="int" resultType="hashmap" >
select * from users where user_id = #{user_id}
</select>
然後我用了JUnit測試它,這是我的Junit的情況下:
@Test
public void testGetUsers()
{
HashMap<String,Object> maps = new HashMap<String, Object>();
int id = 5;
maps = mapper.getUserById(id);
System.out.println(maps);
Assert.assertNotNull(maps);
}
然後我得到的結果是這樣的:
{DEPARTMENT_ID=1, phone=3423456, NAME=張飛, USER_ID=5, department_id=1, password=1111, PHONE=3423456, username=zhangfei, [email protected], MOBILE=12345678963, name=張飛, user_id=5, USERNAME=zhangfei, [email protected], PASSWORD=1111, mobile=12345678963}
正如你所看到的,結果包含大寫和小寫,但我不想大寫,怎麼辦?