Antiloveg лет назад: 8
Родитель
Сommit
46f60269d2

+ 3 - 2
schema/201707012-lecture.sql

@@ -2,14 +2,15 @@ CREATE TABLE `lecture` (
   `id` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL,
   `id` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL,
   `uid` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '开展讲座人ID',
   `uid` VARCHAR(36) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '开展讲座人ID',
   `lecture_time` VARCHAR(45) NOT NULL COMMENT '讲座开展时间',
   `lecture_time` VARCHAR(45) NOT NULL COMMENT '讲座开展时间',
-  `create_time` TIMESTAMP NULL COMMENT '记录创建时间',
-  `last_update_time` TIMESTAMP NULL COMMENT '记录最后更新时间',
+  `create_time` DATETIME NULL COMMENT '记录创建时间',
+  `last_update_time` DATETIME NULL COMMENT '记录最后更新时间',
   `name` VARCHAR(45) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '名称',
   `name` VARCHAR(45) CHARACTER SET 'utf8mb4' NOT NULL COMMENT '名称',
   `summary` VARCHAR(128) CHARACTER SET 'utf8mb4' NULL COMMENT '简介',
   `summary` VARCHAR(128) CHARACTER SET 'utf8mb4' NULL COMMENT '简介',
   `deleted_sign` INT(1) NOT NULL DEFAULT 0 COMMENT '删除标记',
   `deleted_sign` INT(1) NOT NULL DEFAULT 0 COMMENT '删除标记',
   `lecture_url` VARCHAR(255) NULL COMMENT '展示图',
   `lecture_url` VARCHAR(255) NULL COMMENT '展示图',
   `hot` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在大咖说页面展示(0--不展示,1--展示)',
   `hot` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在大咖说页面展示(0--不展示,1--展示)',
   `dynamic` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在科技明星页面展示活动动态(0--不展示,1--展示)',
   `dynamic` INT(1) NOT NULL DEFAULT 0 COMMENT '是否在科技明星页面展示活动动态(0--不展示,1--展示)',
+  `end_time` DATETIME NOT NULL COMMENT '讲堂结束时间',
   PRIMARY KEY (`id`))
   PRIMARY KEY (`id`))
 ENGINE = InnoDB DEFAULT CHARSET=utf8mb4
 ENGINE = InnoDB DEFAULT CHARSET=utf8mb4
 COMMENT = '科技讲堂';
 COMMENT = '科技讲堂';

+ 23 - 8
src/main/java/com/goafanti/common/mapper/LectureMapper.xml

@@ -13,10 +13,11 @@
     <result column="lecture_url" property="lectureUrl" jdbcType="VARCHAR" />
     <result column="lecture_url" property="lectureUrl" jdbcType="VARCHAR" />
     <result column="hot" property="hot" jdbcType="INTEGER" />
     <result column="hot" property="hot" jdbcType="INTEGER" />
     <result column="dynamic" property="dynamic" jdbcType="INTEGER" />
     <result column="dynamic" property="dynamic" jdbcType="INTEGER" />
+    <result column="end_time" property="endTime" jdbcType="TIMESTAMP" />
   </resultMap>
   </resultMap>
   <sql id="Base_Column_List" >
   <sql id="Base_Column_List" >
     id, uid, lecture_time, create_time, last_update_time, name, summary, deleted_sign, lecture_url,
     id, uid, lecture_time, create_time, last_update_time, name, summary, deleted_sign, lecture_url,
-    hot, dynamic
+    hot, dynamic, end_time
   </sql>
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
     select 
     select 
@@ -31,11 +32,11 @@
   <insert id="insert" parameterType="com.goafanti.common.model.Lecture" >
   <insert id="insert" parameterType="com.goafanti.common.model.Lecture" >
     insert into lecture (id, uid, lecture_time, 
     insert into lecture (id, uid, lecture_time, 
       create_time, last_update_time, name, 
       create_time, last_update_time, name, 
-      summary, deleted_sign, lecture_url, hot, dynamic)
+      summary, deleted_sign, lecture_url, hot, dynamic, end_time)
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{lectureTime,jdbcType=TIMESTAMP}, 
     values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{lectureTime,jdbcType=TIMESTAMP}, 
       #{createTime,jdbcType=TIMESTAMP}, #{lastUpdateTime,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, 
       #{createTime,jdbcType=TIMESTAMP}, #{lastUpdateTime,jdbcType=TIMESTAMP}, #{name,jdbcType=VARCHAR}, 
       #{summary,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{lectureUrl,jdbcType=VARCHAR},
       #{summary,jdbcType=VARCHAR}, #{deletedSign,jdbcType=INTEGER}, #{lectureUrl,jdbcType=VARCHAR},
-      #{hot,jdbcType=INTEGER}, #{dynamic,jdbcType=INTEGER})
+      #{hot,jdbcType=INTEGER}, #{dynamic,jdbcType=INTEGER}, #{endTime,jdbcType=TIMESTAMP})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Lecture" >
   <insert id="insertSelective" parameterType="com.goafanti.common.model.Lecture" >
     insert into lecture
     insert into lecture
@@ -73,6 +74,9 @@
       <if test="dynamic != null" >
       <if test="dynamic != null" >
         dynamic,
         dynamic,
       </if>
       </if>
+      <if test="endTime != null" >
+        end_time,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="id != null" >
       <if test="id != null" >
@@ -108,6 +112,9 @@
       <if test="dynamic != null" >
       <if test="dynamic != null" >
         #{dynamic,jdbcType=INTEGER},
         #{dynamic,jdbcType=INTEGER},
       </if>
       </if>
+       <if test="endTime != null" >
+        #{endTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Lecture" >
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.Lecture" >
@@ -143,6 +150,9 @@
       <if test="dynamic != null" >
       <if test="dynamic != null" >
         dynamic = #{dynamic,jdbcType=INTEGER},
         dynamic = #{dynamic,jdbcType=INTEGER},
       </if>
       </if>
+      <if test="endTime != null" >
+        end_time = #{endTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     </set>
     where id = #{id,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   </update>
@@ -157,7 +167,8 @@
       deleted_sign = #{deletedSign,jdbcType=INTEGER},
       deleted_sign = #{deletedSign,jdbcType=INTEGER},
       lecture_url = #{lectureUrl,jdbcType=VARCHAR},
       lecture_url = #{lectureUrl,jdbcType=VARCHAR},
       hot = #{hot,jdbcType=INTEGER},
       hot = #{hot,jdbcType=INTEGER},
-      dynamic = #{dynamic,jdbcType=INTEGER}
+      dynamic = #{dynamic,jdbcType=INTEGER},
+      end_time = #{endTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=VARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
   </update>
   
   
@@ -180,7 +191,8 @@
 	  		l.lecture_url as lectureUrl,
 	  		l.lecture_url as lectureUrl,
 	  		ui.username,
 	  		ui.username,
 	  		l.hot,
 	  		l.hot,
-	  		l.dynamic
+	  		l.dynamic,
+	  		l.end_time as endTime
 	  	from lecture l
 	  	from lecture l
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	where 
 	  	where 
@@ -256,7 +268,8 @@
 	  		l.lecture_url as lectureUrl,
 	  		l.lecture_url as lectureUrl,
 	  		ui.username,
 	  		ui.username,
 	  		l.hot,
 	  		l.hot,
-	  		l.dynamic
+	  		l.dynamic,
+	  		l.end_time as endTime
 	  	from lecture l
 	  	from lecture l
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	where 
 	  	where 
@@ -274,7 +287,8 @@
 	  		l.lecture_url as lectureUrl,
 	  		l.lecture_url as lectureUrl,
 	  		ui.username,
 	  		ui.username,
 	  		l.hot,
 	  		l.hot,
-	  		l.dynamic
+	  		l.dynamic,
+	  		l.end_time as endTime
 	  	from lecture l
 	  	from lecture l
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	where 
 	  	where 
@@ -290,7 +304,8 @@
 	  		l.lecture_time as lectureTime,
 	  		l.lecture_time as lectureTime,
 	  		l.summary,
 	  		l.summary,
 	  		l.lecture_url as lectureUrl,
 	  		l.lecture_url as lectureUrl,
-	  		ui.username 
+	  		ui.username,
+	  		l.end_time as endTime
 	  	from lecture l
 	  	from lecture l
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	where 
 	  	where 

+ 27 - 2
src/main/java/com/goafanti/common/model/Lecture.java

@@ -49,17 +49,22 @@ public class Lecture {
 	 * 展示图URL
 	 * 展示图URL
 	 */
 	 */
 	private String	lectureUrl;
 	private String	lectureUrl;
-	
+
 	/**
 	/**
 	 * 是否在大咖页面展示
 	 * 是否在大咖页面展示
 	 */
 	 */
 	private Integer	hot;
 	private Integer	hot;
-	
+
 	/**
 	/**
 	 * 是否在科技明星动态展示
 	 * 是否在科技明星动态展示
 	 */
 	 */
 	private Integer	dynamic;
 	private Integer	dynamic;
 
 
+	/**
+	 * 讲堂结束时间
+	 */
+	private Date	endTime;
+
 	public String getId() {
 	public String getId() {
 		return id;
 		return id;
 	}
 	}
@@ -151,6 +156,14 @@ public class Lecture {
 		this.dynamic = dynamic;
 		this.dynamic = dynamic;
 	}
 	}
 
 
+	public Date getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(Date endTime) {
+		this.endTime = endTime;
+	}
+
 	public String getLectureTimeFormattedDate() {
 	public String getLectureTimeFormattedDate() {
 		if (this.lectureTime == null) {
 		if (this.lectureTime == null) {
 			return null;
 			return null;
@@ -162,4 +175,16 @@ public class Lecture {
 	public void setLectureTimeFormattedDate(String lectureTimeFormattedDate) {
 	public void setLectureTimeFormattedDate(String lectureTimeFormattedDate) {
 
 
 	}
 	}
+
+	public String getEndTimeFormattedDate() {
+		if (this.endTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.endTime, AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+
+	public void setEndTimeFormattedDate(String endTimeFormattedDate) {
+
+	}
 }
 }