mapper.xml出现“Caused by: java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).”问题
发现文件内是
JOIN homework_class on hc_hp_id = hp_id
LEFT JOIN homework_reply on hp_id = hr_hp_id /*and hr_parent_id = #{bo.parentId}*/ and hr_student_id = #{bo.studentId}
JOIN teacher_info on hp_teacher_code = user_code
去掉注释即可:
JOIN homework_class on hc_hp_id = hp_id
LEFT JOIN homework_reply on hp_id = hr_hp_id and hr_student_id = #{bo.studentId}
JOIN teacher_info on hp_teacher_code = user_code