Explorar o código

Merge branch 'master' of http://git.dayaedu.com/yonge/edu-saas

zouxuan %!s(int64=5) %!d(string=hai) anos
pai
achega
f24ab5a679

+ 64 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamLocationController.java

@@ -0,0 +1,64 @@
+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.common.page.QueryInfo;
+import com.keao.edu.user.entity.ExamLocation;
+import com.keao.edu.user.entity.ExamSong;
+import com.keao.edu.user.service.ExamLocationService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+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.06.16
+ */
+@RestController
+@RequestMapping("examLocation")
+@Api(tags = "线下考点服务")
+public class ExamLocationController extends BaseController {
+
+    @Autowired
+    private ExamLocationService examLocationService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamLocation>> getList(QueryInfo queryInfo) {
+        return succeed(examLocationService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("查询考点详情")
+    @ApiImplicitParam(name = "id", value = "机构ID", required = true, dataType = "Integer", paramType = "path")
+    @GetMapping(value = "/query")
+    public HttpResponseResult<ExamLocation> query(Integer id) {
+        return succeed(examLocationService.get(id));
+    }
+
+    @ApiOperation("新增考点")
+    @PostMapping(value = "/add")
+    public HttpResponseResult add(ExamLocation examLocation) {
+        examLocationService.insert(examLocation);
+        return succeed();
+    }
+
+    @ApiOperation("更新考点")
+    @PostMapping(value = "/update")
+    public HttpResponseResult update(ExamLocation examLocation) {
+        examLocation.setUpdateTime(new Date());
+        examLocationService.update(examLocation);
+        return succeed();
+    }
+
+    @ApiOperation("删除考点")
+    @PostMapping(value = "/del/{id}")
+    public HttpResponseResult add(@PathVariable("id") Integer id) {
+        return succeed(examLocationService.delete(id));
+    }
+
+}

+ 64 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamSongController.java

@@ -0,0 +1,64 @@
+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.common.page.QueryInfo;
+import com.keao.edu.user.entity.ExamSong;
+import com.keao.edu.user.entity.TenantInfo;
+import com.keao.edu.user.service.ExamSongService;
+import com.keao.edu.user.service.TenantInfoService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+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.06.16
+ */
+@RestController
+@RequestMapping("examSong")
+@Api(tags = "曲库服务")
+public class ExamSongController extends BaseController {
+
+    @Autowired
+    private ExamSongService examSongService;
+
+    @ApiOperation("分页查询")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamSong>> getList(QueryInfo queryInfo) {
+        return succeed(examSongService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("查询曲库详情")
+    @ApiImplicitParam(name = "id", value = "机构ID", required = true, dataType = "Integer", paramType = "path")
+    @GetMapping(value = "/query")
+    public HttpResponseResult<ExamSong> query(Integer id) {
+        return succeed(examSongService.get(id));
+    }
+
+    @ApiOperation("新增曲库")
+    @PostMapping(value = "/add")
+    public HttpResponseResult add(ExamSong examSong) {
+        examSongService.insert(examSong);
+        return succeed();
+    }
+
+    @ApiOperation("更新曲库")
+    @PostMapping(value = "/update")
+    public HttpResponseResult update(ExamSong examSong) {
+        examSong.setUpdateTime(new Date());
+        examSongService.update(examSong);
+        return succeed();
+    }
+
+    @ApiOperation("删除曲库")
+    @PostMapping(value = "/del/{id}")
+    public HttpResponseResult add(@PathVariable("id") Integer id) {
+        return succeed(examSongService.delete(id));
+    }
+}

+ 10 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamLocationDao.java

@@ -0,0 +1,10 @@
+package com.keao.edu.user.dao;
+
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.entity.ExamLocation;
+
+public interface ExamLocationDao extends BaseDAO<Integer, ExamLocation> {
+
+	
+}

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamSongDao.java

@@ -0,0 +1,9 @@
+package com.keao.edu.user.dao;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.entity.ExamSong;
+
+public interface ExamSongDao extends BaseDAO<Integer, ExamSong> {
+
+	
+}

+ 102 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamLocation.java

@@ -0,0 +1,102 @@
+package com.keao.edu.user.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(exam_location):
+ */
+public class ExamLocation {
+
+	@ApiModelProperty(value = "考点编号")
+	private Integer id;
+
+	@ApiModelProperty(value = "考点名称")
+	private String name;
+	
+	@ApiModelProperty(value = "联系名称")
+	private String contactName;
+
+	@ApiModelProperty(value = "联系电话")
+	private String contactPhone;
+	
+	@ApiModelProperty(value = "联系地址")
+	private String address;
+
+	@ApiModelProperty(value = "是否可用")
+	private boolean isAvailable;
+
+	private java.util.Date createTime;
+
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setContactName(String contactName){
+		this.contactName = contactName;
+	}
+	
+	public String getContactName(){
+		return this.contactName;
+	}
+			
+	public void setContactPhone(String contactPhone){
+		this.contactPhone = contactPhone;
+	}
+	
+	public String getContactPhone(){
+		return this.contactPhone;
+	}
+			
+	public void setAddress(String address){
+		this.address = address;
+	}
+	
+	public String getAddress(){
+		return this.address;
+	}
+			
+	public void setIsAvailable(boolean isAvailable){
+		this.isAvailable = isAvailable;
+	}
+	
+	public boolean isIsAvailable(){
+		return this.isAvailable;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 113 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamSong.java

@@ -0,0 +1,113 @@
+package com.keao.edu.user.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(exam_song):
+ */
+public class ExamSong {
+
+	@ApiModelProperty(value = "曲目编号")
+	private Integer id;
+
+	@ApiModelProperty(value = "曲目名")
+	private String songName;
+
+	@ApiModelProperty(value = "作者名")
+	private String songAuthor;
+	
+	@ApiModelProperty(value = "专业")
+	private String subjectList;
+
+	@ApiModelProperty(value = "级别")
+	private String levelList;
+
+	@ApiModelProperty(value = "曲目类别")
+	private String type;
+
+	@ApiModelProperty(value = "曲目文件地址")
+	private String fileUrlList;
+
+	private java.util.Date createTime;
+
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setSongName(String songName){
+		this.songName = songName;
+	}
+	
+	public String getSongName(){
+		return this.songName;
+	}
+			
+	public void setSongAuthor(String songAuthor){
+		this.songAuthor = songAuthor;
+	}
+	
+	public String getSongAuthor(){
+		return this.songAuthor;
+	}
+			
+	public void setSubjectList(String subjectList){
+		this.subjectList = subjectList;
+	}
+	
+	public String getSubjectList(){
+		return this.subjectList;
+	}
+			
+	public void setLevelList(String levelList){
+		this.levelList = levelList;
+	}
+	
+	public String getLevelList(){
+		return this.levelList;
+	}
+			
+	public void setType(String type){
+		this.type = type;
+	}
+	
+	public String getType(){
+		return this.type;
+	}
+			
+	public void setFileUrlList(String fileUrlList){
+		this.fileUrlList = fileUrlList;
+	}
+	
+	public String getFileUrlList(){
+		return this.fileUrlList;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamLocationService.java

@@ -0,0 +1,9 @@
+package com.keao.edu.user.service;
+
+
+import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.ExamLocation;
+
+public interface ExamLocationService extends BaseService<Integer, ExamLocation> {
+
+}

+ 8 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamSongService.java

@@ -0,0 +1,8 @@
+package com.keao.edu.user.service;
+
+import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.ExamSong;
+
+public interface ExamSongService extends BaseService<Integer, ExamSong> {
+
+}

+ 22 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamLocationServiceImpl.java

@@ -0,0 +1,22 @@
+package com.keao.edu.user.service.impl;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.user.dao.ExamLocationDao;
+import com.keao.edu.user.entity.ExamLocation;
+import com.keao.edu.user.service.ExamLocationService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ExamLocationServiceImpl extends BaseServiceImpl<Integer, ExamLocation> implements ExamLocationService {
+	
+	@Autowired
+	private ExamLocationDao examLocationDao;
+
+	@Override
+	public BaseDAO<Integer, ExamLocation> getDAO() {
+		return examLocationDao;
+	}
+	
+}

+ 22 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamSongServiceImpl.java

@@ -0,0 +1,22 @@
+package com.keao.edu.user.service.impl;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.user.dao.ExamSongDao;
+import com.keao.edu.user.entity.ExamSong;
+import com.keao.edu.user.service.ExamSongService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ExamSongServiceImpl extends BaseServiceImpl<Integer, ExamSong> implements ExamSongService {
+	
+	@Autowired
+	private ExamSongDao examSongDao;
+
+	@Override
+	public BaseDAO<Integer, ExamSong> getDAO() {
+		return examSongDao;
+	}
+	
+}

+ 79 - 0
edu-user/edu-user-server/src/main/resources/config.mybatis/ExamLocationMapper.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.keao.edu.user.dao.ExamLocationDao">
+	
+	<resultMap type="com.keao.edu.user.entity.ExamLocation" id="ExamLocation">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="contact_name_" property="contactName" />
+		<result column="contact_phone_" property="contactPhone" />
+		<result column="address_" property="address" />
+		<result column="is_available_" property="isAvailable" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExamLocation" >
+		SELECT * FROM exam_location WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExamLocation">
+		SELECT * FROM exam_location ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamLocation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_location (id_,name_,contact_name_,contact_phone_,address_,is_available_,create_time_,update_time_)
+		VALUES(#{id},#{name},#{contactName},#{contactPhone},#{address},#{isAvailable},NOW(),NOW())
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.keao.edu.user.entity.ExamLocation">
+		UPDATE exam_location
+		<set>
+			<if test="address != null">
+			address_ = #{address},
+			</if>
+			<if test="isAvailable != null">
+			is_available_ = #{isAvailable},
+			</if>
+			<if test="id != null">
+			id_ = #{id},
+			</if>
+			<if test="contactPhone != null">
+			contact_phone_ = #{contactPhone},
+			</if>
+			<if test="contactName != null">
+			contact_name_ = #{contactName},
+			</if>
+			<if test="name != null">
+			name_ = #{name},
+			</if>
+			<if test="createTime != null">
+			create_time_ = #{createTime},
+			</if>
+			update_time_ = NOW()
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM exam_location WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExamLocation" parameterType="map">
+		SELECT * FROM exam_location ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM exam_location
+	</select>
+</mapper>

+ 83 - 0
edu-user/edu-user-server/src/main/resources/config.mybatis/ExamSongMapper.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.keao.edu.user.dao.ExamSongDao">
+	
+	<resultMap type="com.keao.edu.user.entity.ExamSong" id="ExamSong">
+		<result column="id_" property="id" />
+		<result column="song_name_" property="songName" />
+		<result column="song_author_" property="songAuthor" />
+		<result column="subject_list_" property="subjectList" />
+		<result column="level_list_" property="levelList" />
+		<result column="type_" property="type" />
+		<result column="file_url_list_" property="fileUrlList" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExamSong" >
+		SELECT * FROM exam_song WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExamSong">
+		SELECT * FROM exam_song ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamSong" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_song (id_,song_name_,song_author_,subject_list_,level_list_,type_,file_url_list_,create_time_,update_time_)
+		VALUES(#{id},#{songName},#{songAuthor},#{subjectList},#{levelList},#{type},#{fileUrlList},NOW(),NOW())
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.keao.edu.user.entity.ExamSong">
+		UPDATE exam_song
+		<set>
+			<if test="levelList != null">
+				level_list_ = #{levelList},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="subjectList != null">
+				subject_list_ = #{subjectList},
+			</if>
+			<if test="fileUrlList != null">
+				file_url_list_ = #{fileUrlList},
+			</if>
+			<if test="songAuthor != null">
+				song_author_ = #{songAuthor},
+			</if>
+			<if test="type != null">
+				type_ = #{type},
+			</if>
+			<if test="songName != null">
+				song_name_ = #{songName},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+			update_time_ = NOW()
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM exam_song WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExamSong" parameterType="map">
+		SELECT * FROM exam_song ORDER BY id_ <include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM exam_song
+	</select>
+</mapper>