@Select ("select * from Wc_homework WHERE organization_id=#{classid} ORDER by Createtime DESC LIMIT #{start},#{count}")
@Results ({
@Result (column = "course_id", property = "course_id"),
@Result (column = "homework_id", property = "homework_id"),
@Result (column = "organization_id", property = "organization_id"),
@Result (property = "Course", column = "course_id", one = @One (select = "Selectcourse")),
@Result (property = "Viewtotalnum", column = "organization_id", one = @One (select = "Selectstudentcount")),
@Result (property = "Attachments", Javatype = list.class, column = "homework_id", many = @Many (select = "Selectattachments" )),
@Result (property = "Viewnum", column = "{homework_id = homework_id,organization_id = organization_id}", one = @One (select = "Selectviewcounts")),
@Result (property = "Feedbacknum", column = "{homework_id = homework_id,organization_id = organization_id}", one = @One ( select = "Selectfeedbackcounts"))
})
List
The @Result above (property = "Feedbacknum", column = "{homework_id = homework_id,organization_id = organization_id}", one = @One ( select = "Selectfeedbackcounts"))
The last line, by passing in two parameter queries, corresponds to the map key value pair below.
@Select ("Select COUNT (DISTINCT f.user_id) from Wc_homework_log_see ws INNER JOIN \ n" +
"(SELECT wu.user_id, wf. ' family_user_id ' from Wc_organization_user Wu INNER JOIN wc_family wf in Wu. ' user_id ' = wf. ' Studen t_id ' \ n ' +
"WHERE wu ' organization_id ' = #{organization_id} and Wu. ' role_id ' = 4) F on f.family_user_id = ws. ' user_id ' \ n ' +
"WHERE ws. ' homework_id ' = #{homework_id}")
int selectviewcounts (map<string,object> Map);