Commit cba5931f2800bb06cfbb470d925ade66bf4ffce5
1 parent
4b347a15
添加翻页
Showing
12 changed files
with
75 additions
and
7 deletions
WebRoot/WEB-INF/jsp/sunvote/coursemanagement/coursemanagement_list2.jsp
... | ... | @@ -28,6 +28,7 @@ |
28 | 28 | <!-- 检索 --> |
29 | 29 | <form action="coursemanagement/listcs.do" method="post" name="Form" |
30 | 30 | id="Form" style="background:#fff;"> |
31 | + <input type="hidden" name="SCHOOL_ID" id="PAPER_ID" value="${pd.SCHOOL_ID}"/> | |
31 | 32 | <div class="head_box"> |
32 | 33 | <div class="box_header"> |
33 | 34 | <div class="head_box_l"> | ... | ... |
WebRoot/WEB-INF/jsp/sunvote/subject/subject_list2.jsp
WebRoot/WEB-INF/jsp/sunvote/teacher/teacher_list2.jsp
... | ... | @@ -98,7 +98,18 @@ |
98 | 98 | </c:choose> |
99 | 99 | </tbody> |
100 | 100 | </table> |
101 | + <div class="footer" style="width:auto"> | |
102 | + <!-- <div class="creat"> | |
103 | + <input type="button" onclick="parent.$('.title_time').modal('show');" value="添加老师" /> | |
101 | 104 | </div> |
105 | + <div class="removeAll"> | |
106 | + <input type="button" onclick="deleteAll()" value="删除" /> | |
107 | + </div> --> | |
108 | + <div class="page_box"> | |
109 | + <div class="pagination" style="float: right;padding-top: 0px;margin-top: 0px;">${page.pageStr}</div> | |
110 | + </div> | |
111 | + </div> | |
112 | + </div> | |
102 | 113 | </form> |
103 | 114 | |
104 | 115 | ... | ... |
resources/mybatis1/sunvote/CourseManagementMapper.xml
... | ... | @@ -150,6 +150,28 @@ |
150 | 150 | |
151 | 151 | </select> |
152 | 152 | |
153 | + <!-- 列表(全部) --> | |
154 | + <select id="listCourselistPage" parameterType="page" resultType="pd"> | |
155 | + SELECT | |
156 | + sv_teacher.`NAME`, | |
157 | + sv_teacher.`ID` AS TID, | |
158 | + sv_sclass.CLASS_NAME, | |
159 | + sv_sclass.ID AS CID, | |
160 | + sv_subject.CNAME, | |
161 | + sv_subject.ID AS SID, | |
162 | + SV_COURSEMANAGEMENT.HEAD_MASTER | |
163 | + FROM | |
164 | + SV_COURSEMANAGEMENT | |
165 | + LEFT JOIN sv_sclass ON SV_COURSEMANAGEMENT.CLASS_ID = sv_sclass.ID | |
166 | + LEFT JOIN sv_schoolgradesubject ON sv_sclass.GRADE_ID = sv_schoolgradesubject.GRADE_ID | |
167 | + AND sv_sclass.SCHOOL_ID = sv_schoolgradesubject.SCHOOL_ID | |
168 | + LEFT JOIN sv_teacher ON sv_coursemanagement.TEACHER_ID = sv_teacher.ID | |
169 | + LEFT JOIN sv_subject on sv_coursemanagement.SUBJECT_ID = sv_subject.ID | |
170 | + WHERE | |
171 | + sv_schoolgradesubject.SCHOOL_ID = #{pd.SCHOOL_ID} | |
172 | + | |
173 | + </select> | |
174 | + | |
153 | 175 | |
154 | 176 | |
155 | 177 | <!-- 批量删除 --> | ... | ... |
resources/mybatis1/sunvote/SubjectMapper.xml
... | ... | @@ -111,6 +111,20 @@ |
111 | 111 | </if> |
112 | 112 | </select> |
113 | 113 | |
114 | + <!-- 列表(全部) --> | |
115 | + <select id="listAllSchoollistPage" parameterType="pd" resultType="pd"> | |
116 | + select | |
117 | + <include refid="Field"></include> | |
118 | + from | |
119 | + <include refid="tableName"></include> | |
120 | + | |
121 | + INNER JOIN sv_schoolgradesubject ON sv_subject.ID = sv_schoolgradesubject.SUBJECT_ID | |
122 | + WHERE 1 =1 | |
123 | + <if test="pd.SCHOOL_ID != null and pd.SCHOOL_ID != ''"> | |
124 | + and sv_schoolgradesubject.SCHOOL_ID = #{pd.SCHOOL_ID} | |
125 | + </if> | |
126 | + </select> | |
127 | + | |
114 | 128 | <!-- 批量删除 --> |
115 | 129 | <delete id="deleteAll" parameterType="String"> |
116 | 130 | delete from | ... | ... |
src/com/fh/controller/sunvote/coursemanagement/CourseManagementController.java
... | ... | @@ -147,11 +147,12 @@ public class CourseManagementController extends BaseController { |
147 | 147 | * @throws Exception |
148 | 148 | */ |
149 | 149 | @RequestMapping(value="/listcs") |
150 | - public ModelAndView listcs() throws Exception{ | |
150 | + public ModelAndView listcs(Page page) throws Exception{ | |
151 | 151 | ModelAndView mv = this.getModelAndView(); |
152 | 152 | PageData pd = new PageData(); |
153 | 153 | pd = this.getPageData(); |
154 | - List<PageData> varList = coursemanagementService.listCourse(pd); //列出CourseManagement列表 | |
154 | + page.setPd(pd); | |
155 | + List<PageData> varList = coursemanagementService.listCourse(page); //列出CourseManagement列表 | |
155 | 156 | mv.setViewName("sunvote/coursemanagement/coursemanagement_list2"); |
156 | 157 | mv.addObject("varList", varList); |
157 | 158 | mv.addObject("pd", pd); | ... | ... |
src/com/fh/controller/sunvote/subject/SubjectController.java
... | ... | @@ -116,13 +116,14 @@ public class SubjectController extends BaseController { |
116 | 116 | * @throws Exception |
117 | 117 | */ |
118 | 118 | @RequestMapping(value="/listcs") |
119 | - public ModelAndView listcs() throws Exception{ | |
119 | + public ModelAndView listcs(Page page) throws Exception{ | |
120 | 120 | logBefore(logger, Jurisdiction.getUsername()+"列表Subject"); |
121 | 121 | //if(!Jurisdiction.buttonJurisdiction(menuUrl, "cha")){return null;} //校验权限(无权查看时页面会有提示,如果不注释掉这句代码就无法进入列表页面,所以根据情况是否加入本句代码) |
122 | 122 | ModelAndView mv = this.getModelAndView(); |
123 | 123 | PageData pd = new PageData(); |
124 | 124 | pd = this.getPageData(); |
125 | - List<PageData> varList = subjectService.listAllSchool(pd); //列出Subject列表 | |
125 | + page.setPd(pd); | |
126 | + List<PageData> varList = subjectService.listAllSchool(page); //列出Subject列表 | |
126 | 127 | mv.setViewName("sunvote/subject/subject_list2"); |
127 | 128 | mv.addObject("varList", varList); |
128 | 129 | mv.addObject("pd", pd); | ... | ... |
src/com/fh/controller/sunvote/teacher/TeacherController.java
... | ... | @@ -399,12 +399,13 @@ public class TeacherController extends BaseController { |
399 | 399 | * @throws Exception |
400 | 400 | */ |
401 | 401 | @RequestMapping(value = "/listcs") |
402 | - public ModelAndView listcs() throws Exception { | |
402 | + public ModelAndView listcs(Page page) throws Exception { | |
403 | 403 | logBefore(logger, Jurisdiction.getUsername() + "列表Teacher"); |
404 | 404 | ModelAndView mv = this.getModelAndView(); |
405 | 405 | PageData pd = new PageData(); |
406 | 406 | pd = this.getPageData(); |
407 | - List<PageData> varList = teacherService.listAll(pd); // 列出Teacher列表 | |
407 | + page.setPd(pd); | |
408 | + List<PageData> varList = teacherService.list(page); // 列出Teacher列表 | |
408 | 409 | mv.setViewName("sunvote/teacher/teacher_list2"); |
409 | 410 | mv.addObject("varList", varList); |
410 | 411 | ... | ... |
src/com/fh/service/sunvote/coursemanagement/CourseManagementManager.java
src/com/fh/service/sunvote/coursemanagement/impl/CourseManagementService.java
... | ... | @@ -66,6 +66,11 @@ public class CourseManagementService implements CourseManagementManager{ |
66 | 66 | return (List<PageData>)dao.findForList("CourseManagementMapper.listCourse", pd); |
67 | 67 | } |
68 | 68 | |
69 | + @SuppressWarnings("unchecked") | |
70 | + public List<PageData> listCourse(Page pd)throws Exception{ | |
71 | + return (List<PageData>)dao.findForList("CourseManagementMapper.listCourselistPage", pd); | |
72 | + } | |
73 | + | |
69 | 74 | /**通过id获取数据 |
70 | 75 | * @param pd |
71 | 76 | * @throws Exception | ... | ... |
src/com/fh/service/sunvote/subject/SubjectManager.java
src/com/fh/service/sunvote/subject/impl/SubjectService.java
... | ... | @@ -71,6 +71,15 @@ public class SubjectService implements SubjectManager{ |
71 | 71 | return (List<PageData>)dao.findForList("SubjectMapper.listAllSchool", pd); |
72 | 72 | } |
73 | 73 | |
74 | + /**列表(全部) | |
75 | + * @param pd | |
76 | + * @throws Exception | |
77 | + */ | |
78 | + @SuppressWarnings("unchecked") | |
79 | + public List<PageData> listAllSchool(Page pd)throws Exception{ | |
80 | + return (List<PageData>)dao.findForList("SubjectMapper.listAllSchoollistPage", pd); | |
81 | + } | |
82 | + | |
74 | 83 | /**通过id获取数据 |
75 | 84 | * @param pd |
76 | 85 | * @throws Exception | ... | ... |