派生自 projectDept/qhighschool

EricsHu
2023-11-24 0ad2f07a292895eeb3b9618eb1e275568c63a59e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
package com.qxueyou.scc.notice.model;
 
import java.io.Serializable;
import java.util.Date;
import java.util.List;
 
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
 
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Where;
import org.springframework.format.annotation.DateTimeFormat;
 
import com.qxueyou.scc.base.model.ITrace;
import com.qxueyou.scc.sys.model.SysAttachment;
 
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
 * The persistent class for the notice database table.
 * 
 */
@ApiModel
@Entity
@Table(name = "notice")
@NamedQuery(name = "Notice.findAll", query = "SELECT n FROM Notice n")
public class Notice implements Serializable, ITrace {
    private static final long serialVersionUID = 1L;
 
    /** 主键 */
    @Id
    @GeneratedValue(generator = "hibernate-uuid")
    @GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
    @Column(name = "NOTICE_ID", unique = true, nullable = false, length = 32)
    private String noticeId;
 
    /** 内容 */
    @ApiModelProperty(value="内容",name="content")
    @Column(name = "CONTENT", columnDefinition = "CLOB")
    private String content;
 
    /** 简介 */
    @ApiModelProperty(value="简介",name="brief")
    @Column(name = "BRIEF", length = 255)
    private String brief;
 
    /** 创建者ID */
    @Column(name = "CREATE_ID", nullable = false, length = 32)
    private String createId;
 
    /** 创建时间 */
 
    @Column(name = "CREATE_TIME", nullable = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
 
    /** 创建者 */
    @Column(name = "CREATOR", nullable = false, length = 100)
    private String creator;
 
    /** 删除标志 */
    @Column(name = "DELETE_FLAG", nullable = false)
    private boolean deleteFlag;
 
    /** 通知范围 1:班级通知 ;0: 平台通知 */
    @Column(name = "NOTICE_SCOPE")
    private int noticeScope;
 
    /** 通知图标路径 */
    @ApiModelProperty(value="通知图标路径",name="imgPath")
    @Column(name = "IMG_PATH")
    private String imgPath;
 
    /*
     * 班级通知
     */
    public static int NOTICE_SCOPE_CLASS = 1;
 
    /*
     * 平台通知
     */
    public static int NOTICE_SCOPE_ORG = 0;
 
    public static String NOTICE_CLASS_MSG_USER_ID = "notice-class";
 
    public static String NOTICE_ORG_MSG_USER_ID = "notice-org";
 
    public static String NOTICE_SYS_MSG = "sys_msg";
 
    public static String SYS_MSG_NAME = "系统消息";
 
    /** 通知类型:1:平台通知 0:课程通知 */
    @ApiModelProperty(value="通知类型",name="noticeType",example="0平台通知,1课程通知,3信息发布,4其他通知,5活动通知")
    @Column(name = "NOTICE_TYPE")
    private int noticeType;
 
    /*
     * 平台通知
     */
    public static int NOTICE_TYPE_TERRACE = 0;
 
    /*
     * 课程通知
     */
    public static int NOTICE_TYPE_COURSES = 1;
 
    /*
     * 信息发布
     */
    public static int NOTICE_TYPE_INF = 3;
 
    /*
     * 其他通知
     */
    public static int NOTICE_TYPE_OTHER = 4;
 
    /*
     * 其他通知
     */
    public static int NOTICE_TYPE_ACTIVE = 5;
 
    /*
     * 平台通知
     */
    public static String NOTICE_TYPE_NAME_TERRACE = "平台通知";
 
    /*
     * 上课通知
     */
    public static String NOTICE_TYPE_NAME_COURSES = "课程通知";
 
    /*
     * 信息发布
     */
    public static String NOTICE_TYPE_NAME_INF = "信息发布";
 
    /*
     * 信息发布
     */
    public static String NOTICE_TYPE_NAME_OTHER = "其他通知";
 
    /*
     * 信息发布
     */
    public static String NOTICE_TYPE_NAME_ACTIVE = "活动通知";
 
    /** 通知类型名称 */
    @ApiModelProperty(value="通知类型名称",name="noticeTypeName",example="平台通知,课程通知,信息发布,其他通知,活动通知")
    @Column(name = "NOTICE_TYPE_NAME", length = 150)
    private String noticeTypeName;
 
    /** 范围ID:平台通知:机构ID 班级通知:班级ID */
    @ApiModelProperty(value="范围ID",name="scopeId",example="平台通知:机构ID 班级通知:班级ID")
    @Column(name = "SCOPE_ID")
    private String scopeId;
 
    @ApiModelProperty(value="状态",name="status",example="0 草稿 1已发布 2已废弃")
    /** 状态: 0 草稿 1已发布 2已废弃 */
    @Column(name = "STATUS", length = 32)
    private short status;
 
    /*
     * 草稿
     */
    public static short STATUS_DRAFT = 0;
 
    /*
     * 已发布
     */
    public static short STATUS_ISSUED = 1;
 
    /*
     * 已废弃
     */
    public static short STATUS_DISCARD = 2;
 
    /** 标题 */
    @ApiModelProperty(value="标题",name="title")
    @Column(name = "TITLE", length = 255)
    private String title;
 
    /** 修改人ID */
    @Column(name = "UPDATE_ID", length = 32)
    private String updateId;
 
    /** 修改时间 */
    @Column(name = "UPDATE_TIME", nullable = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
 
    /** 修改人 */
    @Column(name = "UPDATOR", length = 100)
    private String updator;
 
    /** 浏览总次数:一人可以多次 */
    @ApiModelProperty(value="浏览总次数",name="viewCount",example="一人可以多次")
    @Column(name = "VIEW_COUNT")
    private int viewCount;
 
    /** 发布时间 */
    @ApiModelProperty(value="发布时间",name="issuedTime")
    @Column(name = "ISSUED_TIME")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date issuedTime;
 
    /** 浏览总人次:一人记录一次 */
    @ApiModelProperty(value="浏览总人次",name="viwerCount",example="一人记录一次")
    @Column(name = "VIWER_COUNT")
    private int viwerCount;
 
    @Transient
    private Integer totalPeople;
 
    @Transient
    private Integer arrivePeople;
 
    @Transient
    private Integer readPeople;
    
    
 
    
    @OneToMany(cascade=CascadeType.ALL ,fetch = FetchType.LAZY)
    @JoinColumn(name = "REALATED_OBJECT_ID", referencedColumnName = "NOTICE_ID", updatable = false, insertable = false)
    @Where(clause="DELETE_FLAG=0")
    private List<SysAttachment> lstSysAttachment;
 
    public List<SysAttachment> getLstSysAttachment() {
        return lstSysAttachment;
    }
 
    public void setLstSysAttachment(List<SysAttachment> lstSysAttachment) {
        this.lstSysAttachment = lstSysAttachment;
    }
 
 
 
 
    public Date getIssuedTime() {
        return issuedTime;
    }
 
    public void setIssuedTime(Date issuedTime) {
        this.issuedTime = issuedTime;
    }
 
    public String getNoticeId() {
        return this.noticeId;
    }
 
    public void setNoticeId(String noticeId) {
        this.noticeId = noticeId;
    }
 
    public String getContent() {
        return this.content;
    }
 
    public void setContent(String content) {
        this.content = content;
    }
 
    public String getCreateId() {
        return this.createId;
    }
 
    public void setCreateId(String createId) {
        this.createId = createId;
    }
 
    public Date getCreateTime() {
        return this.createTime;
    }
 
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
 
    public String getCreator() {
        return this.creator;
    }
 
    public void setCreator(String creator) {
        this.creator = creator;
    }
 
    public boolean getDeleteFlag() {
        return this.deleteFlag;
    }
 
    public void setDeleteFlag(boolean deleteFlag) {
        this.deleteFlag = deleteFlag;
    }
 
    public int getNoticeScope() {
        return this.noticeScope;
    }
 
    public void setNoticeScope(int noticeScope) {
        this.noticeScope = noticeScope;
    }
 
    public int getNoticeType() {
        return this.noticeType;
    }
 
    public void setNoticeType(int noticeType) {
        this.noticeType = noticeType;
 
        switch (noticeType) {
 
        case 1: {
            setNoticeTypeName(NOTICE_TYPE_NAME_TERRACE);
            break;
        }
        case 2: {
            setNoticeTypeName(NOTICE_TYPE_NAME_COURSES);
            break;
        }
        case 3: {
            setNoticeTypeName(NOTICE_TYPE_NAME_INF);
            break;
        }
        case 4: {
            setNoticeTypeName(NOTICE_TYPE_NAME_OTHER);
            break;
        }
        case 5: {
            setNoticeTypeName(NOTICE_TYPE_NAME_ACTIVE);
            break;
        }
 
        }
    }
 
    public String getNoticeTypeName() {
        return this.noticeTypeName;
    }
 
    public void setNoticeTypeName(String noticeTypeName) {
        this.noticeTypeName = noticeTypeName;
    }
 
    public String getScopeId() {
        return this.scopeId;
    }
 
    public void setScopeId(String scopeId) {
        this.scopeId = scopeId;
    }
 
    public short getStatus() {
        return this.status;
    }
 
    public void setStatus(short status) {
        this.status = status;
    }
 
    public String getTitle() {
        return this.title;
    }
 
    public void setTitle(String title) {
        this.title = title;
    }
 
    public String getUpdateId() {
        return this.updateId;
    }
 
    public void setUpdateId(String updateId) {
        this.updateId = updateId;
    }
 
    public Date getUpdateTime() {
        return this.updateTime;
    }
 
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
 
    public String getUpdator() {
        return this.updator;
    }
 
    public void setUpdator(String updator) {
        this.updator = updator;
    }
 
    public int getViewCount() {
        return viewCount;
    }
 
    public void setViewCount(int viewCount) {
        this.viewCount = viewCount;
    }
 
    public int getViwerCount() {
        return viwerCount;
    }
 
    public void setViwerCount(int viwerCount) {
        this.viwerCount = viwerCount;
    }
 
    public String getImgPath() {
        return imgPath;
    }
 
    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }
 
    public Integer getTotalPeople() {
        return totalPeople;
    }
 
    public void setTotalPeople(Integer totalPeople) {
        this.totalPeople = totalPeople;
    }
 
    public Integer getArrivePeople() {
        return arrivePeople;
    }
 
    public void setArrivePeople(Integer arrivePeople) {
        this.arrivePeople = arrivePeople;
    }
 
    public Integer getReadPeople() {
        return readPeople;
    }
 
    public void setReadPeople(Integer readPeople) {
        this.readPeople = readPeople;
    }
 
    public String getBrief() {
        return brief;
    }
 
    public void setBrief(String brief) {
        this.brief = brief;
    }
 
    /**
     * 返回不包含content的所有字段
     * 
     * @return
     */
    public static String getColumnsWithOutContent() {
        StringBuilder buf = new StringBuilder(120);
        buf.append("noticeId,");
        buf.append("createId,");
        buf.append("createTime,");
        buf.append("creator,");
        buf.append("deleteFlag,");
        buf.append("noticeScope,");
        buf.append("noticeType,");
        buf.append("noticeTypeName,");
        buf.append("scopeId,");
        buf.append("status,");
        buf.append("title,");
        buf.append("brief,");
        buf.append("updateId,");
        buf.append("updateTime,");
        buf.append("updator,");
        buf.append("viewCount,");
        buf.append("viwerCount");
        return buf.toString();
    }
 
    /**
     * 返回不包含content的所有字段
     * 
     * @return
     */
    public static String getPrefixColumnsWithOutContent() {
        StringBuilder buf = new StringBuilder(120);
        buf.append("n.NOTICE_ID AS noticeId,");
        buf.append("n.CREATE_ID AS createId,");
        buf.append("n.CREATE_TIME AS createTime,");
        buf.append("n.CREATOR AS creator,");
        buf.append("n.NOTICE_SCOPE AS noticeScope,");
        buf.append("n.NOTICE_TYPE AS noticeType,");
        buf.append("n.NOTICE_TYPE_NAME AS noticeTypeName,");
        buf.append("n.SCOPE_ID AS scopeId,");
        buf.append("n.STATUS AS status,");
        buf.append("n.TITLE AS title,");
        buf.append("n.BRIEF AS brief,");
        buf.append("n.UPDATE_ID AS updateId,");
        buf.append("n.UPDATE_TIME AS updateTime,");
        buf.append("n.UPDATOR AS updator,");
        buf.append("n.VIEW_COUNT AS viewCount,");
        buf.append("n.VIWER_COUNT AS viwerCount");
        return buf.toString();
    }
 
    /**
     * 返回不包含content的所有字段
     * 
     * @return
     */
    public static Notice fromObject(Object[] objs) {
 
        Notice notice = new Notice();
 
        notice.setNoticeId((String) objs[0]);
        notice.setCreateId((String) objs[1]);
        notice.setCreateTime((Date) objs[2]);
        notice.setCreator((String) objs[3]);
        notice.setDeleteFlag((Boolean) objs[4]);
        notice.setNoticeScope((Integer) objs[5]);
        notice.setNoticeType((Integer) objs[6]);
        notice.setNoticeTypeName((String) objs[7]);
        notice.setScopeId((String) objs[8]);
        notice.setStatus((Short) objs[9]);
        notice.setTitle((String) objs[10]);
        notice.setBrief((String) objs[11]);
        notice.setUpdateId((String) objs[12]);
        notice.setUpdateTime((Date) objs[13]);
        notice.setUpdator((String) objs[14]);
        notice.setViewCount((Integer) objs[15]);
        notice.setViwerCount((Integer) objs[16]);
        notice.setTotalPeople((Integer) objs[17]);
        notice.setArrivePeople((Integer) objs[18]);
        notice.setReadPeople((Integer) objs[19]);
        return notice;
    }
 
}