随笔分类 - mybayis/mybatis-plus
摘要:抽取可重用的sql片段 抽取:<sql id="xx"></sql> 使用:<include refid="xx"></inculde> <select id="getEmpsByDid" resultType="com.atguigu.mybatis.beans.Employee"> <inclu
阅读全文
摘要:1. 单个参数(基本类/包装类+String) 这种情况MyBatis可直接使用这个参数,不需要经过任何处理。 一个参数情况下#{}中内容随便写 public Employee getEmployeeById(Integer id ); <select id="selectEmployee" res
阅读全文
摘要:引入依赖 <!-- velocity 模板引擎, Mybatis Plus 代码生成器需要 --> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity-engine-core</artifactId> </
阅读全文
摘要:查询的几种情况 // 1)查询单行数据返回单个对象 public Employee getEmployeeById(Integer id ); // 2) 查询多行数据返回对象的集合 public List<Employee> getAllEmps(); // 3) 查询单行数据返回Map集合 pu
阅读全文