Commit ed7607dd by zhaolianjie

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
#	src/main/java/com/pipihelper/project/feishu/service/PainService.java
2 parents c3746196 8ff53591
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);
}
......@@ -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;
......@@ -22,4 +23,7 @@ public interface PainDao {
void waitPain(Pain pain);
List<Pain> findListAsc(int limit);
List<Pain> findBackIndex(@Param(value = "openId") String openId,@Param(value = "limit") int limit);
}
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;
}
......@@ -44,4 +44,12 @@ public class PainService {
}
public List<Pain> findListAsc(int limit) {
return painDao.findListAsc(limit);
}
public List<Pain> findBackIndex(String openId,int limit) {
return painDao.findBackIndex(openId,limit);
}
}
<?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>
......@@ -36,7 +36,7 @@
<include refid="Base_Column_List"/>
from t_employee
<where>
id >= #{startId}
id > #{startId}
and floor = #{floor}
limit #{limit};
</where>
......
......@@ -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"/>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!