Joburgess 5 years ago
parent
commit
1595d9023a

+ 55 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamMusicTheoryController.java

@@ -0,0 +1,55 @@
+package com.keao.edu.user.controller;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.entity.HttpResponseResult;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.user.entity.ExamMusicTheory;
+import com.keao.edu.user.page.ExamMusicTheoryQueryInfo;
+import com.keao.edu.user.service.ExamMusicTheoryService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.07.01
+ */
+@RestController
+@RequestMapping("examMusicTheory")
+@Api(tags = "考级乐理")
+public class ExamMusicTheoryController extends BaseController {
+
+    @Autowired
+    private ExamMusicTheoryService examMusicTheoryService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamMusicTheory>> getList(ExamMusicTheoryQueryInfo queryInfo) {
+        return succeed(examMusicTheoryService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("新增")
+    @PostMapping(value = "/add")
+    public HttpResponseResult add(ExamMusicTheory examMusicTheory) {
+        examMusicTheoryService.insert(examMusicTheory);
+        return succeed();
+    }
+
+    @ApiOperation("更新")
+    @PostMapping(value = "/update")
+    public HttpResponseResult update(ExamMusicTheory examMusicTheory) {
+        examMusicTheory.setUpdateTime(new Date());
+        examMusicTheoryService.update(examMusicTheory);
+        return succeed();
+    }
+
+    @ApiOperation("删除")
+    @PostMapping(value = "/del/{id}")
+    public HttpResponseResult add(@PathVariable("id") Integer id) {
+        return succeed(examMusicTheoryService.delete(id));
+    }
+
+}

+ 53 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamTeacherSalaryController.java

@@ -0,0 +1,53 @@
+package com.keao.edu.user.controller;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.entity.HttpResponseResult;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.user.entity.ExamTeacherSalary;
+import com.keao.edu.user.page.ExamTeacherSalaryQueryInfo;
+import com.keao.edu.user.service.ExamTeacherSalaryService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+
+import java.util.Date;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.07.01
+ */
+public class ExamTeacherSalaryController extends BaseController {
+
+    @Autowired
+    private ExamTeacherSalaryService examTeacherSalaryService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamTeacherSalary>> getList(ExamTeacherSalaryQueryInfo queryInfo) {
+        return succeed(examTeacherSalaryService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("新增")
+    @PostMapping(value = "/add")
+    public HttpResponseResult add(ExamTeacherSalary examTeacherSalary) {
+        examTeacherSalaryService.insert(examTeacherSalary);
+        return succeed();
+    }
+
+    @ApiOperation("更新")
+    @PostMapping(value = "/update")
+    public HttpResponseResult update(ExamTeacherSalary examTeacherSalary) {
+        examTeacherSalary.setUpdateTime(new Date());
+        examTeacherSalaryService.update(examTeacherSalary);
+        return succeed();
+    }
+
+    @ApiOperation("删除")
+    @PostMapping(value = "/del/{id}")
+    public HttpResponseResult add(@PathVariable("id") Long id) {
+        return succeed(examTeacherSalaryService.delete(id));
+    }
+
+}

+ 22 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamMusicTheoryQueryInfo.java

@@ -0,0 +1,22 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.07.01
+ */
+public class ExamMusicTheoryQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "考试项目编号")
+    private Integer examId;
+
+    public Integer getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Integer examId) {
+        this.examId = examId;
+    }
+}

+ 22 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamTeacherSalaryQueryInfo.java

@@ -0,0 +1,22 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.07.01
+ */
+public class ExamTeacherSalaryQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "考级编号")
+    private Integer examId;
+
+    public Integer getExamId() {
+        return examId;
+    }
+
+    public void setExamId(Integer examId) {
+        this.examId = examId;
+    }
+}

+ 24 - 17
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamMusicTheoryMapper.xml

@@ -39,22 +39,21 @@
 	
 	<!-- 根据主键查询一条记录 -->
 	<update id="update" parameterType="com.keao.edu.user.entity.ExamMusicTheory">
-		UPDATE exam_music_theory <set>
-		<if test="examinationBasicId != null">
-		examination_basic_id_ = #{examinationBasicId},
-		</if>
-		<if test="fee != null">
-		fee_ = #{fee},
-		</if>
-		<if test="tenantId != null">
-		tenant_id_ = #{tenantId},
-		</if>
-		<if test="updateTime != null">
-		update_time_ = #{updateTime},
-		</if>
-		<if test="level != null">
-		level_ = #{level},
-		</if>
+		UPDATE exam_music_theory
+		<set>
+			<if test="examinationBasicId != null">
+				examination_basic_id_ = #{examinationBasicId},
+			</if>
+			<if test="fee != null">
+				fee_ = #{fee},
+			</if>
+			<if test="tenantId != null">
+				tenant_id_ = #{tenantId},
+			</if>
+			<if test="level != null">
+				level_ = #{level},
+			</if>
+				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
 	
@@ -62,10 +61,18 @@
 	<delete id="delete" >
 		DELETE FROM exam_music_theory WHERE id_ = #{id} 
 	</delete>
+
+	<sql id="queryCondition">
+		<where>
+			examination_basic_id_ = #{examId}
+		</where>
+	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ExamMusicTheory" parameterType="map">
-		SELECT * FROM exam_music_theory ORDER BY id_ <include refid="global.limit"/>
+		SELECT * FROM exam_music_theory
+		ORDER BY id_
+		<include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->

+ 8 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamTeacherSalaryMapper.xml

@@ -64,15 +64,23 @@
 	<delete id="delete" >
 		DELETE FROM exam_teacher_salary WHERE id_ = #{id} 
 	</delete>
+
+	<sql id="queryPageCondition">
+		<where>
+			examination_basic_id_ = #{examinationBasicId}
+		</where>
+	</sql>
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="ExamTeacherSalary" parameterType="map">
 		SELECT * FROM exam_teacher_salary
+		<include refid="queryPageCondition"/>
 		ORDER BY id_ <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM exam_teacher_salary
+		<include refid="queryPageCondition"/>
 	</select>
 </mapper>