Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
9056c04f
Commit
9056c04f
authored
Jun 26, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增问题模块接口
parent
300b34ba
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
307 additions
and
0 deletions
+307
-0
ImComment.java
.../src/main/java/com/xxfc/platform/im/entity/ImComment.java
+55
-0
ImPraise.java
...r/src/main/java/com/xxfc/platform/im/entity/ImPraise.java
+46
-0
ImQuestion.java
...src/main/java/com/xxfc/platform/im/entity/ImQuestion.java
+67
-0
ImCommentMapper.java
...ain/java/com/xxfc/platform/im/mapper/ImCommentMapper.java
+12
-0
ImPraiseMapper.java
...main/java/com/xxfc/platform/im/mapper/ImPraiseMapper.java
+14
-0
ImQuestionMapper.java
...in/java/com/xxfc/platform/im/mapper/ImQuestionMapper.java
+14
-0
ImCommentMapper.xml
...x-im-server/src/main/resources/mapper/ImCommentMapper.xml
+24
-0
ImPraiseMapper.xml
...xx-im-server/src/main/resources/mapper/ImPraiseMapper.xml
+27
-0
ImQuestionMapper.xml
...-im-server/src/main/resources/mapper/ImQuestionMapper.xml
+48
-0
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/entity/ImComment.java
0 → 100644
View file @
9056c04f
package
com
.
xxfc
.
platform
.
im
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
@Table
(
name
=
"im_comment"
)
@Data
public
class
ImComment
{
@Id
private
Long
id
;
/**
* 问题Id
*/
@Column
(
name
=
"question_id"
)
private
Long
questionId
;
/**
* 评论类容
*/
private
String
content
;
private
Long
time
;
/**
* 用户id
*/
@Column
(
name
=
"user_id"
)
private
Long
userId
;
/**
* 是否显示
*/
private
Integer
visible
=
1
;
/**
* 是否只有自己可见(评论审核时仅自己可见)
*/
@Column
(
name
=
"visible_own"
)
private
Integer
visibleOwn
=
1
;
/**
* 状态
*/
private
Integer
state
=
0
;
/**
* 是否删除
*/
@Column
(
name
=
"is_del"
)
private
Boolean
isDel
=
false
;
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/entity/ImPraise.java
0 → 100644
View file @
9056c04f
package
com
.
xxfc
.
platform
.
im
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
@Table
(
name
=
"im_praise"
)
@Data
public
class
ImPraise
{
@Id
private
Long
id
;
/**
* 问题id
*/
@Column
(
name
=
"question_id"
)
private
Long
questionId
;
/**
* 用户id
*/
@Column
(
name
=
"user_id"
)
private
Long
userId
;
/**
* 时间
*/
private
Long
time
;
/**
* 状态
*/
private
Integer
state
;
/**
* 是否显示
*/
private
Integer
visible
=
1
;
/**
* 是否删除
*/
@Column
(
name
=
"is_del"
)
private
Boolean
isDel
=
false
;
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/entity/ImQuestion.java
0 → 100644
View file @
9056c04f
package
com
.
xxfc
.
platform
.
im
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
@Table
(
name
=
"im_question"
)
@Data
public
class
ImQuestion
{
@Id
private
Long
id
;
/**
* 标题
*/
private
String
title
;
/**
* 纬度
*/
private
String
latitude
;
/**
* 经度
*/
private
String
longitude
;
/**
* 手机型号
*/
private
String
model
;
/**
* 添加时间
*/
private
Long
time
;
@Column
(
name
=
"user_id"
)
private
Long
userId
;
/**
* 是否显示
* 1,显示, 0、不显示
*/
private
Integer
visible
=
1
;
/**
* 状态
*/
private
Integer
state
;
/**
* 是否删除
*/
@Column
(
name
=
"is_del"
)
private
Boolean
isDel
=
false
;
/**
* 内容
*/
private
String
content
;
private
Integer
commentCount
;
private
Integer
praiseCount
;
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/mapper/ImCommentMapper.java
0 → 100644
View file @
9056c04f
package
com
.
xxfc
.
platform
.
im
.
mapper
;
import
com.xxfc.platform.im.entity.ImComment
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
ImCommentMapper
extends
Mapper
<
ImComment
>
{
List
<
ImComment
>
selectByQuestionId
(
Long
questionId
);
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/mapper/ImPraiseMapper.java
0 → 100644
View file @
9056c04f
package
com
.
xxfc
.
platform
.
im
.
mapper
;
import
com.xxfc.platform.im.entity.ImPraise
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
ImPraiseMapper
extends
Mapper
<
ImPraise
>
{
List
<
ImPraise
>
selectByQuestionId
(
Long
questionId
);
List
<
ImPraise
>
selectByQuestionIdAndTime
(
ImPraise
imPraise
);
}
\ No newline at end of file
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/mapper/ImQuestionMapper.java
0 → 100644
View file @
9056c04f
package
com
.
xxfc
.
platform
.
im
.
mapper
;
import
com.xxfc.platform.im.entity.ImQuestion
;
import
com.xxfc.platform.im.vo.QuestionListVo
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.Map
;
public
interface
ImQuestionMapper
extends
Mapper
<
ImQuestion
>
{
List
<
QuestionListVo
>
getQuestionList
(
Map
<
String
,
Object
>
param
);
}
\ No newline at end of file
xx-im/xx-im-server/src/main/resources/mapper/ImCommentMapper.xml
0 → 100644
View file @
9056c04f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.im.mapper.ImCommentMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.xxfc.platform.im.entity.ImComment"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"question_id"
jdbcType=
"BIGINT"
property=
"questionId"
/>
<result
column=
"content"
jdbcType=
"VARCHAR"
property=
"content"
/>
<result
column=
"time"
jdbcType=
"BIGINT"
property=
"time"
/>
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"visible"
jdbcType=
"INTEGER"
property=
"visible"
/>
<result
column=
"visible_own"
jdbcType=
"INTEGER"
property=
"visibleOwn"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
<result
column=
"is_del"
jdbcType=
"BIT"
property=
"isDel"
/>
</resultMap>
<select
id=
"selectByQuestionId"
resultType=
"com.xxfc.platform.im.entity.ImComment"
parameterType=
"java.lang.Long"
>
select * from im_comment
where question_id = #{questionId} and is_del = 0
</select>
</mapper>
\ No newline at end of file
xx-im/xx-im-server/src/main/resources/mapper/ImPraiseMapper.xml
0 → 100644
View file @
9056c04f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.im.mapper.ImPraiseMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.xxfc.platform.im.entity.ImPraise"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"question_id"
jdbcType=
"BIGINT"
property=
"questionId"
/>
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"time"
jdbcType=
"BIGINT"
property=
"time"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
<result
column=
"visible"
jdbcType=
"INTEGER"
property=
"visible"
/>
<result
column=
"is_del"
jdbcType=
"BIT"
property=
"isDel"
/>
</resultMap>
<select
id=
"selectByQuestionId"
resultType=
"com.xxfc.platform.im.entity.ImPraise"
parameterType=
"java.lang.Long"
>
select * from im_praise
where question_id = #{questionId} and is_del = 0 and visible = 1
</select>
<select
id=
"selectByQuestionIdAndTime"
resultType=
"com.xxfc.platform.im.entity.ImPraise"
parameterType=
"com.xxfc.platform.im.dto.ImPraiseDto"
>
select * from im_praise
where question_id = #{questionId} and is_del = 0 and visible = 1
and time between #{startTime} and #{endTime}
</select>
</mapper>
\ No newline at end of file
xx-im/xx-im-server/src/main/resources/mapper/ImQuestionMapper.xml
0 → 100644
View file @
9056c04f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.im.mapper.ImQuestionMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.xxfc.platform.im.entity.ImQuestion"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"title"
jdbcType=
"VARCHAR"
property=
"title"
/>
<result
column=
"latitude"
jdbcType=
"VARCHAR"
property=
"latitude"
/>
<result
column=
"longitude"
jdbcType=
"VARCHAR"
property=
"longitude"
/>
<result
column=
"model"
jdbcType=
"VARCHAR"
property=
"model"
/>
<result
column=
"time"
jdbcType=
"BIGINT"
property=
"time"
/>
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"visible"
jdbcType=
"INTEGER"
property=
"visible"
/>
<result
column=
"state"
jdbcType=
"VARCHAR"
property=
"state"
/>
<result
column=
"is_del"
jdbcType=
"BIT"
property=
"isDel"
/>
<result
column=
"content"
jdbcType=
"LONGVARCHAR"
property=
"content"
/>
</resultMap>
<resultMap
id=
"listResultMap"
type=
"com.xxfc.platform.im.vo.QuestionListVo"
>
<collection
property=
"imComment"
column=
"id"
select=
"com.xxfc.platform.im.mapper.ImCommentMapper.selectByQuestionId"
ofType=
"com.xxfc.platform.im.entity.ImComment"
>
</collection>
<collection
column=
"id"
property=
"imPraise"
select=
"com.xxfc.platform.im.mapper.ImPraiseMapper.selectByQuestionId"
ofType=
"com.xxfc.platform.im.entity.ImPraise"
></collection>
</resultMap>
<select
id=
"getQuestionList"
parameterType=
"java.util.Map"
resultMap=
"listResultMap"
>
select * from im_question
<where>
<if
test=
"userId != null"
>
and user_id = #{userId}
</if>
<if
test=
"visible != null"
>
and visible = #{visible}
</if>
<if
test=
"state != null"
>
and state = #{state}
</if>
<if
test=
"isDel != null"
>
and is_del = #{isDel}
</if>
</where>
order by time DESC
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment