yonge 2 lat temu
rodzic
commit
7e0d71a04e

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/CourseScheduleSwDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.biz.dal.entity.CourseScheduleSw;
+
+public interface CourseScheduleSwDao extends BaseDAO<Long, CourseScheduleSw> {
+
+	
+}

+ 145 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/CourseScheduleSw.java

@@ -0,0 +1,145 @@
+package com.ym.mec.biz.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(course_schedule_sw):
+ */
+public class CourseScheduleSw {
+
+	/**  */
+	private Long id;
+	
+	/**  */
+	private Integer teacherId;
+	
+	private String teacherName;
+	
+	/**  */
+	private String courseType;
+	
+	/**  */
+	private String courseName;
+	
+	/**  */
+	private String teachMode;
+	
+	private String courseStatus;
+	
+	/**  */
+	private java.util.Date classDate;
+	
+	/**  */
+	private String classTime;
+	
+	/**  */
+	private java.math.BigDecimal salary;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setTeacherId(Integer teacherId){
+		this.teacherId = teacherId;
+	}
+	
+	public Integer getTeacherId(){
+		return this.teacherId;
+	}
+			
+	public String getTeacherName() {
+		return teacherName;
+	}
+
+	public void setTeacherName(String teacherName) {
+		this.teacherName = teacherName;
+	}
+
+	public void setCourseType(String courseType){
+		this.courseType = courseType;
+	}
+	
+	public String getCourseType(){
+		return this.courseType;
+	}
+			
+	public void setCourseName(String courseName){
+		this.courseName = courseName;
+	}
+	
+	public String getCourseName(){
+		return this.courseName;
+	}
+			
+	public void setTeachMode(String teachMode){
+		this.teachMode = teachMode;
+	}
+	
+	public String getTeachMode(){
+		return this.teachMode;
+	}
+			
+	public String getCourseStatus() {
+		return courseStatus;
+	}
+
+	public void setCourseStatus(String courseStatus) {
+		this.courseStatus = courseStatus;
+	}
+
+	public void setClassDate(java.util.Date classDate){
+		this.classDate = classDate;
+	}
+	
+	public java.util.Date getClassDate(){
+		return this.classDate;
+	}
+			
+	public void setClassTime(String classTime){
+		this.classTime = classTime;
+	}
+	
+	public String getClassTime(){
+		return this.classTime;
+	}
+			
+	public void setSalary(java.math.BigDecimal salary){
+		this.salary = salary;
+	}
+	
+	public java.math.BigDecimal getSalary(){
+		return this.salary;
+	}
+			
+	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);
+	}
+
+}

+ 70 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/CourseScheduleSWQueryInfo.java

@@ -0,0 +1,70 @@
+package com.ym.mec.biz.dal.page;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+import com.ym.mec.common.page.QueryInfo;
+
+/**
+ * @Author Joburgess
+ * @Date 2019/12/27
+ */
+public class CourseScheduleSWQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "教师编号")
+    private String teacherIdList;
+
+    @ApiModelProperty(value = "课程创建开始时间")
+    private Date createStartDate;
+    
+    @ApiModelProperty(value = "课程创建结束时间")
+    private Date createEndDate;
+
+    @ApiModelProperty(value = "课程状态")
+    private String courseStatus;
+
+    @ApiModelProperty(value = "上课模式")
+    private String teachMode;
+
+	public String getTeacherIdList() {
+		return teacherIdList;
+	}
+
+	public void setTeacherIdList(String teacherIdList) {
+		this.teacherIdList = teacherIdList;
+	}
+
+	public Date getCreateStartDate() {
+		return createStartDate;
+	}
+
+	public void setCreateStartDate(Date createStartDate) {
+		this.createStartDate = createStartDate;
+	}
+
+	public Date getCreateEndDate() {
+		return createEndDate;
+	}
+
+	public void setCreateEndDate(Date createEndDate) {
+		this.createEndDate = createEndDate;
+	}
+
+	public String getCourseStatus() {
+		return courseStatus;
+	}
+
+	public void setCourseStatus(String courseStatus) {
+		this.courseStatus = courseStatus;
+	}
+
+	public String getTeachMode() {
+		return teachMode;
+	}
+
+	public void setTeachMode(String teachMode) {
+		this.teachMode = teachMode;
+	}
+
+}

+ 8 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/CourseScheduleSwService.java

@@ -0,0 +1,8 @@
+package com.ym.mec.biz.service;
+
+import com.ym.mec.biz.dal.entity.CourseScheduleSw;
+import com.ym.mec.common.service.BaseService;
+
+public interface CourseScheduleSwService extends BaseService<Long, CourseScheduleSw> {
+
+}

+ 23 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseScheduleSwServiceImpl.java

@@ -0,0 +1,23 @@
+package com.ym.mec.biz.service.impl;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.ym.mec.biz.dal.dao.CourseScheduleSwDao;
+import com.ym.mec.biz.dal.entity.CourseScheduleSw;
+import com.ym.mec.biz.service.CourseScheduleSwService;
+import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.service.impl.BaseServiceImpl;
+
+@Service
+public class CourseScheduleSwServiceImpl extends BaseServiceImpl<Long, CourseScheduleSw>  implements CourseScheduleSwService {
+	
+	@Autowired
+	private CourseScheduleSwDao courseScheduleSwDao;
+
+	@Override
+	public BaseDAO<Long, CourseScheduleSw> getDAO() {
+		return courseScheduleSwDao;
+	}
+	
+}

+ 134 - 0
mec-biz/src/main/resources/config/mybatis/CourseScheduleSwMapper.xml

@@ -0,0 +1,134 @@
+<?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.ym.mec.biz.dal.dao.CourseScheduleSwDao">
+
+	<resultMap type="com.ym.mec.biz.dal.entity.CourseScheduleSw"
+		id="CourseScheduleSw">
+		<result column="id_" property="id" />
+		<result column="teacher_id_" property="teacherId" />
+		<result column="teacher_name_" property="teacherName" />
+		<result column="course_type_" property="courseType" />
+		<result column="course_name_" property="courseName" />
+		<result column="teach_mode_" property="teachMode" />
+		<result column="course_status_" property="courseStatus" />
+		<result column="class_date_" property="classDate" />
+		<result column="class_time_" property="classTime" />
+		<result column="salary_" property="salary" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="CourseScheduleSw">
+		SELECT * FROM course_schedule_sw WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="CourseScheduleSw">
+		SELECT * FROM course_schedule_sw ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleSw"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO course_schedule_sw
+		(id_,teacher_id_,course_type_,course_name_,teach_mode_,class_date_,class_time_,salary_,create_time_,update_time_,course_status_)
+		VALUES(#{id},#{teacherId},#{courseType},#{courseName},#{teachMode},#{classDate},#{classTime},#{salary},#{createTime},#{updateTime},#{courseStatus})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.ym.mec.biz.dal.entity.CourseScheduleSw">
+		UPDATE course_schedule_sw
+		<set>
+			<if test="classDate != null">
+				class_date_ = #{classDate},
+			</if>
+			<if test="classTime != null">
+				class_time_ = #{classTime},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="teacherId != null">
+				teacher_id_ = #{teacherId},
+			</if>
+			<if test="teachMode != null">
+				teach_mode_ = #{teachMode},
+			</if>
+			<if test="courseStatus != null">
+				course_status_ = #{courseStatus},
+			</if>
+			<if test="salary != null">
+				salary_ = #{salary},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="courseType != null">
+				course_type_ = #{courseType},
+			</if>
+			<if test="courseName != null">
+				course_name_ = #{courseName},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM course_schedule_sw WHERE id_ =
+		#{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="CourseScheduleSw"
+		parameterType="map">
+		SELECT cs.*,ifnull(u.real_name_,u.username_) teacher_name_ FROM course_schedule_sw cs left join sys_user u on cs.teacher_id_ = u.id_ ORDER BY id_
+		<where>
+			<if test="teacherIdList != null">
+				and cs.teacher_id_ = #{teacherIdList}
+			</if>
+			<if test="courseStatus != null">
+				and cs.course_status_ = #{courseStatus}
+			</if>
+			<if test="teachMode != null">
+				and cs.teach_mode_ = #{teachMode}
+			</if>
+			<if test="createStartDate != null">
+				and date(cs.create_time_) &gt;= #{createStartDate}
+			</if>
+			<if test="createEndDate != null">
+				and date(cs.create_time_) &lt;= #{createEndDate}
+			</if>
+		</where>
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM course_schedule_sw cs left join sys_user u on cs.teacher_id_ = u.id_
+		<where>
+			<if test="teacherIdList != null">
+				and cs.teacher_id_ = #{teacherIdList}
+			</if>
+			<if test="courseStatus != null">
+				and cs.course_status_ = #{courseStatus}
+			</if>
+			<if test="teachMode != null">
+				and cs.teach_mode_ = #{teachMode}
+			</if>
+			<if test="createStartDate != null">
+				and date(cs.create_time_) &gt;= #{createStartDate}
+			</if>
+			<if test="createEndDate != null">
+				and date(cs.create_time_) &lt;= #{createEndDate}
+			</if>
+		</where>
+	</select>
+</mapper>

+ 28 - 0
mec-web/src/main/java/com/ym/mec/web/controller/CourseScheduleSwController.java

@@ -0,0 +1,28 @@
+package com.ym.mec.web.controller;
+
+import io.swagger.annotations.ApiOperation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.ym.mec.biz.dal.page.CourseScheduleSWQueryInfo;
+import com.ym.mec.biz.service.CourseScheduleSwService;
+import com.ym.mec.common.controller.BaseController;
+
+@RequestMapping("courseScheduleSw")
+@RestController
+public class CourseScheduleSwController extends BaseController {
+
+	@Autowired
+	private CourseScheduleSwService courseScheduleSwService;
+
+    @ApiOperation(value = "课表查询")
+    @GetMapping("/queryPage")
+    @PreAuthorize("@pcs.hasPermissions('courseSchedule/queryPage')")
+    public Object queryPage(CourseScheduleSWQueryInfo queryInfo){
+        return succeed(courseScheduleSwService.queryPage(queryInfo));
+    }
+}