Browse Source
* feat: change remark to discussion * feat: change remark model to discussion model * fix: sync duplicate column * feat:update frontend resources * fix: checkstylemaster
vran
3 years ago
committed by
GitHub
52 changed files with 604 additions and 481 deletions
@ -1 +1 @@ |
|||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir-frontend</title><script defer="defer" type="module" src="/js/chunk-vendors.45746587.js"></script><script defer="defer" type="module" src="/js/app.a4b9bb20.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.757c1ef3.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.54c3660b.js" nomodule></script><script defer="defer" src="/js/app-legacy.2527a373.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> |
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir-frontend</title><script defer="defer" type="module" src="/js/chunk-vendors.45746587.js"></script><script defer="defer" type="module" src="/js/app.6aec33ce.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.757c1ef3.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.54c3660b.js" nomodule></script><script defer="defer" src="/js/app-legacy.b19c33c1.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir-frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,17 @@ |
|||||
|
package com.databasir.core.domain.remark.converter; |
||||
|
|
||||
|
import com.databasir.core.domain.remark.data.DiscussionResponse; |
||||
|
import com.databasir.dao.tables.pojos.DocumentDiscussionPojo; |
||||
|
import com.databasir.dao.tables.pojos.UserPojo; |
||||
|
import org.mapstruct.Mapper; |
||||
|
import org.mapstruct.Mapping; |
||||
|
|
||||
|
@Mapper(componentModel = "spring") |
||||
|
public interface DiscussionResponseConverter { |
||||
|
|
||||
|
@Mapping(target = "id", source = "discussion.id") |
||||
|
@Mapping(target = "createAt", source = "discussion.createAt") |
||||
|
@Mapping(target = "content", source = "discussion.content") |
||||
|
DiscussionResponse of(DocumentDiscussionPojo discussion, |
||||
|
UserPojo discussBy); |
||||
|
} |
@ -1,19 +0,0 @@ |
|||||
package com.databasir.core.domain.remark.converter; |
|
||||
|
|
||||
import com.databasir.core.domain.remark.data.RemarkResponse; |
|
||||
import com.databasir.dao.tables.pojos.DocumentRemarkPojo; |
|
||||
import com.databasir.dao.tables.pojos.UserPojo; |
|
||||
import org.mapstruct.Mapper; |
|
||||
import org.mapstruct.Mapping; |
|
||||
|
|
||||
@Mapper(componentModel = "spring") |
|
||||
public interface RemarkResponseConverter { |
|
||||
|
|
||||
@Mapping(target = "remarkBy.userId", source = "remarkBy.id") |
|
||||
@Mapping(target = "remarkBy.nickname", source = "remarkBy.nickname") |
|
||||
@Mapping(target = "remarkBy.email", source = "remarkBy.email") |
|
||||
@Mapping(target = "id", source = "remark.id") |
|
||||
@Mapping(target = "createAt", source = "remark.createAt") |
|
||||
RemarkResponse of(DocumentRemarkPojo remark, |
|
||||
UserPojo remarkBy); |
|
||||
} |
|
@ -0,0 +1,178 @@ |
|||||
|
/* |
||||
|
* This file is generated by jOOQ. |
||||
|
*/ |
||||
|
package com.databasir.dao.tables; |
||||
|
|
||||
|
|
||||
|
import com.databasir.dao.Databasir; |
||||
|
import com.databasir.dao.Indexes; |
||||
|
import com.databasir.dao.Keys; |
||||
|
import com.databasir.dao.tables.records.DocumentDiscussionRecord; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
import java.util.Arrays; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import org.jooq.Field; |
||||
|
import org.jooq.ForeignKey; |
||||
|
import org.jooq.Identity; |
||||
|
import org.jooq.Index; |
||||
|
import org.jooq.Name; |
||||
|
import org.jooq.Record; |
||||
|
import org.jooq.Row7; |
||||
|
import org.jooq.Schema; |
||||
|
import org.jooq.Table; |
||||
|
import org.jooq.TableField; |
||||
|
import org.jooq.TableOptions; |
||||
|
import org.jooq.UniqueKey; |
||||
|
import org.jooq.impl.DSL; |
||||
|
import org.jooq.impl.SQLDataType; |
||||
|
import org.jooq.impl.TableImpl; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* This class is generated by jOOQ. |
||||
|
*/ |
||||
|
@SuppressWarnings({ "all", "unchecked", "rawtypes" }) |
||||
|
public class DocumentDiscussion extends TableImpl<DocumentDiscussionRecord> { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* The reference instance of <code>databasir.document_discussion</code> |
||||
|
*/ |
||||
|
public static final DocumentDiscussion DOCUMENT_DISCUSSION = new DocumentDiscussion(); |
||||
|
|
||||
|
/** |
||||
|
* The class holding records for this type |
||||
|
*/ |
||||
|
@Override |
||||
|
public Class<DocumentDiscussionRecord> getRecordType() { |
||||
|
return DocumentDiscussionRecord.class; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* The column <code>databasir.document_discussion.id</code>. |
||||
|
*/ |
||||
|
public final TableField<DocumentDiscussionRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); |
||||
|
|
||||
|
/** |
||||
|
* The column <code>databasir.document_discussion.content</code>. |
||||
|
*/ |
||||
|
public final TableField<DocumentDiscussionRecord, String> CONTENT = createField(DSL.name("content"), SQLDataType.CLOB.nullable(false), this, ""); |
||||
|
|
||||
|
/** |
||||
|
* The column <code>databasir.document_discussion.user_id</code>. user.id |
||||
|
*/ |
||||
|
public final TableField<DocumentDiscussionRecord, Integer> USER_ID = createField(DSL.name("user_id"), SQLDataType.INTEGER.nullable(false), this, "user.id"); |
||||
|
|
||||
|
/** |
||||
|
* The column <code>databasir.document_discussion.project_id</code>. |
||||
|
*/ |
||||
|
public final TableField<DocumentDiscussionRecord, Integer> PROJECT_ID = createField(DSL.name("project_id"), SQLDataType.INTEGER.nullable(false), this, ""); |
||||
|
|
||||
|
/** |
||||
|
* The column <code>databasir.document_discussion.table_name</code>. |
||||
|
*/ |
||||
|
public final TableField<DocumentDiscussionRecord, String> TABLE_NAME = createField(DSL.name("table_name"), SQLDataType.VARCHAR(255).nullable(false), this, ""); |
||||
|
|
||||
|
/** |
||||
|
* The column <code>databasir.document_discussion.column_name</code>. |
||||
|
*/ |
||||
|
public final TableField<DocumentDiscussionRecord, String> COLUMN_NAME = createField(DSL.name("column_name"), SQLDataType.VARCHAR(255), this, ""); |
||||
|
|
||||
|
/** |
||||
|
* The column <code>databasir.document_discussion.create_at</code>. |
||||
|
*/ |
||||
|
public final TableField<DocumentDiscussionRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, ""); |
||||
|
|
||||
|
private DocumentDiscussion(Name alias, Table<DocumentDiscussionRecord> aliased) { |
||||
|
this(alias, aliased, null); |
||||
|
} |
||||
|
|
||||
|
private DocumentDiscussion(Name alias, Table<DocumentDiscussionRecord> aliased, Field<?>[] parameters) { |
||||
|
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Create an aliased <code>databasir.document_discussion</code> table |
||||
|
* reference |
||||
|
*/ |
||||
|
public DocumentDiscussion(String alias) { |
||||
|
this(DSL.name(alias), DOCUMENT_DISCUSSION); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Create an aliased <code>databasir.document_discussion</code> table |
||||
|
* reference |
||||
|
*/ |
||||
|
public DocumentDiscussion(Name alias) { |
||||
|
this(alias, DOCUMENT_DISCUSSION); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Create a <code>databasir.document_discussion</code> table reference |
||||
|
*/ |
||||
|
public DocumentDiscussion() { |
||||
|
this(DSL.name("document_discussion"), null); |
||||
|
} |
||||
|
|
||||
|
public <O extends Record> DocumentDiscussion(Table<O> child, ForeignKey<O, DocumentDiscussionRecord> key) { |
||||
|
super(child, key, DOCUMENT_DISCUSSION); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Schema getSchema() { |
||||
|
return aliased() ? null : Databasir.DATABASIR; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<Index> getIndexes() { |
||||
|
return Arrays.asList(Indexes.DOCUMENT_DISCUSSION_IDX_PROJECT_ID); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Identity<DocumentDiscussionRecord, Integer> getIdentity() { |
||||
|
return (Identity<DocumentDiscussionRecord, Integer>) super.getIdentity(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public UniqueKey<DocumentDiscussionRecord> getPrimaryKey() { |
||||
|
return Keys.KEY_DOCUMENT_DISCUSSION_PRIMARY; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public DocumentDiscussion as(String alias) { |
||||
|
return new DocumentDiscussion(DSL.name(alias), this); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public DocumentDiscussion as(Name alias) { |
||||
|
return new DocumentDiscussion(alias, this); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Rename this table |
||||
|
*/ |
||||
|
@Override |
||||
|
public DocumentDiscussion rename(String name) { |
||||
|
return new DocumentDiscussion(DSL.name(name), null); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Rename this table |
||||
|
*/ |
||||
|
@Override |
||||
|
public DocumentDiscussion rename(Name name) { |
||||
|
return new DocumentDiscussion(name, null); |
||||
|
} |
||||
|
|
||||
|
// -------------------------------------------------------------------------
|
||||
|
// Row7 type methods
|
||||
|
// -------------------------------------------------------------------------
|
||||
|
|
||||
|
@Override |
||||
|
public Row7<Integer, String, Integer, Integer, String, String, LocalDateTime> fieldsRow() { |
||||
|
return (Row7) super.fieldsRow(); |
||||
|
} |
||||
|
} |
@ -1,176 +0,0 @@ |
|||||
/* |
|
||||
* This file is generated by jOOQ. |
|
||||
*/ |
|
||||
package com.databasir.dao.tables; |
|
||||
|
|
||||
|
|
||||
import com.databasir.dao.Databasir; |
|
||||
import com.databasir.dao.Indexes; |
|
||||
import com.databasir.dao.Keys; |
|
||||
import com.databasir.dao.tables.records.DocumentRemarkRecord; |
|
||||
|
|
||||
import java.time.LocalDateTime; |
|
||||
import java.util.Arrays; |
|
||||
import java.util.List; |
|
||||
|
|
||||
import org.jooq.Field; |
|
||||
import org.jooq.ForeignKey; |
|
||||
import org.jooq.Identity; |
|
||||
import org.jooq.Index; |
|
||||
import org.jooq.Name; |
|
||||
import org.jooq.Record; |
|
||||
import org.jooq.Row7; |
|
||||
import org.jooq.Schema; |
|
||||
import org.jooq.Table; |
|
||||
import org.jooq.TableField; |
|
||||
import org.jooq.TableOptions; |
|
||||
import org.jooq.UniqueKey; |
|
||||
import org.jooq.impl.DSL; |
|
||||
import org.jooq.impl.SQLDataType; |
|
||||
import org.jooq.impl.TableImpl; |
|
||||
|
|
||||
|
|
||||
/** |
|
||||
* This class is generated by jOOQ. |
|
||||
*/ |
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" }) |
|
||||
public class DocumentRemark extends TableImpl<DocumentRemarkRecord> { |
|
||||
|
|
||||
private static final long serialVersionUID = 1L; |
|
||||
|
|
||||
/** |
|
||||
* The reference instance of <code>databasir.document_remark</code> |
|
||||
*/ |
|
||||
public static final DocumentRemark DOCUMENT_REMARK = new DocumentRemark(); |
|
||||
|
|
||||
/** |
|
||||
* The class holding records for this type |
|
||||
*/ |
|
||||
@Override |
|
||||
public Class<DocumentRemarkRecord> getRecordType() { |
|
||||
return DocumentRemarkRecord.class; |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* The column <code>databasir.document_remark.id</code>. |
|
||||
*/ |
|
||||
public final TableField<DocumentRemarkRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); |
|
||||
|
|
||||
/** |
|
||||
* The column <code>databasir.document_remark.remark</code>. |
|
||||
*/ |
|
||||
public final TableField<DocumentRemarkRecord, String> REMARK = createField(DSL.name("remark"), SQLDataType.CLOB.nullable(false), this, ""); |
|
||||
|
|
||||
/** |
|
||||
* The column <code>databasir.document_remark.user_id</code>. user.id |
|
||||
*/ |
|
||||
public final TableField<DocumentRemarkRecord, Integer> USER_ID = createField(DSL.name("user_id"), SQLDataType.INTEGER.nullable(false), this, "user.id"); |
|
||||
|
|
||||
/** |
|
||||
* The column <code>databasir.document_remark.project_id</code>. |
|
||||
*/ |
|
||||
public final TableField<DocumentRemarkRecord, Integer> PROJECT_ID = createField(DSL.name("project_id"), SQLDataType.INTEGER.nullable(false), this, ""); |
|
||||
|
|
||||
/** |
|
||||
* The column <code>databasir.document_remark.table_name</code>. |
|
||||
*/ |
|
||||
public final TableField<DocumentRemarkRecord, String> TABLE_NAME = createField(DSL.name("table_name"), SQLDataType.VARCHAR(255).nullable(false), this, ""); |
|
||||
|
|
||||
/** |
|
||||
* The column <code>databasir.document_remark.column_name</code>. |
|
||||
*/ |
|
||||
public final TableField<DocumentRemarkRecord, String> COLUMN_NAME = createField(DSL.name("column_name"), SQLDataType.VARCHAR(255), this, ""); |
|
||||
|
|
||||
/** |
|
||||
* The column <code>databasir.document_remark.create_at</code>. |
|
||||
*/ |
|
||||
public final TableField<DocumentRemarkRecord, LocalDateTime> CREATE_AT = createField(DSL.name("create_at"), SQLDataType.LOCALDATETIME(0).nullable(false).defaultValue(DSL.field("CURRENT_TIMESTAMP", SQLDataType.LOCALDATETIME)), this, ""); |
|
||||
|
|
||||
private DocumentRemark(Name alias, Table<DocumentRemarkRecord> aliased) { |
|
||||
this(alias, aliased, null); |
|
||||
} |
|
||||
|
|
||||
private DocumentRemark(Name alias, Table<DocumentRemarkRecord> aliased, Field<?>[] parameters) { |
|
||||
super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Create an aliased <code>databasir.document_remark</code> table reference |
|
||||
*/ |
|
||||
public DocumentRemark(String alias) { |
|
||||
this(DSL.name(alias), DOCUMENT_REMARK); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Create an aliased <code>databasir.document_remark</code> table reference |
|
||||
*/ |
|
||||
public DocumentRemark(Name alias) { |
|
||||
this(alias, DOCUMENT_REMARK); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Create a <code>databasir.document_remark</code> table reference |
|
||||
*/ |
|
||||
public DocumentRemark() { |
|
||||
this(DSL.name("document_remark"), null); |
|
||||
} |
|
||||
|
|
||||
public <O extends Record> DocumentRemark(Table<O> child, ForeignKey<O, DocumentRemarkRecord> key) { |
|
||||
super(child, key, DOCUMENT_REMARK); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public Schema getSchema() { |
|
||||
return aliased() ? null : Databasir.DATABASIR; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public List<Index> getIndexes() { |
|
||||
return Arrays.asList(Indexes.DOCUMENT_REMARK_IDX_PROJECT_ID); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public Identity<DocumentRemarkRecord, Integer> getIdentity() { |
|
||||
return (Identity<DocumentRemarkRecord, Integer>) super.getIdentity(); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public UniqueKey<DocumentRemarkRecord> getPrimaryKey() { |
|
||||
return Keys.KEY_DOCUMENT_REMARK_PRIMARY; |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public DocumentRemark as(String alias) { |
|
||||
return new DocumentRemark(DSL.name(alias), this); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public DocumentRemark as(Name alias) { |
|
||||
return new DocumentRemark(alias, this); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Rename this table |
|
||||
*/ |
|
||||
@Override |
|
||||
public DocumentRemark rename(String name) { |
|
||||
return new DocumentRemark(DSL.name(name), null); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* Rename this table |
|
||||
*/ |
|
||||
@Override |
|
||||
public DocumentRemark rename(Name name) { |
|
||||
return new DocumentRemark(name, null); |
|
||||
} |
|
||||
|
|
||||
// -------------------------------------------------------------------------
|
|
||||
// Row7 type methods
|
|
||||
// -------------------------------------------------------------------------
|
|
||||
|
|
||||
@Override |
|
||||
public Row7<Integer, String, Integer, Integer, String, String, LocalDateTime> fieldsRow() { |
|
||||
return (Row7) super.fieldsRow(); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,52 @@ |
|||||
|
package com.databasir.dao.impl; |
||||
|
|
||||
|
import com.databasir.dao.tables.pojos.DocumentDiscussionPojo; |
||||
|
import com.databasir.dao.value.DocumentDiscussionCountPojo; |
||||
|
import lombok.Getter; |
||||
|
import org.jooq.Condition; |
||||
|
import org.jooq.DSLContext; |
||||
|
import org.jooq.impl.DSL; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Optional; |
||||
|
|
||||
|
import static com.databasir.dao.Tables.DOCUMENT_DISCUSSION; |
||||
|
|
||||
|
@Repository |
||||
|
public class DocumentDiscussionDao extends BaseDao<DocumentDiscussionPojo> { |
||||
|
|
||||
|
@Autowired |
||||
|
@Getter |
||||
|
private DSLContext dslContext; |
||||
|
|
||||
|
public DocumentDiscussionDao() { |
||||
|
super(DOCUMENT_DISCUSSION, DocumentDiscussionPojo.class); |
||||
|
} |
||||
|
|
||||
|
public Optional<DocumentDiscussionPojo> selectByProjectIdAndId(Integer projectId, Integer id) { |
||||
|
return this.getDslContext() |
||||
|
.selectFrom(DOCUMENT_DISCUSSION).where(DOCUMENT_DISCUSSION.PROJECT_ID.eq(projectId) |
||||
|
.and(DOCUMENT_DISCUSSION.ID.eq(id))) |
||||
|
.fetchOptionalInto(DocumentDiscussionPojo.class); |
||||
|
} |
||||
|
|
||||
|
public List<DocumentDiscussionCountPojo> selectTableDiscussionCount(Integer projectId) { |
||||
|
return this.selectDiscussionCount(DOCUMENT_DISCUSSION.PROJECT_ID.eq(projectId) |
||||
|
.and(DOCUMENT_DISCUSSION.COLUMN_NAME.isNull())); |
||||
|
} |
||||
|
|
||||
|
public List<DocumentDiscussionCountPojo> selectAllDiscussionCount(Integer projectId) { |
||||
|
return this.selectDiscussionCount(DOCUMENT_DISCUSSION.PROJECT_ID.eq(projectId)); |
||||
|
} |
||||
|
|
||||
|
public List<DocumentDiscussionCountPojo> selectDiscussionCount(Condition condition) { |
||||
|
return this.getDslContext() |
||||
|
.select(DSL.count(), DOCUMENT_DISCUSSION.TABLE_NAME, DOCUMENT_DISCUSSION.COLUMN_NAME) |
||||
|
.from(DOCUMENT_DISCUSSION) |
||||
|
.where(condition) |
||||
|
.groupBy(DOCUMENT_DISCUSSION.TABLE_NAME, DOCUMENT_DISCUSSION.COLUMN_NAME) |
||||
|
.fetchInto(DocumentDiscussionCountPojo.class); |
||||
|
} |
||||
|
} |
@ -1,30 +0,0 @@ |
|||||
package com.databasir.dao.impl; |
|
||||
|
|
||||
import com.databasir.dao.tables.pojos.DocumentRemarkPojo; |
|
||||
import lombok.Getter; |
|
||||
import org.jooq.DSLContext; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.stereotype.Repository; |
|
||||
|
|
||||
import java.util.Optional; |
|
||||
|
|
||||
import static com.databasir.dao.Tables.DOCUMENT_REMARK; |
|
||||
|
|
||||
@Repository |
|
||||
public class DocumentRemarkDao extends BaseDao<DocumentRemarkPojo> { |
|
||||
|
|
||||
@Autowired |
|
||||
@Getter |
|
||||
private DSLContext dslContext; |
|
||||
|
|
||||
public DocumentRemarkDao() { |
|
||||
super(DOCUMENT_REMARK, DocumentRemarkPojo.class); |
|
||||
} |
|
||||
|
|
||||
public Optional<DocumentRemarkPojo> selectByProjectIdAndId(Integer projectId, Integer id) { |
|
||||
return this.getDslContext() |
|
||||
.selectFrom(DOCUMENT_REMARK).where(DOCUMENT_REMARK.PROJECT_ID.eq(projectId) |
|
||||
.and(DOCUMENT_REMARK.ID.eq(id))) |
|
||||
.fetchOptionalInto(DocumentRemarkPojo.class); |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,15 @@ |
|||||
|
package com.databasir.dao.value; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class DocumentDiscussionCountPojo { |
||||
|
|
||||
|
private Integer projectId; |
||||
|
|
||||
|
private String tableName; |
||||
|
|
||||
|
private String columnName; |
||||
|
|
||||
|
private Integer count; |
||||
|
} |
Loading…
Reference in new issue