Преглед на файлове

首页、新闻详情页待调整

anderx преди 3 години
родител
ревизия
78b546664d

+ 23 - 0
.idea/free-mybatis-generator-config.xml

@@ -26,6 +26,29 @@
             </Config>
           </value>
         </entry>
+        <entry key="news">
+          <value>
+            <Config>
+              <option name="comment" value="true" />
+              <option name="daoMvnPath" value="src/main/java" />
+              <option name="daoName" value="NewsMapper" />
+              <option name="daoPackage" value="com.kede.common.dao" />
+              <option name="daoPostfix" value="Mapper" />
+              <option name="modelMvnPath" value="src/main/java" />
+              <option name="modelName" value="News" />
+              <option name="modelPackage" value="com.kede.common.model" />
+              <option name="name" value="news" />
+              <option name="overrideJava" value="true" />
+              <option name="overrideXML" value="true" />
+              <option name="primaryKey" value="" />
+              <option name="projectFolder" value="$PROJECT_DIR$" />
+              <option name="tableName" value="news" />
+              <option name="useSchemaPrefix" value="true" />
+              <option name="xmlMvnPath" value="src/main/java" />
+              <option name="xmlPackage" value="com.kede.common.mapper" />
+            </Config>
+          </value>
+        </entry>
         <entry key="popular_cities">
           <value>
             <Config>

+ 13 - 8
src/main/java/com/kede/common/controller/WebpageController.java

@@ -399,20 +399,25 @@ public class WebpageController extends BaseController {
 		}
 		modelview.addObject("gs1", gs1);
 		modelview.addObject("gs2", gs2);
-		in.setType(1);
-		List<OutNews>hy=(List<OutNews>) newsService.listnewsDetails(in, 4, 1).getList();
-		for (OutNews o : hy) {
-			o.setReleaseTimeConvert(DateUtils.formatDate(o.getReleaseTime(), AFTConstants.MMDD));
-			o.setContent(displayRestriction(o.getContent()));
-		}
-		modelview.addObject("hy", hy);
+		//类型 0公司新闻 1行业新闻 2高新技术企业 3军工三证
+		modelview.addObject("hyxw", getNews(1));
+		modelview.addObject("gxjs", getNews(2));
+		modelview.addObject("jgsz", getNews(3));
 		//获取战略合作16个
 		InputOrganization ir=new InputOrganization(1,1);
 		modelview.addObject("orgList1", organizationService.listOrganization(ir, 8, 1).getList());
 		modelview.addObject("orgList2", organizationService.listOrganization(ir, 8, 2).getList());
 		return modelview;
 	}
-
+	public List<OutNews> getNews(Integer type){
+		InputNews in=new InputNews(type,1,1);
+		List<OutNews>list=(List<OutNews>) newsService.listnewsDetails(in, 4, 1).getList();
+		for (OutNews o : list) {
+			o.setReleaseTimeConvert(DateUtils.formatDate(o.getReleaseTime(), AFTConstants.MMDD));
+			o.setContent(displayRestriction(o.getContent()));
+		}
+		return  list;
+	}
 
 	public String displayRestriction(String str) {
 		//去除HTML标签

+ 8 - 82
src/main/java/com/kede/common/dao/NewsMapper.java

@@ -1,97 +1,23 @@
 package com.kede.common.dao;
 
 import com.kede.common.model.News;
-import com.kede.common.model.NewsExample;
 import com.kede.news.bo.OutNews;
 
 import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 public interface NewsMapper {
+    int deleteByPrimaryKey(Integer id);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	long countByExample(NewsExample example);
+    int insert(News record);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int deleteByExample(NewsExample example);
+    int insertSelective(News record);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int deleteByPrimaryKey(Integer id);
+    News selectByPrimaryKey(Integer id);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int insert(News record);
+    int updateByPrimaryKeySelective(News record);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int insertSelective(News record);
+    int updateByPrimaryKey(News record);
 
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	List<News> selectByExampleWithBLOBs(NewsExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	List<News> selectByExample(NewsExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	News selectByPrimaryKey(Integer id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int updateByExampleSelective(@Param("record") News record, @Param("example") NewsExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int updateByExampleWithBLOBs(@Param("record") News record, @Param("example") NewsExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int updateByExample(@Param("record") News record, @Param("example") NewsExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int updateByPrimaryKeySelective(News record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int updateByPrimaryKeyWithBLOBs(News record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table news
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	int updateByPrimaryKey(News record);
-
-	OutNews selectByid(Integer id);
-}
+    OutNews selectByid(Integer id);
+}

+ 47 - 328
src/main/java/com/kede/common/mapper/NewsMapper.xml

@@ -2,11 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.kede.common.dao.NewsMapper">
   <resultMap id="BaseResultMap" type="com.kede.common.model.News">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="publisher" jdbcType="VARCHAR" property="publisher" />
@@ -14,197 +9,39 @@
     <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="sort" jdbcType="INTEGER" property="sort" />
+    <result column="content" jdbcType="VARCHAR" property="content" />
     <result column="release_status" jdbcType="INTEGER" property="releaseStatus" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" />
+    <result column="keywords" jdbcType="VARCHAR" property="keywords" />
   </resultMap>
-  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.kede.common.model.News">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    <result column="content" jdbcType="LONGVARCHAR" property="content" />
-  </resultMap>
-  <sql id="Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    <where>
-      <foreach collection="oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
-  <sql id="Update_By_Example_Where_Clause">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    <where>
-      <foreach collection="example.oredCriteria" item="criteria" separator="or">
-        <if test="criteria.valid">
-          <trim prefix="(" prefixOverrides="and" suffix=")">
-            <foreach collection="criteria.criteria" item="criterion">
-              <choose>
-                <when test="criterion.noValue">
-                  and ${criterion.condition}
-                </when>
-                <when test="criterion.singleValue">
-                  and ${criterion.condition} #{criterion.value}
-                </when>
-                <when test="criterion.betweenValue">
-                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
-                </when>
-                <when test="criterion.listValue">
-                  and ${criterion.condition}
-                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
-                    #{listItem}
-                  </foreach>
-                </when>
-              </choose>
-            </foreach>
-          </trim>
-        </if>
-      </foreach>
-    </where>
-  </sql>
   <sql id="Base_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    id, title, publisher, type, picture_url, status, sort, release_status, create_time, 
-    release_time
+    id, title, publisher, `type`, picture_url, `status`, sort, content, release_status,
+    create_time, release_time, keywords
   </sql>
-  <sql id="Blob_Column_List">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    content
-  </sql>
-  <select id="selectByExampleWithBLOBs" parameterType="com.kede.common.model.NewsExample" resultMap="ResultMapWithBLOBs">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    ,
-    <include refid="Blob_Column_List" />
-    from news
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
-  <select id="selectByExample" parameterType="com.kede.common.model.NewsExample" resultMap="BaseResultMap">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    select
-    <if test="distinct">
-      distinct
-    </if>
-    <include refid="Base_Column_List" />
-    from news
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-    <if test="orderByClause != null">
-      order by ${orderByClause}
-    </if>
-  </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    select 
     <include refid="Base_Column_List" />
-    ,
-    <include refid="Blob_Column_List" />
     from news
     where id = #{id,jdbcType=INTEGER}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
     delete from news
     where id = #{id,jdbcType=INTEGER}
   </delete>
-  <delete id="deleteByExample" parameterType="com.kede.common.model.NewsExample">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    delete from news
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </delete>
   <insert id="insert" parameterType="com.kede.common.model.News">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    insert into news (id, title, publisher, 
-      type, picture_url, status, 
-      sort, release_status, create_time, 
-      release_time, content)
-    values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{publisher,jdbcType=VARCHAR}, 
-      #{type,jdbcType=INTEGER}, #{pictureUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
-      #{sort,jdbcType=INTEGER}, #{releaseStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{releaseTime,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR})
+    insert into news (id, title, publisher,
+      `type`, picture_url, `status`,
+      sort, content, release_status,
+      create_time, release_time, keywords
+      )
+    values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{publisher,jdbcType=VARCHAR},
+      #{type,jdbcType=INTEGER}, #{pictureUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
+      #{sort,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{releaseStatus,jdbcType=INTEGER},
+      #{createTime,jdbcType=TIMESTAMP}, #{releaseTime,jdbcType=TIMESTAMP}, #{keywords,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.kede.common.model.News">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
     insert into news
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -217,17 +54,20 @@
         publisher,
       </if>
       <if test="type != null">
-        type,
+        `type`,
       </if>
       <if test="pictureUrl != null">
         picture_url,
       </if>
       <if test="status != null">
-        status,
+        `status`,
       </if>
       <if test="sort != null">
         sort,
       </if>
+      <if test="content != null">
+        content,
+      </if>
       <if test="releaseStatus != null">
         release_status,
       </if>
@@ -237,8 +77,8 @@
       <if test="releaseTime != null">
         release_time,
       </if>
-      <if test="content != null">
-        content,
+      <if test="keywords != null">
+        keywords,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -263,6 +103,9 @@
       <if test="sort != null">
         #{sort,jdbcType=INTEGER},
       </if>
+      <if test="content != null">
+        #{content,jdbcType=VARCHAR},
+      </if>
       <if test="releaseStatus != null">
         #{releaseStatus,jdbcType=INTEGER},
       </if>
@@ -272,117 +115,12 @@
       <if test="releaseTime != null">
         #{releaseTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="content != null">
-        #{content,jdbcType=LONGVARCHAR},
+      <if test="keywords != null">
+        #{keywords,jdbcType=VARCHAR},
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.kede.common.model.NewsExample" resultType="java.lang.Long">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    select count(*) from news
-    <if test="_parameter != null">
-      <include refid="Example_Where_Clause" />
-    </if>
-  </select>
-  <update id="updateByExampleSelective" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    update news
-    <set>
-      <if test="record.id != null">
-        id = #{record.id,jdbcType=INTEGER},
-      </if>
-      <if test="record.title != null">
-        title = #{record.title,jdbcType=VARCHAR},
-      </if>
-      <if test="record.publisher != null">
-        publisher = #{record.publisher,jdbcType=VARCHAR},
-      </if>
-      <if test="record.type != null">
-        type = #{record.type,jdbcType=INTEGER},
-      </if>
-      <if test="record.pictureUrl != null">
-        picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
-      </if>
-      <if test="record.status != null">
-        status = #{record.status,jdbcType=INTEGER},
-      </if>
-      <if test="record.sort != null">
-        sort = #{record.sort,jdbcType=INTEGER},
-      </if>
-      <if test="record.releaseStatus != null">
-        release_status = #{record.releaseStatus,jdbcType=INTEGER},
-      </if>
-      <if test="record.createTime != null">
-        create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.releaseTime != null">
-        release_time = #{record.releaseTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="record.content != null">
-        content = #{record.content,jdbcType=LONGVARCHAR},
-      </if>
-    </set>
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExampleWithBLOBs" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    update news
-    set id = #{record.id,jdbcType=INTEGER},
-      title = #{record.title,jdbcType=VARCHAR},
-      publisher = #{record.publisher,jdbcType=VARCHAR},
-      type = #{record.type,jdbcType=INTEGER},
-      picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
-      status = #{record.status,jdbcType=INTEGER},
-      sort = #{record.sort,jdbcType=INTEGER},
-      release_status = #{record.releaseStatus,jdbcType=INTEGER},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      release_time = #{record.releaseTime,jdbcType=TIMESTAMP},
-      content = #{record.content,jdbcType=LONGVARCHAR}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
-  <update id="updateByExample" parameterType="map">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    update news
-    set id = #{record.id,jdbcType=INTEGER},
-      title = #{record.title,jdbcType=VARCHAR},
-      publisher = #{record.publisher,jdbcType=VARCHAR},
-      type = #{record.type,jdbcType=INTEGER},
-      picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
-      status = #{record.status,jdbcType=INTEGER},
-      sort = #{record.sort,jdbcType=INTEGER},
-      release_status = #{record.releaseStatus,jdbcType=INTEGER},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP},
-      release_time = #{record.releaseTime,jdbcType=TIMESTAMP}
-    <if test="_parameter != null">
-      <include refid="Update_By_Example_Where_Clause" />
-    </if>
-  </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.kede.common.model.News">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
     update news
     <set>
       <if test="title != null">
@@ -392,17 +130,20 @@
         publisher = #{publisher,jdbcType=VARCHAR},
       </if>
       <if test="type != null">
-        type = #{type,jdbcType=INTEGER},
+        `type` = #{type,jdbcType=INTEGER},
       </if>
       <if test="pictureUrl != null">
         picture_url = #{pictureUrl,jdbcType=VARCHAR},
       </if>
       <if test="status != null">
-        status = #{status,jdbcType=INTEGER},
+        `status` = #{status,jdbcType=INTEGER},
       </if>
       <if test="sort != null">
         sort = #{sort,jdbcType=INTEGER},
       </if>
+      <if test="content != null">
+        content = #{content,jdbcType=VARCHAR},
+      </if>
       <if test="releaseStatus != null">
         release_status = #{releaseStatus,jdbcType=INTEGER},
       </if>
@@ -412,66 +153,44 @@
       <if test="releaseTime != null">
         release_time = #{releaseTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="content != null">
-        content = #{content,jdbcType=LONGVARCHAR},
+      <if test="keywords != null">
+        keywords = #{keywords,jdbcType=VARCHAR},
       </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.kede.common.model.News">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
-    update news
-    set title = #{title,jdbcType=VARCHAR},
-      publisher = #{publisher,jdbcType=VARCHAR},
-      type = #{type,jdbcType=INTEGER},
-      picture_url = #{pictureUrl,jdbcType=VARCHAR},
-      status = #{status,jdbcType=INTEGER},
-      sort = #{sort,jdbcType=INTEGER},
-      release_status = #{releaseStatus,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      release_time = #{releaseTime,jdbcType=TIMESTAMP},
-      content = #{content,jdbcType=LONGVARCHAR}
-    where id = #{id,jdbcType=INTEGER}
-  </update>
   <update id="updateByPrimaryKey" parameterType="com.kede.common.model.News">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Wed Dec 25 16:41:04 CST 2019.
-    -->
     update news
     set title = #{title,jdbcType=VARCHAR},
       publisher = #{publisher,jdbcType=VARCHAR},
-      type = #{type,jdbcType=INTEGER},
+      `type` = #{type,jdbcType=INTEGER},
       picture_url = #{pictureUrl,jdbcType=VARCHAR},
-      status = #{status,jdbcType=INTEGER},
+      `status` = #{status,jdbcType=INTEGER},
       sort = #{sort,jdbcType=INTEGER},
+      content = #{content,jdbcType=VARCHAR},
       release_status = #{releaseStatus,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
-      release_time = #{releaseTime,jdbcType=TIMESTAMP}
+      release_time = #{releaseTime,jdbcType=TIMESTAMP},
+      keywords = #{keywords,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
-  
+
   <select id="selectByid" resultType="com.kede.news.bo.OutNews">
    select id, title, publisher, type, picture_url pictureUrl, status, sort, release_status releaseStatus,content,
-  	date_format(create_time,'%Y-%m-%d %H:%i:%S') as createTimeConvert,create_time createTime,  
+  	date_format(create_time,'%Y-%m-%d %H:%i:%S') as createTimeConvert,create_time createTime,
     date_format(release_time,'%Y-%m-%d %H:%i:%S') as releaseTimeConvert ,release_time releaseTime
     from news where id = #{id,jdbcType=INTEGER}
   </select>
   <select id="findNewsList" resultType="com.kede.news.bo.OutNews">
   select id, title, publisher, type, picture_url pictureUrl, status, sort, release_status releaseStatus,content,
-  	date_format(create_time,'%Y-%m-%d %H:%i:%S') as createTimeConvert,create_time createTime,  
+  	date_format(create_time,'%Y-%m-%d %H:%i:%S') as createTimeConvert,create_time createTime,
     date_format(release_time,'%Y-%m-%d %H:%i:%S') as releaseTimeConvert ,release_time releaseTime
     from news where 1=1
      <if test="n.id!=null">
     and id = #{n.id}
     </if>
     <if test="n.title!=null">
-    and title like concat('%',#{n.title},'%') 
+    and title like concat('%',#{n.title},'%')
     </if>
     <if test="n.releaseStatus!=null">
     and release_status = #{n.releaseStatus}
@@ -487,7 +206,7 @@
 			${page_sql}
 	</if>
   </select>
-  
+
   <select id="findNewsCount" resultType="java.lang.Integer">
   select count(*)
     from news where 1=1
@@ -495,7 +214,7 @@
     and id = #{n.id}
     </if>
     <if test="n.title!=null">
-    and title like concat('%',#{n.title},'%') 
+    and title like concat('%',#{n.title},'%')
     </if>
     <if test="n.releaseStatus!=null">
     and release_status = #{n.releaseStatus}
@@ -507,5 +226,5 @@
     and type = #{n.type}
     </if>
   </select>
-  
-</mapper>
+
+</mapper>

+ 160 - 255
src/main/java/com/kede/common/model/News.java

@@ -1,260 +1,165 @@
 package com.kede.common.model;
 
+import java.io.Serializable;
 import java.util.Date;
 
-public class News {
-
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.id
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private Integer id;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.title
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private String title;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.publisher
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private String publisher;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.type
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private Integer type;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.picture_url
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private String pictureUrl;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.status
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private Integer status;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.sort
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private Integer sort;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.release_status
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private Integer releaseStatus;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.create_time
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private Date createTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.release_time
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private Date releaseTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column news.content
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	private String content;
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.id
-	 * @return  the value of news.id
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public Integer getId() {
-		return id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.id
-	 * @param id  the value for news.id
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setId(Integer id) {
-		this.id = id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.title
-	 * @return  the value of news.title
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public String getTitle() {
-		return title;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.title
-	 * @param title  the value for news.title
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setTitle(String title) {
-		this.title = title;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.publisher
-	 * @return  the value of news.publisher
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public String getPublisher() {
-		return publisher;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.publisher
-	 * @param publisher  the value for news.publisher
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setPublisher(String publisher) {
-		this.publisher = publisher;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.type
-	 * @return  the value of news.type
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public Integer getType() {
-		return type;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.type
-	 * @param type  the value for news.type
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setType(Integer type) {
-		this.type = type;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.picture_url
-	 * @return  the value of news.picture_url
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public String getPictureUrl() {
-		return pictureUrl;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.picture_url
-	 * @param pictureUrl  the value for news.picture_url
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setPictureUrl(String pictureUrl) {
-		this.pictureUrl = pictureUrl;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.status
-	 * @return  the value of news.status
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public Integer getStatus() {
-		return status;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.status
-	 * @param status  the value for news.status
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setStatus(Integer status) {
-		this.status = status;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.sort
-	 * @return  the value of news.sort
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public Integer getSort() {
-		return sort;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.sort
-	 * @param sort  the value for news.sort
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setSort(Integer sort) {
-		this.sort = sort;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.release_status
-	 * @return  the value of news.release_status
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public Integer getReleaseStatus() {
-		return releaseStatus;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.release_status
-	 * @param releaseStatus  the value for news.release_status
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setReleaseStatus(Integer releaseStatus) {
-		this.releaseStatus = releaseStatus;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.create_time
-	 * @return  the value of news.create_time
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.create_time
-	 * @param createTime  the value for news.create_time
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.release_time
-	 * @return  the value of news.release_time
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public Date getReleaseTime() {
-		return releaseTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.release_time
-	 * @param releaseTime  the value for news.release_time
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setReleaseTime(Date releaseTime) {
-		this.releaseTime = releaseTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column news.content
-	 * @return  the value of news.content
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public String getContent() {
-		return content;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column news.content
-	 * @param content  the value for news.content
-	 * @mbg.generated  Wed Dec 25 16:41:04 CST 2019
-	 */
-	public void setContent(String content) {
-		this.content = content;
-	}
+/**
+ * news
+ * @author 
+ */
+public class News implements Serializable {
+    private Integer id;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 发布人
+     */
+    private String publisher;
+
+    /**
+     * 类型 0公司新闻 1行业新闻 2高新技术企业 3军工三证
+     */
+    private Integer type;
+
+    /**
+     * 图片url
+     */
+    private String pictureUrl;
+
+    /**
+     * 状态 0正常 1首页
+     */
+    private Integer status;
+
+    /**
+     * 排序
+     */
+    private Integer sort;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 发布状态 0否 1是
+     */
+    private Integer releaseStatus;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 发布时间
+     */
+    private Date releaseTime;
+
+    /**
+     * 关键字
+     */
+    private String keywords;
+
+    private static final long serialVersionUID = 1L;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getPublisher() {
+        return publisher;
+    }
+
+    public void setPublisher(String publisher) {
+        this.publisher = publisher;
+    }
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getPictureUrl() {
+        return pictureUrl;
+    }
+
+    public void setPictureUrl(String pictureUrl) {
+        this.pictureUrl = pictureUrl;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getSort() {
+        return sort;
+    }
+
+    public void setSort(Integer sort) {
+        this.sort = sort;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Integer getReleaseStatus() {
+        return releaseStatus;
+    }
+
+    public void setReleaseStatus(Integer releaseStatus) {
+        this.releaseStatus = releaseStatus;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getReleaseTime() {
+        return releaseTime;
+    }
+
+    public void setReleaseTime(Date releaseTime) {
+        this.releaseTime = releaseTime;
+    }
+
+    public String getKeywords() {
+        return keywords;
+    }
+
+    public void setKeywords(String keywords) {
+        this.keywords = keywords;
+    }
 }

+ 1 - 1
src/main/java/com/kede/core/shiro/session/CustomSessionManager.java

@@ -34,7 +34,7 @@ public class CustomSessionManager extends DefaultWebSessionManager {
 		System.out.println("请求 token=============="+sid);
 		if (StringUtils.isNotBlank(sid)) {
 			// 是否将sid保存到cookie,浏览器模式下使用此参数。
-			if (WebUtils.isTrue(request, "AFT_SID")) {
+			if (WebUtils.isTrue(request, "KEDE_SID")) {
 				HttpServletRequest rq = (HttpServletRequest) request;
 				HttpServletResponse rs = (HttpServletResponse) response;
 				Cookie template = getSessionIdCookie();

+ 1 - 1
src/main/resources/spring/spring-shiro.xml

@@ -48,7 +48,7 @@
 		class="org.apache.shiro.session.mgt.eis.JavaUuidSessionIdGenerator" />
 
 	<bean id="sessionIdCookie" class="org.apache.shiro.web.servlet.SimpleCookie">
-		<constructor-arg value="AFT_SID" />
+		<constructor-arg value="KEDE_SID" />
 		<property name="httpOnly" value="true" />
 		<property name="maxAge" value="2592000" />
 		<!-- <property name="domain" value=""/> -->

+ 7 - 7
src/main/webapp/WEB-INF/views/portal/index.html

@@ -616,8 +616,8 @@
                         <div class="news-fenlei">
                             <span class="active">公司新闻</span>
                             <span>行业新闻</span>
-                            <span>3</span>
-                            <span>4</span>
+                            <span>高新技术企业</span>
+                            <span>军工三证</span>
                         </div>
                         <!-- 公司新闻 -->
                         <ul class="active news-list-it">
@@ -638,7 +638,7 @@
                         </ul>
                         <!-- 行业新闻 -->
                         <ul class="news-list-it">
-                            <li th:each="y:${hy}">
+                            <li th:each="y:${hyxw}">
                                 <a th:href="${'/news/'+y.id}" target="_blank" >
                                     <div class="newsitem">
                                         <span class="time" th:text="${y.releaseTimeConvert}">11-07</span>
@@ -652,9 +652,9 @@
                                 </a>
                             </li>
                         </ul>
-                        <!-- 3 -->
+                        <!-- 高新技术企业 -->
                         <ul class="news-list-it">
-                            <li th:each="y:${hy}">
+                            <li th:each="y:${gxjs}">
                                 <a th:href="${'/news/'+y.id}" target="_blank" >
                                     <div class="newsitem">
                                         <span class="time" th:text="${y.releaseTimeConvert}">11-07</span>
@@ -668,9 +668,9 @@
                                 </a>
                             </li>
                         </ul>
-                        <!-- 4 -->
+                        <!-- 军工三证 -->
                         <ul class="news-list-it">
-                            <li th:each="y:${hy}">
+                            <li th:each="y:${jgsz}">
                                 <a th:href="${'/news/'+y.id}" target="_blank" >
                                     <div class="newsitem">
                                         <span class="time" th:text="${y.releaseTimeConvert}">11-07</span>