Skip to content

Commit 5fc8d76

Browse files
committed
Merge branch 'dev'
si�kb-M�kbm�kb�kbmerge�:q "�"�" q!" s:�kb�i�kre�:q 1 �:q�kbwq 1�kb�kb�kb 1 �:wq 1.txt
2 parents b5782bd + 263e68c commit 5fc8d76

39 files changed

+689
-95
lines changed

src/com/giit/www/college/controller/ClazzController.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.giit.www.college.service.ClazzBiz;
44
import org.springframework.stereotype.Controller;
55
import org.springframework.ui.Model;
6+
import org.springframework.web.bind.annotation.RequestBody;
67
import org.springframework.web.bind.annotation.RequestMapping;
78

89
import javax.annotation.Resource;
@@ -20,7 +21,7 @@ public class ClazzController {
2021
@RequestMapping("add")
2122
public String add(String deptName, String specName, String year) {
2223
clazzBiz.add(deptName, specName, year);
23-
return "redirect:/class.do/clazz.view";
24+
return "redirect:/clazz.do/clazz.view";
2425
}
2526

2627
@RequestMapping("delete")
@@ -37,7 +38,8 @@ public String findAll(Model m) {
3738

3839
@RequestMapping("clazz_add.view")
3940
public String findDeptAndSpec(Model m) {
40-
m.addAttribute("deptAndSpec", clazzBiz.findDeptAndSpec());
41+
m.addAttribute("deptAndSpecJson", clazzBiz.findDeptAndSpecJson());
42+
m.addAttribute("deptNameList", clazzBiz.findDeptNameList());
4143
return "/college/clazz_add";
4244
}
4345
}

src/com/giit/www/college/controller/DeptController.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,21 @@ public class DeptController {
2020
private DeptBiz deptBiz;
2121

2222
@RequestMapping("dept.view")
23-
public String findAll(Model m) {
23+
public String deptView(Model m) {
2424
m.addAttribute("deptList", deptBiz.findAll());
2525
return "/college/dept";
2626
}
2727

28+
@RequestMapping("dept_add.view")
29+
public String deptAddView(Model m) {
30+
return "/college/dept_add";
31+
}
32+
33+
@RequestMapping("dept_update.view")
34+
public String deptUpdateView(Model m) {
35+
return "/college/dept_update";
36+
}
37+
2838
@RequestMapping("add")
2939
public String add(String deptName) {
3040
deptBiz.add(deptName);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.giit.www.college.controller;
2+
3+
import com.giit.www.college.service.OrderBookBiz;
4+
import org.springframework.stereotype.Controller;
5+
6+
import javax.annotation.Resource;
7+
8+
/**
9+
* Created by c0de8ug on 16-2-13.
10+
*/
11+
@Controller
12+
public class OrderBookController {
13+
@Resource(name = "orderBookBizImpl")
14+
private OrderBookBiz orderBookBiz;
15+
16+
17+
}

src/com/giit/www/college/controller/SectionController.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,23 @@ public class SectionController {
2020
@RequestMapping("section.view")
2121
public String sectionView(Model m) {
2222
m.addAttribute("sectionList", sectionBiz.findAllCustom());
23-
2423
return "/college/section";
2524
}
2625

2726
@RequestMapping("section_add.view")
2827
public String sectionAddView(Model m) {
2928
m.addAttribute("courseTitleList", sectionBiz.findAllCourseTitle());
30-
m.addAttribute("teacherNameList", sectionBiz.findAllTeacherName());
29+
m.addAttribute("staffList", sectionBiz.findAllStaff());
3130
return "/college/section_add";
3231
}
3332

34-
3533
@RequestMapping("add")
3634
public String add(Section section) {
3735
sectionBiz.add(section);
3836
return "redirect:section.view";
3937
}
4038

39+
//TODO 1.这里需要事务管理
4140
@RequestMapping("delete")
4241
public String delete(int sectionId) {
4342
sectionBiz.delete(sectionId);

src/com/giit/www/college/controller/SpecController.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,23 @@ public class SpecController {
2222

2323

2424
@RequestMapping("spec_add.view")
25-
public String findDept(Model m) {
25+
public String specAddView(Model m) {
2626
m.addAttribute("deptNameList", specBiz.findDpet());
2727
return "/college/spec_add";
2828
}
2929

3030
//TODO 该名字deptAndSpec不好,但是不知道如何命名-, -
3131
@RequestMapping("spec.view")
32-
public String findDeptAndSpec(Model m) {
32+
public String specView(Model m) {
3333
m.addAttribute("deptAndSpec", specBiz.findDeptAndSpec());
3434
return "/college/spec";
3535
}
3636

37+
@RequestMapping("spec_update.view")
38+
public String specUpdateView(Model m) {
39+
return "/college/spec_update";
40+
}
41+
3742
@RequestMapping("update")
3843
public String update(@Param("specName") String newSpecName, @Param("newSpecName") String specName) {
3944
specBiz.update(specName, newSpecName);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
11
package com.giit.www.college.controller;
22

3+
import com.giit.www.college.service.StudentBiz;
34
import org.springframework.stereotype.Controller;
5+
import org.springframework.ui.Model;
46
import org.springframework.web.bind.annotation.RequestMapping;
57

8+
import javax.annotation.Resource;
9+
610
/**
711
* Created by c0de8ug on 16-2-12.
812
*/
913
@Controller
1014
@RequestMapping("student.do")
1115
public class StudentController {
1216

17+
@Resource(name = "studentBizImpl")
18+
StudentBiz studentBiz;
19+
20+
@RequestMapping("student.view")
21+
public String studentView(Model m) {
22+
//TODO 将biz命名为和业务有关的函数方法,不知道是否正确留个吭
23+
m.addAttribute("studentList", studentBiz.studentView());
24+
return "/college/student";
25+
}
26+
27+
@RequestMapping("student_add.view")
28+
public String studentAddView(Model m) {
29+
30+
return "/college/student_add";
31+
}
1332

33+
@RequestMapping("student_elective.view")
34+
public String studentElectiveView() {
35+
return "/college/student_elective";
36+
}
1437
}

src/com/giit/www/college/dao/ClazzDao.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
</delete>
2727

2828
<select id="getClassCount" parameterType="map" resultType="int">
29-
SELECT count(spec_name) FROM class WHERE spec_name = #{specName} AND year = #{year}
29+
SELECT count(class_id) FROM class WHERE spec_name = #{specName} AND year = #{year}
3030
</select>
3131
</mapper>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.giit.www.college.dao;
2+
3+
/**
4+
* Created by c0de8ug on 16-2-13.
5+
*/
6+
public interface OrderBookDao {
7+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE mapper
3+
PUBLIC "-//mybatis.org//DTD mapper 3.0//EN"
4+
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5+
6+
7+
<mapper namespace="com.giit.www.college.dao.OrderBookDao">
8+
9+
</mapper>

src/com/giit/www/college/dao/SectionDao.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<mapper namespace="com.giit.www.college.dao.SectionDao">
88

99
<resultMap id="sec_map" type="Section">
10+
<result property="secId" column="sec_id"/>
1011
<result property="courseTitle" column="course_title"/>
1112
<result property="year" column="year"/>
1213
<result property="staffId" column="staff_id"/>
@@ -28,8 +29,8 @@
2829

2930
<select id="findAllCustom" resultMap="sec_custom_map">
3031
SELECT section.sec_id,course_title,year,staff_name,time,week,weeks,classroom FROM section
31-
INNER JOIN staff ON section.sec_id = staff.staff_id
32-
INNER JOIN timetable ON section.sec_id = timetable.sec_id
32+
INNER JOIN staff ON section.staff_id = staff.staff_id
33+
LEFT JOIN timetable ON section.sec_id = timetable.sec_id
3334
</select>
3435

3536
<insert id="add" parameterType="Section">

0 commit comments

Comments
 (0)