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 14f3567f
authored
Oct 15, 2022
by
zhaolianjie
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
7af4980f
89cc7298
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
167 additions
and
4 deletions
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
src/main/java/com/pipihelper/project/feishu/dao/EmployeeDao.java
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
src/main/java/com/pipihelper/project/feishu/entity/Pain.java
src/main/java/com/pipihelper/project/feishu/service/EmployeeService.java
src/main/resources/mybatis/EmployeeMapper.xml
src/main/resources/mybatis/PainMapper.xml
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
View file @
14f3567
...
...
@@ -144,7 +144,8 @@ public class FeiShuEventController {
@PostMapping
(
"/employee-list"
)
public
Object
event
()
{
//employeeService.uprsetAllEmployee();
employeeService
.
uprsetAllEmployee
();
employeeService
.
findStartList
(
1
,
14
,
30
);
List
<
FeiShuEmployeeDTO
>
dtos
=
feiShuApiService
.
getEmployeeList
();
return
dtos
;
}
...
...
src/main/java/com/pipihelper/project/feishu/dao/EmployeeDao.java
View file @
14f3567
...
...
@@ -2,6 +2,7 @@ package com.pipihelper.project.feishu.dao;
import
com.pipihelper.project.feishu.entity.Employee
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -19,4 +20,6 @@ public interface EmployeeDao {
void
update
(
Employee
employee
);
List
<
Employee
>
findAll
();
List
<
Employee
>
findStartList
(
@Param
(
value
=
"startId"
)
int
startId
,
@Param
(
value
=
"floor"
)
int
floor
,
@Param
(
value
=
"limit"
)
int
limit
);
}
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
0 → 100644
View file @
14f3567
package
com
.
pipihelper
.
project
.
feishu
.
dao
;
import
com.pipihelper.project.feishu.entity.Pain
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
PainDao
{
Pain
findById
(
Integer
id
);
Pain
findByOpenId
(
String
openId
);
void
deleteById
(
Integer
id
);
void
create
(
Pain
pain
);
void
update
(
Pain
pain
);
List
<
Pain
>
findAll
();
}
src/main/java/com/pipihelper/project/feishu/entity/Pain.java
0 → 100644
View file @
14f3567
package
com
.
pipihelper
.
project
.
feishu
.
entity
;
import
lombok.Data
;
@Data
public
class
Pain
{
private
Integer
id
;
private
String
openId
;
private
Integer
index
;
private
Integer
status
;
private
String
timeRange
;
private
Integer
floor
;
private
String
messageId
;
}
src/main/java/com/pipihelper/project/feishu/service/EmployeeService.java
View file @
14f3567
...
...
@@ -79,4 +79,8 @@ public class EmployeeService {
this
.
create
(
employee
);
});
}
public
List
<
Employee
>
findStartList
(
int
startId
,
int
floor
,
int
limit
)
{
return
employeeDao
.
findStartList
(
startId
,
floor
,
limit
);
}
}
src/main/resources/mybatis/EmployeeMapper.xml
View file @
14f3567
...
...
@@ -9,6 +9,7 @@
<result
column=
"name"
property=
"name"
/>
<result
column=
"gender"
property=
"gender"
/>
<result
column=
"department_id"
property=
"departmentId"
/>
<result
column=
"floor"
property=
"floor"
/>
</resultMap>
...
...
@@ -17,7 +18,7 @@
</resultMap>-->
<sql
id=
"Base_Column_List"
>
id,open_id,mobile,name,gender,department_id
id,open_id,mobile,name,gender,department_id
,floor
</sql>
<select
id=
"findById"
parameterType=
"java.lang.Integer"
resultMap=
"EmployeeResultMap"
>
...
...
@@ -30,6 +31,17 @@
</select>
<select
id=
"findStartList"
resultMap=
"EmployeeResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_employee
<where>
id >= #{id}
and floor = #{floor}
limit #{limit};
</where>
</select>
<select
id=
"findByOpenId"
parameterType=
"java.lang.String"
resultMap=
"EmployeeResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
@@ -54,8 +66,8 @@
<insert
id=
"create"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.pipihelper.project.feishu.entity.Employee"
>
insert into t_employee (open_id, mobile, name, gender, status, department_id)
values (#{openId}, #{mobile}, #{name}, #{gender}, #{status}, #{departmentId})
insert into t_employee (open_id, mobile, name, gender, status, department_id
,floor
)
values (#{openId}, #{mobile}, #{name}, #{gender}, #{status}, #{departmentId}
,#{floor}
)
</insert>
<update
id=
"update"
parameterType=
"com.pipihelper.project.feishu.entity.Employee"
>
...
...
@@ -79,6 +91,9 @@
<if
test=
"departmentId != null"
>
department_id = #{departmentId},
</if>
<if
test=
"floor != null"
>
floor = #{floor},
</if>
</set>
<where>
id = #{id}
...
...
src/main/resources/mybatis/PainMapper.xml
0 → 100644
View file @
14f3567
<?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.PainDao"
>
<resultMap
id=
"PainResultMap"
type=
"com.pipihelper.project.feishu.entity.Pain"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"open_id"
property=
"openId"
/>
<result
column=
"start_time"
property=
"start_time"
/>
<result
column=
"end_time"
property=
"end_time"
/>
<result
column=
"status"
property=
"status"
/>
<result
column=
"floor"
property=
"floor"
/>
<result
column=
"messageId"
property=
"messageId"
/>
</resultMap>
<!-- <resultMap id="BuffConfigResultBOMap" type="com.pipihelper.project.feishu.entity.Deployee"
extends="PainResultMap">
</resultMap>-->
<sql
id=
"Base_Column_List"
>
id,open_id,start_time,end_time,status,floor
</sql>
<select
id=
"findById"
parameterType=
"java.lang.Integer"
resultMap=
"PainResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_pain
<where>
id = #{id}
</where>
</select>
<select
id=
"findStartList"
resultMap=
"PainResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_pain
<where>
id >= #{id}
and floor = #{floor}
limit #{limit};
</where>
</select>
<select
id=
"findByOpenId"
parameterType=
"java.lang.String"
resultMap=
"PainResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_pain
<where>
open_id = #{openId}
</where>
</select>
<select
id=
"findAll"
resultMap=
"PainResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_pain
</select>
<delete
id=
"deleteById"
parameterType=
"java.lang.Integer"
>
delete from t_pain
<where>
id = #{id}
</where>
</delete>
<insert
id=
"create"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"com.pipihelper.project.feishu.entity.Employee"
>
insert into t_pain (open_id, start_time, end_time, status, floor,message_id)
values (#{openId}, #{startTime}, #{endTime}, #{status},#{floor},#{messageId})
</insert>
<update
id=
"update"
parameterType=
"com.pipihelper.project.feishu.entity.Employee"
>
update t_pain
<set>
<if
test=
"openId != null"
>
open_id = #{openId},
</if>
<if
test=
"startTime != null"
>
start_time = #{startTime},
</if>
<if
test=
"endTime != null"
>
end_time = #{endTime},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"floor != null"
>
floor = #{floor},
</if>
<if
test=
"messageId != null"
>
message_id = #{messageId},
</if>
</set>
<where>
id = #{id}
</where>
</update>
</mapper>
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