myBatis中传参类型
1、员工实体类,省略set,get方法private Integer empno;private String ename;private String job;private Integer mgr;private Date hiredate;private Double sal ;private Double comm;private Integer deptno;部门实体类private Dept dept;

3、根据姓名查找,传入String类型参数<select id="findByName" parameterType="string" resultType="Emp">select * from t_emp where ename=#{ename}</select>

4、//根据工号查找public Emp findByNo(Integer empno);<select id="findByNo" parameterType="int" resultType="Emp">select * from t_emp where empno=#{empno}</select>

5、//插入public void insert(Emp emp);<insert id="insert" parameterType="Emp">insert into t_emp(empno,ename,job,hiredate,mgr,sal,comm,deptno) values(emono_id.nextval,#{ename,jdbcType=VARCHAR} ,#{job,jdbcType=VARCHAR},#{hiredate},#{mgr},#{sal},#{comm,jdbcType=DOUBLE},#{deptno})</insert>

6、<select id="findRows" parameterType="string&鳎溻趄酃quot; resultType="java.lang.Integer">select count(*) from t_emp where 1=1<if test="ename!=null&&ename.trim()!=''">and ename=#{ename}</if><if test="deptno!=null">and deptno=#{deptno}</if></select>
