From cc35e2976f7e7cd0bf3c61cd9c57d429d50a5cfa Mon Sep 17 00:00:00 2001 From: tamguo Date: Mon, 6 Aug 2018 11:53:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=A6=E7=B1=8D=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tiku/model/condition/BookCondition.java | 14 +-- .../tiku/model/condition/CourseCondition.java | 14 +-- .../tiku/service/impl/CourseServiceImpl.java | 4 +- .../resources/mappers/tiku/BookMapper.xml | 8 +- .../modules/tiku/web/CourseController.java | 2 +- .../templates/modules/tiku/book/list.html | 92 +++++++++++++++++-- 6 files changed, 107 insertions(+), 27 deletions(-) diff --git a/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/condition/BookCondition.java b/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/condition/BookCondition.java index 45b6005..30e15ed 100644 --- a/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/condition/BookCondition.java +++ b/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/condition/BookCondition.java @@ -5,9 +5,9 @@ public class BookCondition { private Integer pageNo; private Integer pageSize; + private String id; private String publishingHouse; private String name; - private String subjectId; private String courseId; public Integer getPageNo() { @@ -22,12 +22,6 @@ public class BookCondition { public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } - public String getSubjectId() { - return subjectId; - } - public void setSubjectId(String subjectId) { - this.subjectId = subjectId; - } public String getCourseId() { return courseId; } @@ -46,5 +40,11 @@ public class BookCondition { public void setName(String name) { this.name = name; } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } } diff --git a/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/condition/CourseCondition.java b/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/condition/CourseCondition.java index 074706b..bc2ec27 100644 --- a/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/condition/CourseCondition.java +++ b/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/condition/CourseCondition.java @@ -5,7 +5,7 @@ public class CourseCondition { private Integer pageNo; private Integer pageSize; - private String uid; + private String id; private String name; private String status; private String subjectId; @@ -22,12 +22,6 @@ public class CourseCondition { public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } - public String getUid() { - return uid; - } - public void setUid(String uid) { - this.uid = uid; - } public String getName() { return name; } @@ -46,5 +40,11 @@ public class CourseCondition { public void setSubjectId(String subjectId) { this.subjectId = subjectId; } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } } diff --git a/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/service/impl/CourseServiceImpl.java b/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/service/impl/CourseServiceImpl.java index 5ea61bd..44da10b 100644 --- a/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/service/impl/CourseServiceImpl.java +++ b/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/service/impl/CourseServiceImpl.java @@ -36,8 +36,8 @@ public class CourseServiceImpl extends ServiceImpl i public Page listData(CourseCondition condition) { Page page = new Page<>(condition.getPageNo() , condition.getPageSize()); Condition query = Condition.create(); - if(!StringUtils.isEmpty(condition.getUid())) { - query.eq("uid", condition.getUid()); + if(!StringUtils.isEmpty(condition.getId())) { + query.eq("id", condition.getId()); } if(!StringUtils.isEmpty(condition.getName())) { query.like("name", condition.getName()); diff --git a/tamguo-modules-core/src/main/resources/mappers/tiku/BookMapper.xml b/tamguo-modules-core/src/main/resources/mappers/tiku/BookMapper.xml index b474233..6852bab 100644 --- a/tamguo-modules-core/src/main/resources/mappers/tiku/BookMapper.xml +++ b/tamguo-modules-core/src/main/resources/mappers/tiku/BookMapper.xml @@ -25,17 +25,17 @@ LEFT JOIN tiku_course c ON c.id = b.course_id WHERE 1 = 1 + + and b.id = #{id} + and b.name = #{name} and b.publishing_house = #{publishingHouse} - - and b.subject_id = #{subjectId} - - and b.course_id = #{courseId} + and (b.course_id = #{courseId} or b.subject_id = #{courseId}) \ No newline at end of file diff --git a/tamguo-oms/src/main/java/com/tamguo/modules/tiku/web/CourseController.java b/tamguo-oms/src/main/java/com/tamguo/modules/tiku/web/CourseController.java index 672831f..66fb3e4 100644 --- a/tamguo-oms/src/main/java/com/tamguo/modules/tiku/web/CourseController.java +++ b/tamguo-oms/src/main/java/com/tamguo/modules/tiku/web/CourseController.java @@ -120,7 +120,7 @@ public class CourseController { } } - @RequestMapping(path="treeData",method=RequestMethod.POST) + @RequestMapping(path="treeData",method=RequestMethod.GET) @ResponseBody public JSONArray treeData() { return iCourseService.treeData(); diff --git a/tamguo-oms/src/main/resources/templates/modules/tiku/book/list.html b/tamguo-oms/src/main/resources/templates/modules/tiku/book/list.html index e35a702..ffecc6a 100644 --- a/tamguo-oms/src/main/resources/templates/modules/tiku/book/list.html +++ b/tamguo-oms/src/main/resources/templates/modules/tiku/book/list.html @@ -39,6 +39,12 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
+
+ +
+ +
+
@@ -52,12 +58,86 @@ content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
- -
- + +
+
+ + + +
+