Commit 14f3567f by zhaolianjie

Merge remote-tracking branch 'origin/master'

2 parents 7af4980f 89cc7298
......@@ -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;
}
......
......@@ -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);
}
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();
}
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;
}
......@@ -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);
}
}
......@@ -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}
......
<?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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!