2020
10-08
10-08
Mybatis之#{}与${}的区别使用详解
1.两种取值方式的差异mapper.xml映射文件<selectid="selectEmployeeByCondition2"resultMap="empResultMap"databaseId="mysql">select*fromt_empWHEREemp_id=${id}andemp_name=#{name}</select>java查询代码params为id=1,name=”小红”@TestpublicvoidtestSelect(){InputStreamresourceAsStream=ConfigTest.class.getResourceAsStream("../classes/mybatis-config.xml");SqlSessionFactorysq...
继续阅读 >