第一种方法

  DAO层的函数方法

  1 Public User selectUser(String name,String area);
  对应的Mapper.xml

 <select >
   select * from user_user_t where user_name = #{0} and user_area=#{1}
 </select>

 


其中,#{0}代表接收的是dao层中的第一个参数,#{1}代表dao层中第二参数,更多参数一致往后加即可。

 

第二种方法

  DAO层的函数方法

ser selectUser(@param(“userName”)Stringname,@param(“userArea”)String area);
  对应的Mapper.xml

<select >
  select * from user_user_t where user_name = #{userName,jdbcType=VARCHAR} and user_area=#{userArea,jdbcType=VARCHAR}
</select>

目前个人觉得这两种方法比较实用,当然网上还有其他的方法

相关文章:

  • 2021-11-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-03
  • 2022-01-23
  • 2021-05-19
  • 2021-07-04
相关资源
相似解决方案