后端代码:
这是controller控制器,作用是分配接收器作处理
数据类层:
serviceImpl实现类:
service接口:
数据访问层:
前端代码:
这里有用到axios的select函数
getById2方法:
mysql用了两个数据表(student_message、student_score):
student_message表:
student_score表:
网页页面:
我用的是getById2()是"select stu_id from student_message where stu_id != #{stu_id}" 不行(注意where的是 != ),
但getById1()是"select stu_id from student_message where stu_id = #{stu_id}" (注意where的是 **=**)却可以执行。
按道理来说执行getById2()会是这样的结果:
这里已经执行了一次axios的select函数,控制台network查看显示的状态码正确但不知道为什么没实现select出来,
getById2()函数没去把数据库数据调到this.byId:[]