Doctor doctor = doctorMapper.selectList(
new LambdaQueryWrapper()
.eq(Doctor::getCode,doctorCode)
).get(0);
寫了個這,一直出問題,空指針異常。後面發現是
DoctorMapper doctorMapper;究其原因還是因為對象沒有初始化。沒有加上注解@Resource,加上注解就好了
Doctor doctor = doctorMapper.selectList(
new LambdaQueryWrapper()
.eq(Doctor::getCode,doctorCode)
).get(0);
寫了個這,一直出問題,空指針異常。後面發現是
DoctorMapper doctorMapper;究其原因還是因為對象沒有初始化。沒有加上注解@Resource,加上注解就好了