派生自 projectDept/qhighschool

胡仁荣
2022-11-07 4cb792d930b7029c38ae2ced15e661a9d76c066b
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;
    }
 
}