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 | 15 | private String title ; |
16 | 16 | @ApiModelProperty(value = "栏目 type=1 不用传") |
17 | 17 | private int columnType ; |
18 | + @ApiModelProperty(value = "栏目中文") | |
19 | + private String columnTypeString ; | |
18 | 20 | @ApiModelProperty(value = "必传 大学id") |
19 | 21 | private int universityId ; |
20 | 22 | @ApiModelProperty(value = "必传 排序") |
... | ... | @@ -44,6 +46,14 @@ public class Article { |
44 | 46 | @ApiModelProperty(value = "状态 0预览1发布") |
45 | 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 | 57 | public List<String> getImageUrlList() { |
48 | 58 | return imageUrlList; |
49 | 59 | } | ... | ... |
src/main/java/com/sincere/student/model/Consult.java
... | ... | @@ -37,6 +37,16 @@ public class Consult { |
37 | 37 | private Integer status; |
38 | 38 | @ApiModelProperty(value = "4个栏目") |
39 | 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 | 51 | public List<String> getVideoUrlList() { |
42 | 52 | return videoUrlList; | ... | ... |
src/main/java/com/sincere/student/model/UniversityConsult.java
... | ... | @@ -28,6 +28,25 @@ public class UniversityConsult { |
28 | 28 | private List<UniversityConsultDetail> list; |
29 | 29 | @ApiModelProperty(value = "状态 0预览1发布") |
30 | 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 | 51 | public int getStatus() { |
33 | 52 | return status; | ... | ... |
src/main/java/com/sincere/student/model/Video.java
... | ... | @@ -15,6 +15,8 @@ public class Video { |
15 | 15 | private int universityId ; |
16 | 16 | @ApiModelProperty(value = "栏目") |
17 | 17 | private int columnType ; |
18 | + @ApiModelProperty(value = "栏目中文") | |
19 | + private String columnTypeString ; | |
18 | 20 | @ApiModelProperty(value = "视频路径") |
19 | 21 | private String videoUrl ; |
20 | 22 | |
... | ... | @@ -38,6 +40,24 @@ public class Video { |
38 | 40 | private String videoName ; |
39 | 41 | @ApiModelProperty(value = "视频封面") |
40 | 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 | 62 | public List<String> getVideoUrlList() { |
43 | 63 | return videoUrlList; | ... | ... |
src/main/resources/application.yaml
... | ... | @@ -5,9 +5,9 @@ spring: |
5 | 5 | application: |
6 | 6 | name: student |
7 | 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 | 11 | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
12 | 12 | # cache: |
13 | 13 | # type: redis | ... | ... |
src/main/resources/mapper/ArticleMapper.xml
... | ... | @@ -18,6 +18,7 @@ |
18 | 18 | <result column="create_time" property="createTime"/> |
19 | 19 | <result column="type" property="type"/> |
20 | 20 | <result column="status" property="status" /> |
21 | + <result column="columnTypeString" property="columnTypeString" /> | |
21 | 22 | </resultMap> |
22 | 23 | |
23 | 24 | |
... | ... | @@ -43,7 +44,7 @@ |
43 | 44 | </select> |
44 | 45 | |
45 | 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 | 48 | <where> |
48 | 49 | <if test="title != null and title != ''"> |
49 | 50 | and title like #{title} |
... | ... | @@ -61,7 +62,7 @@ |
61 | 62 | and 1 = 1 |
62 | 63 | </if> |
63 | 64 | </where> |
64 | - order by sort | |
65 | + order by university_article.sort | |
65 | 66 | </select> |
66 | 67 | |
67 | 68 | <select id="getAdvert" resultMap="ArticleMap"> | ... | ... |
src/main/resources/mapper/UniversityConsultMapper.xml
... | ... | @@ -11,6 +11,8 @@ |
11 | 11 | <result column="sort" property="sort" /> |
12 | 12 | <result column="img_url" property="imgUrl" /> |
13 | 13 | <result column="status" property="status" /> |
14 | + <result column="read_number" property="readNumber" /> | |
15 | + <result column="columnTypeString" property="columnTypeString" /> | |
14 | 16 | </resultMap> |
15 | 17 | |
16 | 18 | <select id="getListCount" parameterType="com.sincere.student.dto.ConsultSearchDto" resultType="java.lang.Integer"> |
... | ... | @@ -50,7 +52,7 @@ |
50 | 52 | </select> |
51 | 53 | |
52 | 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 | 56 | join university_info info on c.university_id = info.id |
55 | 57 | left join university_relate_major r on info.id = r.university_id |
56 | 58 | left join university_major m on m.id = r.major_id |
... | ... | @@ -98,8 +100,9 @@ |
98 | 100 | </select> |
99 | 101 | |
100 | 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 | 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 | 106 | where c.column_type = #{columnType} and c.status = 1 |
104 | 107 | order by c.sort |
105 | 108 | </select> |
... | ... | @@ -129,10 +132,10 @@ |
129 | 132 | <insert id="insert" parameterType="com.sincere.student.model.UniversityConsult" useGeneratedKeys="true" keyProperty="id"> |
130 | 133 | insert into university_consult (university_id, column_type, |
131 | 134 | video_url, context, img_url, |
132 | - create_time, sort,status) | |
135 | + create_time, sort,status,read_number) | |
133 | 136 | values (#{universityId,jdbcType=INTEGER}, #{columnType,jdbcType=INTEGER}, |
134 | 137 | #{videoUrl,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR}, |
135 | - GETDATE(), #{sort,jdbcType=INTEGER},#{status}) | |
138 | + GETDATE(), #{sort,jdbcType=INTEGER},#{status},#{readNumber}) | |
136 | 139 | </insert> |
137 | 140 | |
138 | 141 | <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.UniversityConsult"> |
... | ... | @@ -162,6 +165,9 @@ |
162 | 165 | <if test="status != null"> |
163 | 166 | status = #{status}, |
164 | 167 | </if> |
168 | + <if test="readNumber != 0"> | |
169 | + read_number = #{readNumber}, | |
170 | + </if> | |
165 | 171 | </set> |
166 | 172 | where id = #{id,jdbcType=INTEGER} |
167 | 173 | </update> | ... | ... |
src/main/resources/mapper/VideoMapper.xml
... | ... | @@ -16,6 +16,9 @@ |
16 | 16 | <result column="duration" property="duration" /> |
17 | 17 | <result column="cover_url" property="coverUrl" /> |
18 | 18 | <result column="video_name" property="videoName" /> |
19 | + <result column="read_number" property="readNumber" /> | |
20 | + <result column="columnTypeString" property="columnTypeString" /> | |
21 | + | |
19 | 22 | </resultMap> |
20 | 23 | |
21 | 24 | <select id="getById" parameterType="java.lang.Integer" resultMap="VideoMap"> |
... | ... | @@ -77,14 +80,18 @@ |
77 | 80 | <if test="universityId != 0"> |
78 | 81 | and info.id = #{universityId} |
79 | 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 | 88 | </if> |
83 | 89 | </where> |
84 | 90 | </select> |
85 | 91 | |
86 | 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 | 95 | <where> |
89 | 96 | <if test="columnType != 0"> |
90 | 97 | and v.column_type = #{columnType} |
... | ... | @@ -95,16 +102,19 @@ |
95 | 102 | <if test="universityName != null and universityName != ''"> |
96 | 103 | and info.name like #{universityName} |
97 | 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 | 110 | </if> |
101 | 111 | </where> |
102 | - order by sort | |
112 | + order by v.sort | |
103 | 113 | </select> |
104 | 114 | |
105 | 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 | 118 | </insert> |
109 | 119 | |
110 | 120 | <delete id="delete" parameterType="java.lang.Integer"> |
... | ... | @@ -138,6 +148,9 @@ |
138 | 148 | <if test="status!=-1"> |
139 | 149 | status=#{status}, |
140 | 150 | </if> |
151 | + <if test="readNumber!=-1"> | |
152 | + read_number=#{readNumber}, | |
153 | + </if> | |
141 | 154 | </trim> |
142 | 155 | where id = #{id} |
143 | 156 | </update> | ... | ... |