Mybatis返回主键

 @Insert("insert into t_coffee (name, price, create_time, update_time)"
            + "values (#{name}, #{price}, now(), now())")
    @Options(useGeneratedKeys = true, keyProperty="id", keyColumn="id")
    int save(Coffee coffee);

你可能感兴趣的:(Java,开发,mybatis,java,数据库)