ソースを参照

内容关键词

XMTT 6 年 前
コミット
28aa3b9c88

+ 10 - 2
src/main/java/com/ekexiu/project/platform/article/Article.java

@ -1,12 +1,11 @@
1 1
package com.ekexiu.project.platform.article;
2 2

3
import com.ekexiu.project.platform.base.po.ManagedBaseTable;
3 4
import org.jfw.apt.orm.annotation.entry.Column;
4 5
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
5 6
import org.jfw.apt.orm.annotation.entry.Table;
6 7
import org.jfw.apt.orm.core.enums.DE;
7 8

8
import com.ekexiu.project.platform.base.po.ManagedBaseTable;
9

10 9
@PrimaryKey("id")
11 10
@Table(descp = "内容表")
12 11
public class Article implements ManagedBaseTable {
@ -24,6 +23,7 @@ public class Article implements ManagedBaseTable {
24 23
    private String modifyTime;
25 24
    private String creator;
26 25
    private String modifier;
26
    private String keyWord;
27 27

28 28
    private String professor;
29 29
    private String org;
@ -169,4 +169,12 @@ public class Article implements ManagedBaseTable {
169 169
        this.modifier = modifier;
170 170
    }
171 171

172
    @Column(descp = "关键词", value = DE.Text_de)
173
    public String getKeyWord() {
174
        return keyWord;
175
    }
176

177
    public void setKeyWord(String keyWord) {
178
        this.keyWord = keyWord;
179
    }
172 180
}

+ 3 - 2
src/main/java/com/ekexiu/project/platform/article/ArticleDao.java

@ -14,7 +14,8 @@ import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
14 14
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
15 15
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
16 16
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
17
import org.jfw.apt.orm.annotation.dao.param.Like;
17
import org.jfw.apt.orm.annotation.dao.param.GroupSqlColumn;
18
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
18 19
import org.jfw.util.PageQueryResult;
19 20

20 21
import java.sql.Connection;
@ -44,7 +45,7 @@ public interface ArticleDao {
44 45
    @PageSelect
45 46
    @OrderBy("ORDER BY MODIFY_TIME DESC")
46 47
    @Where("ACTIVED = '1'")
47
    PageQueryResult<Article> pageQuery(Connection con, @Nullable @Like String title, @Nullable String catalog, @Nullable Boolean published, int pageSize, int pageNo) throws SQLException;
48
    PageQueryResult<Article> pageQuery(Connection con, @Nullable @GroupSqlColumn(value = {"TITLE LIKE ?","KEY_WORD LIKE ?"},isAnd = false,handlerClass = StringHandler.class) String key, @Nullable String catalog, @Nullable Boolean published, int pageSize, int pageNo) throws SQLException;
48 49

49 50
    @SelectOne
50 51
    @Nullable

+ 2 - 2
src/main/java/com/ekexiu/project/platform/article/ArticleService.java

@ -100,8 +100,8 @@ public class ArticleService {
100 100
    @LoginUser
101 101
    @Path("/pq")
102 102
    @Get
103
    public PageQueryResult<Article> pageQuery(@JdbcConn Connection con, @Nullable String title, @Nullable String catalog, @Nullable Boolean published, int pageSize, int pageNo) throws SQLException {
104
        return articleDao.pageQuery(con, title == null ? null : "%" + title + "%", catalog, published, pageSize, pageNo);
103
    public PageQueryResult<Article> pageQuery(@JdbcConn Connection con, @Nullable String key, @Nullable String catalog, @Nullable Boolean published, int pageSize, int pageNo) throws SQLException {
104
        return articleDao.pageQuery(con, key == null ? null : "%" + key + "%", catalog, published, pageSize, pageNo);
105 105
    }
106 106

107 107
    @LoginUser

+ 4 - 1
src/main/resources/database.sql

@ -425,7 +425,7 @@ CREATE TABLE ARTICLE_DAY
425 425
CREATE TABLE ARTICLE_DAY_SUM(
426 426
  ID TEXT NOT NULL,
427 427
  SUM INTEGER NOT NULL
428
)
428
);
429 429
ALTER TABLE ARTICLE_DAY_SUM ADD PRIMARY KEY (ID);
430 430
431 431
INSERT INTO "public"."console_config" ("cfg_name", "cfg_value") VALUES ('article_log_handler','com.ekexiu.project.platform.views.handler.db.TimeLogHandler');
@ -443,3 +443,6 @@ INSERT INTO "public"."console_config" ("cfg_name", "cfg_value") VALUES ('tns_lis
443 443
INSERT INTO "public"."console_config" ("cfg_name", "cfg_value") VALUES ('tns_list.collection-ele-0','article');
444 444
INSERT INTO "public"."console_config" ("cfg_name", "cfg_value") VALUES ('com_ekexiu_project_platform_views_service_Main.tns-ref','tns_list');
445 445
446
ALTER TABLE public.article ADD key_word text NULL;
447
COMMENT ON COLUMN public.article.key_word IS '关键词';
448