Commit 455cb0868028d4935d455eaea8d2d4e9f824e404
1 parent
2cd8327b
Exists in
master
bug 修复
Showing
8 changed files
with
96 additions
and
17 deletions
Show diff stats
src/main/java/com/sincere/student/model/Article.java
@@ -15,6 +15,8 @@ public class Article { | @@ -15,6 +15,8 @@ public class Article { | ||
15 | private String title ; | 15 | private String title ; |
16 | @ApiModelProperty(value = "栏目 type=1 不用传") | 16 | @ApiModelProperty(value = "栏目 type=1 不用传") |
17 | private int columnType ; | 17 | private int columnType ; |
18 | + @ApiModelProperty(value = "栏目中文") | ||
19 | + private String columnTypeString ; | ||
18 | @ApiModelProperty(value = "必传 大学id") | 20 | @ApiModelProperty(value = "必传 大学id") |
19 | private int universityId ; | 21 | private int universityId ; |
20 | @ApiModelProperty(value = "必传 排序") | 22 | @ApiModelProperty(value = "必传 排序") |
@@ -44,6 +46,14 @@ public class Article { | @@ -44,6 +46,14 @@ public class Article { | ||
44 | @ApiModelProperty(value = "状态 0预览1发布") | 46 | @ApiModelProperty(value = "状态 0预览1发布") |
45 | private int status ; | 47 | private int status ; |
46 | 48 | ||
49 | + public String getColumnTypeString() { | ||
50 | + return columnTypeString; | ||
51 | + } | ||
52 | + | ||
53 | + public void setColumnTypeString(String columnTypeString) { | ||
54 | + this.columnTypeString = columnTypeString; | ||
55 | + } | ||
56 | + | ||
47 | public List<String> getImageUrlList() { | 57 | public List<String> getImageUrlList() { |
48 | return imageUrlList; | 58 | return imageUrlList; |
49 | } | 59 | } |
src/main/java/com/sincere/student/model/Consult.java
@@ -37,6 +37,16 @@ public class Consult { | @@ -37,6 +37,16 @@ public class Consult { | ||
37 | private Integer status; | 37 | private Integer status; |
38 | @ApiModelProperty(value = "4个栏目") | 38 | @ApiModelProperty(value = "4个栏目") |
39 | private List<UniversityConsultDetail> list ; | 39 | private List<UniversityConsultDetail> list ; |
40 | + @ApiModelProperty(value = "阅读量") | ||
41 | + private int readNumber; | ||
42 | + | ||
43 | + public int getReadNumber() { | ||
44 | + return readNumber; | ||
45 | + } | ||
46 | + | ||
47 | + public void setReadNumber(int readNumber) { | ||
48 | + this.readNumber = readNumber; | ||
49 | + } | ||
40 | 50 | ||
41 | public List<String> getVideoUrlList() { | 51 | public List<String> getVideoUrlList() { |
42 | return videoUrlList; | 52 | return videoUrlList; |
src/main/java/com/sincere/student/model/UniversityConsult.java
@@ -28,6 +28,25 @@ public class UniversityConsult { | @@ -28,6 +28,25 @@ public class UniversityConsult { | ||
28 | private List<UniversityConsultDetail> list; | 28 | private List<UniversityConsultDetail> list; |
29 | @ApiModelProperty(value = "状态 0预览1发布") | 29 | @ApiModelProperty(value = "状态 0预览1发布") |
30 | private int status ; | 30 | private int status ; |
31 | + private int readNumber ; | ||
32 | + @ApiModelProperty(value = "栏目中文") | ||
33 | + private String columnTypeString ; | ||
34 | + | ||
35 | + public int getReadNumber() { | ||
36 | + return readNumber; | ||
37 | + } | ||
38 | + | ||
39 | + public void setReadNumber(int readNumber) { | ||
40 | + this.readNumber = readNumber; | ||
41 | + } | ||
42 | + | ||
43 | + public String getColumnTypeString() { | ||
44 | + return columnTypeString; | ||
45 | + } | ||
46 | + | ||
47 | + public void setColumnTypeString(String columnTypeString) { | ||
48 | + this.columnTypeString = columnTypeString; | ||
49 | + } | ||
31 | 50 | ||
32 | public int getStatus() { | 51 | public int getStatus() { |
33 | return status; | 52 | return status; |
src/main/java/com/sincere/student/model/Video.java
@@ -15,6 +15,8 @@ public class Video { | @@ -15,6 +15,8 @@ public class Video { | ||
15 | private int universityId ; | 15 | private int universityId ; |
16 | @ApiModelProperty(value = "栏目") | 16 | @ApiModelProperty(value = "栏目") |
17 | private int columnType ; | 17 | private int columnType ; |
18 | + @ApiModelProperty(value = "栏目中文") | ||
19 | + private String columnTypeString ; | ||
18 | @ApiModelProperty(value = "视频路径") | 20 | @ApiModelProperty(value = "视频路径") |
19 | private String videoUrl ; | 21 | private String videoUrl ; |
20 | 22 | ||
@@ -38,6 +40,24 @@ public class Video { | @@ -38,6 +40,24 @@ public class Video { | ||
38 | private String videoName ; | 40 | private String videoName ; |
39 | @ApiModelProperty(value = "视频封面") | 41 | @ApiModelProperty(value = "视频封面") |
40 | private String coverUrl ; | 42 | private String coverUrl ; |
43 | + @ApiModelProperty(value = "阅读量") | ||
44 | + private int readNumber ; | ||
45 | + | ||
46 | + public String getColumnTypeString() { | ||
47 | + return columnTypeString; | ||
48 | + } | ||
49 | + | ||
50 | + public void setColumnTypeString(String columnTypeString) { | ||
51 | + this.columnTypeString = columnTypeString; | ||
52 | + } | ||
53 | + | ||
54 | + public int getReadNumber() { | ||
55 | + return readNumber; | ||
56 | + } | ||
57 | + | ||
58 | + public void setReadNumber(int readNumber) { | ||
59 | + this.readNumber = readNumber; | ||
60 | + } | ||
41 | 61 | ||
42 | public List<String> getVideoUrlList() { | 62 | public List<String> getVideoUrlList() { |
43 | return videoUrlList; | 63 | return videoUrlList; |
src/main/resources/application.yaml
@@ -5,9 +5,9 @@ spring: | @@ -5,9 +5,9 @@ spring: | ||
5 | application: | 5 | application: |
6 | name: student | 6 | name: student |
7 | datasource: | 7 | datasource: |
8 | - username: SZJXTUSER | ||
9 | - password: xst200919 | ||
10 | - url: jdbc:sqlserver://60.190.202.57:14333;database=consultative | 8 | + username: recruitS |
9 | + password: QWer123$%^ | ||
10 | + url: jdbc:sqlserver://47.110.50.251:33419;database=consultative | ||
11 | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | 11 | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
12 | # cache: | 12 | # cache: |
13 | # type: redis | 13 | # type: redis |
src/main/resources/mapper/ArticleMapper.xml
@@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
18 | <result column="create_time" property="createTime"/> | 18 | <result column="create_time" property="createTime"/> |
19 | <result column="type" property="type"/> | 19 | <result column="type" property="type"/> |
20 | <result column="status" property="status" /> | 20 | <result column="status" property="status" /> |
21 | + <result column="columnTypeString" property="columnTypeString" /> | ||
21 | </resultMap> | 22 | </resultMap> |
22 | 23 | ||
23 | 24 | ||
@@ -43,7 +44,7 @@ | @@ -43,7 +44,7 @@ | ||
43 | </select> | 44 | </select> |
44 | 45 | ||
45 | <select id="getList" parameterType="com.sincere.student.dto.ArticleSearchDto" resultMap="ArticleMap"> | 46 | <select id="getList" parameterType="com.sincere.student.dto.ArticleSearchDto" resultMap="ArticleMap"> |
46 | - select * from university_article | 47 | + select university_article.* , university_column_type.name as columnTypeString from university_article left join university_column_type on university_article.column_type = university_column_type.id |
47 | <where> | 48 | <where> |
48 | <if test="title != null and title != ''"> | 49 | <if test="title != null and title != ''"> |
49 | and title like #{title} | 50 | and title like #{title} |
@@ -61,7 +62,7 @@ | @@ -61,7 +62,7 @@ | ||
61 | and 1 = 1 | 62 | and 1 = 1 |
62 | </if> | 63 | </if> |
63 | </where> | 64 | </where> |
64 | - order by sort | 65 | + order by university_article.sort |
65 | </select> | 66 | </select> |
66 | 67 | ||
67 | <select id="getAdvert" resultMap="ArticleMap"> | 68 | <select id="getAdvert" resultMap="ArticleMap"> |
src/main/resources/mapper/UniversityConsultMapper.xml
@@ -11,6 +11,8 @@ | @@ -11,6 +11,8 @@ | ||
11 | <result column="sort" property="sort" /> | 11 | <result column="sort" property="sort" /> |
12 | <result column="img_url" property="imgUrl" /> | 12 | <result column="img_url" property="imgUrl" /> |
13 | <result column="status" property="status" /> | 13 | <result column="status" property="status" /> |
14 | + <result column="read_number" property="readNumber" /> | ||
15 | + <result column="columnTypeString" property="columnTypeString" /> | ||
14 | </resultMap> | 16 | </resultMap> |
15 | 17 | ||
16 | <select id="getListCount" parameterType="com.sincere.student.dto.ConsultSearchDto" resultType="java.lang.Integer"> | 18 | <select id="getListCount" parameterType="com.sincere.student.dto.ConsultSearchDto" resultType="java.lang.Integer"> |
@@ -50,7 +52,7 @@ | @@ -50,7 +52,7 @@ | ||
50 | </select> | 52 | </select> |
51 | 53 | ||
52 | <select id="getList" parameterType="com.sincere.student.dto.ConsultSearchDto" resultMap="ListMap"> | 54 | <select id="getList" parameterType="com.sincere.student.dto.ConsultSearchDto" resultMap="ListMap"> |
53 | - select DISTINCT c.id , c.column_type , info.id as universityId , c.img_url ,c.sort , info.name , info.code ,c.status from university_consult c | 55 | + select DISTINCT c.id , c.column_type , info.id as universityId ,c.read_number , c.img_url ,c.sort , info.name , info.code ,c.status from university_consult c |
54 | join university_info info on c.university_id = info.id | 56 | join university_info info on c.university_id = info.id |
55 | left join university_relate_major r on info.id = r.university_id | 57 | left join university_relate_major r on info.id = r.university_id |
56 | left join university_major m on m.id = r.major_id | 58 | left join university_major m on m.id = r.major_id |
@@ -98,8 +100,9 @@ | @@ -98,8 +100,9 @@ | ||
98 | </select> | 100 | </select> |
99 | 101 | ||
100 | <select id="getColumnList" parameterType="java.lang.Integer" resultMap="ListMap"> | 102 | <select id="getColumnList" parameterType="java.lang.Integer" resultMap="ListMap"> |
101 | - select DISTINCT c.id , info.id as universityId , c.img_url ,c.sort , info.name , info.code from university_consult c | 103 | + select DISTINCT c.id , info.id as universityId , c.img_url ,c.read_number ,c.sort , info.name , info.code ,university_column_type.name as columnTypeString from university_consult c |
102 | join university_info info on c.university_id = info.id | 104 | join university_info info on c.university_id = info.id |
105 | + left join university_column_type on c.column_type = university_column_type.id | ||
103 | where c.column_type = #{columnType} and c.status = 1 | 106 | where c.column_type = #{columnType} and c.status = 1 |
104 | order by c.sort | 107 | order by c.sort |
105 | </select> | 108 | </select> |
@@ -129,10 +132,10 @@ | @@ -129,10 +132,10 @@ | ||
129 | <insert id="insert" parameterType="com.sincere.student.model.UniversityConsult" useGeneratedKeys="true" keyProperty="id"> | 132 | <insert id="insert" parameterType="com.sincere.student.model.UniversityConsult" useGeneratedKeys="true" keyProperty="id"> |
130 | insert into university_consult (university_id, column_type, | 133 | insert into university_consult (university_id, column_type, |
131 | video_url, context, img_url, | 134 | video_url, context, img_url, |
132 | - create_time, sort,status) | 135 | + create_time, sort,status,read_number) |
133 | values (#{universityId,jdbcType=INTEGER}, #{columnType,jdbcType=INTEGER}, | 136 | values (#{universityId,jdbcType=INTEGER}, #{columnType,jdbcType=INTEGER}, |
134 | #{videoUrl,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, | 137 | #{videoUrl,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, |
135 | - GETDATE(), #{sort,jdbcType=INTEGER},#{status}) | 138 | + GETDATE(), #{sort,jdbcType=INTEGER},#{status},#{readNumber}) |
136 | </insert> | 139 | </insert> |
137 | 140 | ||
138 | <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.UniversityConsult"> | 141 | <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.UniversityConsult"> |
@@ -162,6 +165,9 @@ | @@ -162,6 +165,9 @@ | ||
162 | <if test="status != null"> | 165 | <if test="status != null"> |
163 | status = #{status}, | 166 | status = #{status}, |
164 | </if> | 167 | </if> |
168 | + <if test="readNumber != 0"> | ||
169 | + read_number = #{readNumber}, | ||
170 | + </if> | ||
165 | </set> | 171 | </set> |
166 | where id = #{id,jdbcType=INTEGER} | 172 | where id = #{id,jdbcType=INTEGER} |
167 | </update> | 173 | </update> |
src/main/resources/mapper/VideoMapper.xml
@@ -16,6 +16,9 @@ | @@ -16,6 +16,9 @@ | ||
16 | <result column="duration" property="duration" /> | 16 | <result column="duration" property="duration" /> |
17 | <result column="cover_url" property="coverUrl" /> | 17 | <result column="cover_url" property="coverUrl" /> |
18 | <result column="video_name" property="videoName" /> | 18 | <result column="video_name" property="videoName" /> |
19 | + <result column="read_number" property="readNumber" /> | ||
20 | + <result column="columnTypeString" property="columnTypeString" /> | ||
21 | + | ||
19 | </resultMap> | 22 | </resultMap> |
20 | 23 | ||
21 | <select id="getById" parameterType="java.lang.Integer" resultMap="VideoMap"> | 24 | <select id="getById" parameterType="java.lang.Integer" resultMap="VideoMap"> |
@@ -77,14 +80,18 @@ | @@ -77,14 +80,18 @@ | ||
77 | <if test="universityId != 0"> | 80 | <if test="universityId != 0"> |
78 | and info.id = #{universityId} | 81 | and info.id = #{universityId} |
79 | </if> | 82 | </if> |
80 | - <if test="status != -1"> | ||
81 | - and status = #{status} | 83 | + <if test="status == 1"> |
84 | + and status = 1 | ||
85 | + </if> | ||
86 | + <if test="status != 1"> | ||
87 | + and 1 = 1 | ||
82 | </if> | 88 | </if> |
83 | </where> | 89 | </where> |
84 | </select> | 90 | </select> |
85 | 91 | ||
86 | <select id="getList" parameterType="com.sincere.student.dto.VideoSearchDto" resultMap="VideoMap"> | 92 | <select id="getList" parameterType="com.sincere.student.dto.VideoSearchDto" resultMap="VideoMap"> |
87 | - select v.*,info.name,info.code ,info.logo_url from university_video v join university_info info on v.university_id = info.id | 93 | + select v.*,info.name,info.code ,info.logo_url , university_column_type.name as columnTypeString from university_video v join university_info info on v.university_id = info.id |
94 | + left join university_column_type on v.column_type = university_column_type.id | ||
88 | <where> | 95 | <where> |
89 | <if test="columnType != 0"> | 96 | <if test="columnType != 0"> |
90 | and v.column_type = #{columnType} | 97 | and v.column_type = #{columnType} |
@@ -95,16 +102,19 @@ | @@ -95,16 +102,19 @@ | ||
95 | <if test="universityName != null and universityName != ''"> | 102 | <if test="universityName != null and universityName != ''"> |
96 | and info.name like #{universityName} | 103 | and info.name like #{universityName} |
97 | </if> | 104 | </if> |
98 | - <if test="status != -1"> | ||
99 | - and status = #{status} | 105 | + <if test="status == 1"> |
106 | + and status = 1 | ||
107 | + </if> | ||
108 | + <if test="status != 1"> | ||
109 | + and 1 = 1 | ||
100 | </if> | 110 | </if> |
101 | </where> | 111 | </where> |
102 | - order by sort | 112 | + order by v.sort |
103 | </select> | 113 | </select> |
104 | 114 | ||
105 | <insert id="create" parameterType="com.sincere.student.model.Video" useGeneratedKeys="true" keyProperty="id"> | 115 | <insert id="create" parameterType="com.sincere.student.model.Video" useGeneratedKeys="true" keyProperty="id"> |
106 | - insert into university_video (column_type,university_id,sort,video_url,create_time,status,duration,cover_url,video_name) | ||
107 | - values (#{columnType},#{universityId},#{sort},#{videoUrl},GETDATE(),#{status},#{duration},#{coverUrl},#{videoName}) | 116 | + insert into university_video (column_type,university_id,sort,video_url,create_time,status,duration,cover_url,video_name,read_number) |
117 | + values (#{columnType},#{universityId},#{sort},#{videoUrl},GETDATE(),#{status},#{duration},#{coverUrl},#{videoName},#{readNumber}) | ||
108 | </insert> | 118 | </insert> |
109 | 119 | ||
110 | <delete id="delete" parameterType="java.lang.Integer"> | 120 | <delete id="delete" parameterType="java.lang.Integer"> |
@@ -138,6 +148,9 @@ | @@ -138,6 +148,9 @@ | ||
138 | <if test="status!=-1"> | 148 | <if test="status!=-1"> |
139 | status=#{status}, | 149 | status=#{status}, |
140 | </if> | 150 | </if> |
151 | + <if test="readNumber!=-1"> | ||
152 | + read_number=#{readNumber}, | ||
153 | + </if> | ||
141 | </trim> | 154 | </trim> |
142 | where id = #{id} | 155 | where id = #{id} |
143 | </update> | 156 | </update> |