7 changed files with 230 additions and 0 deletions
@ -0,0 +1,69 @@ |
|||
package com.example.web.entity; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.time.LocalDateTime; |
|||
|
|||
/** |
|||
* 客户历史跟进记录表实体类 |
|||
*/ |
|||
@Data |
|||
@NoArgsConstructor |
|||
public class UserFollowupHistory { |
|||
private Integer id; // 主键ID
|
|||
private String user_id; // 关联的用户ID,对应users表的userId
|
|||
private String followup_content; // 跟进内容
|
|||
private String followup_person; // 跟进人
|
|||
private String phone_number; // 客户电话号码
|
|||
private LocalDateTime created_at; // 创建时间
|
|||
|
|||
public Integer getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Integer id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getUser_id() { |
|||
return user_id; |
|||
} |
|||
|
|||
public void setUser_id(String user_id) { |
|||
this.user_id = user_id; |
|||
} |
|||
|
|||
public String getFollowup_content() { |
|||
return followup_content; |
|||
} |
|||
|
|||
public void setFollowup_content(String followup_content) { |
|||
this.followup_content = followup_content; |
|||
} |
|||
|
|||
public String getFollowup_person() { |
|||
return followup_person; |
|||
} |
|||
|
|||
public void setFollowup_person(String followup_person) { |
|||
this.followup_person = followup_person; |
|||
} |
|||
|
|||
public String getPhone_number() { |
|||
return phone_number; |
|||
} |
|||
|
|||
public void setPhone_number(String phone_number) { |
|||
this.phone_number = phone_number; |
|||
} |
|||
|
|||
public LocalDateTime getCreated_at() { |
|||
return created_at; |
|||
} |
|||
|
|||
public void setCreated_at(LocalDateTime created_at) { |
|||
this.created_at = created_at; |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package com.example.web.mapper; |
|||
|
|||
import com.example.web.entity.UserFollowupHistory; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 客户历史跟进记录表Mapper |
|||
*/ |
|||
@Mapper |
|||
public interface UserFollowupHistoryMapper { |
|||
/** |
|||
* 插入跟进记录 |
|||
* @param userFollowupHistory 跟进记录实体 |
|||
* @return 影响行数 |
|||
*/ |
|||
int insert(UserFollowupHistory userFollowupHistory); |
|||
|
|||
/** |
|||
* 根据用户ID查询跟进记录 |
|||
* @param user_id 用户ID |
|||
* @return 跟进记录列表 |
|||
*/ |
|||
List<UserFollowupHistory> selectByUserId(@Param("user_id") String user_id); |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
<?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.example.web.mapper.UserFollowupHistoryMapper"> |
|||
<resultMap id="BaseResultMap" type="com.example.web.entity.UserFollowupHistory"> |
|||
<id column="id" property="id" /> |
|||
<result column="user_id" property="user_id" /> |
|||
<result column="followup_content" property="followup_content" /> |
|||
<result column="followup_person" property="followup_person" /> |
|||
<result column="phone_number" property="phone_number" /> |
|||
<result column="created_at" property="created_at" /> |
|||
</resultMap> |
|||
|
|||
<insert id="insert" parameterType="com.example.web.entity.UserFollowupHistory"> |
|||
INSERT INTO user_followup_history (user_id, followup_content, followup_person, phone_number, created_at) |
|||
VALUES (#{user_id}, #{followup_content}, #{followup_person}, #{phone_number}, #{created_at}) |
|||
</insert> |
|||
|
|||
<select id="selectByUserId" resultMap="BaseResultMap"> |
|||
SELECT id, user_id, followup_content, followup_person, phone_number, created_at |
|||
FROM user_followup_history |
|||
WHERE user_id = #{user_id} |
|||
ORDER BY created_at DESC |
|||
</select> |
|||
</mapper> |
|||
Loading…
Reference in new issue