Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
zhangshaowu
/
pipi-helper
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e1210d96
authored
Oct 15, 2022
by
liushuangwu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
pain
1 parent
237e9dba
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
151 additions
and
0 deletions
src/main/java/com/pipihelper/project/feishu/dao/ChatMessageDao.java
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
src/main/java/com/pipihelper/project/feishu/entity/ChatMessage.java
src/main/java/com/pipihelper/project/feishu/service/PainService.java
src/main/resources/mybatis/ChatMessageMapper.xml
src/main/resources/mybatis/PainMapper.xml
src/main/java/com/pipihelper/project/feishu/dao/ChatMessageDao.java
0 → 100644
View file @
e1210d9
package
com
.
pipihelper
.
project
.
feishu
.
dao
;
import
com.pipihelper.project.feishu.entity.ChatMessage
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
ChatMessageDao
{
ChatMessage
findById
(
Integer
id
);
void
deleteById
(
Integer
id
);
void
create
(
ChatMessage
ChatMessage
);
void
update
(
ChatMessage
ChatMessage
);
List
<
ChatMessage
>
findAll
();
List
<
ChatMessage
>
findListChatAndType
(
@Param
(
value
=
"chatId"
)
String
chatId
,
@Param
(
value
=
"type"
)
Integer
type
);
}
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
View file @
e1210d9
...
...
@@ -2,6 +2,7 @@ package com.pipihelper.project.feishu.dao;
import
com.pipihelper.project.feishu.entity.Pain
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -20,4 +21,7 @@ public interface PainDao {
List
<
Pain
>
findAll
();
List
<
Pain
>
findListAsc
(
int
limit
);
List
<
Pain
>
findBackIndex
(
@Param
(
value
=
"openId"
)
String
openId
,
@Param
(
value
=
"limit"
)
int
limit
);
}
src/main/java/com/pipihelper/project/feishu/entity/ChatMessage.java
0 → 100644
View file @
e1210d9
package
com
.
pipihelper
.
project
.
feishu
.
entity
;
import
lombok.Data
;
@Data
public
class
ChatMessage
{
private
Integer
id
;
private
String
chatId
;
private
String
messageId
;
private
Integer
type
;
}
src/main/java/com/pipihelper/project/feishu/service/PainService.java
View file @
e1210d9
...
...
@@ -36,4 +36,12 @@ public class PainService {
public
List
<
Pain
>
findAll
()
{
return
painDao
.
findAll
();
}
public
List
<
Pain
>
findListAsc
(
int
limit
)
{
return
painDao
.
findListAsc
(
limit
);
}
public
List
<
Pain
>
findBackIndex
(
String
openId
,
int
limit
)
{
return
painDao
.
findBackIndex
(
openId
,
limit
);
}
}
src/main/resources/mybatis/ChatMessageMapper.xml
0 → 100644
View file @
e1210d9
<?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.pipihelper.project.feishu.dao.ChatMessageDao"
>
<resultMap
id=
"ChatMessageResultMap"
type=
"com.pipihelper.project.feishu.entity.ChatMessage"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"chat_id"
property=
"chatId"
/>
<result
column=
"message_id"
property=
"messageId"
/>
<result
column=
"type"
property=
"type"
/>
</resultMap>
<!-- <resultMap id="BuffConfigResultBOMap" type="com.pipihelper.project.feishu.entity.Deployee"
extends="ChatMessageResultMap">
</resultMap>-->
<sql
id=
"Base_Column_List"
>
id,chat_id,message_id,type
</sql>
<select
id=
"findById"
parameterType=
"java.lang.Integer"
resultMap=
"ChatMessageResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_chat_message
<where>
id = #{id}
</where>
</select>
<select
id=
"findListChatAndType"
resultMap=
"ChatMessageResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_chat_message
<where>
<if
test=
"chatId != null"
>
and chat_id = #{chatId}
</if>
<if
test=
"type != null"
>
and type = #{type}
</if>
</where>
</select>
<select
id=
"findAll"
resultMap=
"ChatMessageResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_chat_message
</select>
<delete
id=
"deleteById"
parameterType=
"java.lang.Integer"
>
delete from t_chat_message
<where>
id = #{id}
</where>
</delete>
<insert
id=
"create"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.pipihelper.project.feishu.entity.Employee"
>
insert into t_chat_message (chat_id, message_id, type)
values ( #{chatId}, #{messageId},#{type})
</insert>
<update
id=
"update"
parameterType=
"com.pipihelper.project.feishu.entity.Employee"
>
update t_chat_message
<set>
<if
test=
"chatId != null"
>
chat_id = #{chatId},
</if>
<if
test=
"messageId != null"
>
message_id = #{messageId},
</if>
<if
test=
"type != null"
>
type = #{type},
</if>
</set>
<where>
id = #{id}
</where>
</update>
</mapper>
src/main/resources/mybatis/PainMapper.xml
View file @
e1210d9
...
...
@@ -30,6 +30,27 @@
</where>
</select>
<select
id=
"findBackIndex"
resultMap=
"PainResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_pain
<where>
index >= #{index}
order by index asc
limit #{limit}
</where>
</select>
<select
id=
"findListAsc"
parameterType=
"java.lang.Integer"
resultMap=
"PainResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_pain
<where>
order by index asc
limit #{limit}
</where>
</select>
<select
id=
"findByOpenId"
parameterType=
"java.lang.String"
resultMap=
"PainResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment