标签:
<!-- 方法1,构建查询对象; QueryCondition qc = new QueryCondition(); qc.setGender(1); qc.setBirthday(new Date()); --> <select id="selectPersonByParams" parameterType="com.stone.model.QueryCondition" resultMap="BaseResultMap"> <![CDATA[ select * from person t where t.gender=#{gender} and t.birthday <#{birthday} ]]> </select> <!-- 方法2,使用map; map.put("gender",1); map.put("birthday",new Date()); --> <select id="selectPersonByParams" parameterType="java.util.Map" resultMap="BaseResultMap"> <![CDATA[ select * from person t where t.gender=#{gender} and t.birthday <#{birthday} ]]> </select>
标签:
原文地址:http://www.cnblogs.com/stono/p/4508343.html