Files
ziqim/zhiqim_orm/document/问答数据库字典.dbo
T
2025-02-20 14:59:35 +08:00

106 lines
5.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<zhiqim-dbo>
<config version="1.2.0" dbType="postgresql" folder="../test" initDataWidth="820">
<![CDATA[
/*
* 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
*
* 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm
*
* This file is part of [zhiqim_orm].
*
* [zhiqim_orm] is free software: you can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* [zhiqim_orm] is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with [zhiqim_orm].
* If not, see <http://www.gnu.org/licenses/>.
*/
]]>
</config>
<package name="org.zhiqim.orm.test.qc.dbo" type="true" desc="问答定义表">
<table name="QC_QUESTION$ID$" desc="问答问题表" key="QUESTION_ID" type="InnoDB">
<field column="QUESTION_ID" type="long" length="" notNull="true" desc="问题编号"/>
<field column="QUESTION_TYPE" type="int" length="" notNull="true" desc="问题类型: 0技术疑问 1职业疑惑 2生活杂谈 3资讯动态 4其他"/>
<field column="QUESTION_STATUS" type="int" length="" notNull="true" desc="问题状态:0表示正常,1表示停用"/>
<field column="QUESTION_TITLE" type="string" length="100" notNull="true" desc="问题标题"/>
<field column="QUESTION_DESC" type="string" length="4000" notNull="true" desc="问题描述"/>
<field column="QUESTION_USER_ID" type="long" length="" notNull="true" desc="问题作者编号"/>
<field column="QUESTION_CREATE_TIME" type="string" length="19,char" notNull="true" desc="问题发表时间"/>
<field column="QUESTION_REPLY_NUM" type="int" length="" notNull="true" desc="问题评论数"/>
<field column="QUESTION_READ_NUM" type="int" length="" notNull="true" desc="问题阅读数"/>
</table>
<table name="QC_COMMENT" desc="问答评论表" key="QUESTION_ID,COMMENT_ID" type="InnoDB">
<field column="QUESTION_ID" type="long" length="" notNull="true" desc="问题编号"/>
<field column="COMMENT_ID" type="long" length="" notNull="true" desc="评论编号"/>
<field column="COMMENT_CONTENT" type="string" length="4000" notNull="true" desc="评论内容"/>
<field column="COMMENT_USER_ID" type="long" length="" notNull="true" desc="评论作者编号"/>
<field column="COMMENT_GOOD_NUM" type="int" length="" notNull="true" desc="点赞数"/>
<field column="COMMENT_CREATE_TIME" type="string" length="19,char" notNull="true" desc="评论发表时间"/>
</table>
<table name="QC_ANSWER" desc="回复表" key="COMMENT_ID,ANSWER_ID" type="InnoDB">
<field column="QUESTION_ID" type="long" length="" notNull="true" desc="问题编号"/>
<field column="COMMENT_ID" type="long" length="" notNull="true" desc="评论编号"/>
<field column="ANSWER_ID" type="long" length="" notNull="true" desc="回复编号"/>
<field column="COMMENT_USER_ID" type="long" length="" notNull="true" desc="评论作者编号"/>
<field column="ANSWER_CONTENT" type="string" length="2000" notNull="true" desc="回复内容"/>
<field column="ANSWER_USER_ID" type="long" length="" notNull="true" desc="回复作者编号"/>
<field column="ANSWER_TIME" type="string" length="19,char" notNull="true" desc="回复时间"/>
</table>
<table name="QC_GOOD" desc="点赞表" key="COMMENT_ID,GOOD_USER_ID" type="InnoDB">
<field column="COMMENT_ID" type="long" length="" notNull="true" desc="评论编号"/>
<field column="GOOD_USER_ID" type="long" length="" notNull="true" desc="点赞人编号"/>
</table>
<table name="USER_ACCOUNT" desc="用户表" key="USER_ID" type="InnoDB">
<field column="USER_ID" type="long" length="" notNull="true" desc="用户编号"/>
<field column="USER_NICK" type="string" length="32" notNull="false" desc="用户昵称"/>
<field column="USER_AVATAR_50" type="string" length="200" notNull="false" desc="用户头像"/>
</table>
</package>
<package name="org.zhiqim.orm.test.qc.ex" type="true" desc="问答扩展表">
<view name="QUESTION_EX" type="true" desc="问题扩展表" table="QC_QUESTION$ID$,USER_ACCOUNT">
<join type="EQUAL" lTable="QC_QUESTION$ID$" lColumn="QUESTION_USER_ID" rTable="USER_ACCOUNT" rColumn="USER_ID"/>
<field column="USER_NICK" table="USER_ACCOUNT"/>
<field column="USER_AVATAR_50" table="USER_ACCOUNT"/>
<field column="*" table="QC_QUESTION$ID$"/>
</view>
<view name="COMMENT_EX" type="true" desc="评论扩展表" table="QC_COMMENT,USER_ACCOUNT">
<join type="EQUAL" lTable="QC_COMMENT" lColumn="COMMENT_USER_ID" rTable="USER_ACCOUNT" rColumn="USER_ID"/>
<field column="USER_NICK" table="USER_ACCOUNT"/>
<field column="USER_AVATAR_50" table="USER_ACCOUNT"/>
<field column="*" table="QC_COMMENT"/>
</view>
<view name="ANSWER_EX" type="true" desc="回复扩展表" table="QC_ANSWER,USER_ACCOUNT a,USER_ACCOUNT b">
<join type="EQUAL" lTable="QC_ANSWER" lColumn="ANSWER_USER_ID" rTable="a" rColumn="USER_ID"/>
<join type="LEFT" lTable="QC_ANSWER" lColumn="COMMENT_USER_ID" rTable="b" rColumn="USER_ID"/>
<field column="USER_NICK ANSWER_USER_NICK" table="a"/>
<field column="USER_AVATAR_50 ANSWER_USER_AVATAR_50" table="a"/>
<field column="USER_NICK COMMENT_USER_NICK" table="b"/>
<field column="USER_AVATAR_50 COMMENT_USER_AVATAR_50" table="b"/>
<field column="*" table="QC_ANSWER"/>
</view>
</package>
</zhiqim-dbo>