<!--
    方法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>

 

相关文章:

  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2022-03-03
  • 2021-09-18
猜你喜欢
  • 2021-05-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案