mybatis注解
基本的增删改
@Insert("insert into t_user values(null,#{username},#{password},#{account})") @Delete(“delete from t_user where pk_id = #{id}”) @Update(“update t_user set f_username=#{param1} where pk_id=#{param2}”)
简单查询
@Select(“select * from t_user where pk_id=#{id}”) @Select(“select *from t_user”)
结果集
@Results( value={ @Result(id=true,column=“pk_id”,property=“id”), @Result(property=“name”,column=“f_name”) } ) 在XML中定义结果集resultMap @ResultMap(“结果集名字”)