Browse Source

新增客户档案面谈表

anderx 9 months ago
parent
commit
0871661dc7

+ 85 - 0
src/main/java/com/goafanti/common/dao/UserArchivesInterviewMapper.java

@@ -0,0 +1,85 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.UserArchivesInterview;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.List;
+
+/**
+ * 客户档案面谈表(UserArchivesInterview)表数据库访问层
+ *
+ * @author makejava
+ * @since 2025-04-10 17:06:17
+ */
+public interface UserArchivesInterviewMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    UserArchivesInterview selectById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param userArchivesInterview 查询条件
+     * @param pageable              分页对象
+     * @return 对象列表
+     */
+    List<UserArchivesInterview> findUserArchivesInterviewList(UserArchivesInterview userArchivesInterview, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param userArchivesInterview 查询条件
+     * @return 总行数
+     */
+    int findUserArchivesInterviewCount(UserArchivesInterview userArchivesInterview);
+
+    /**
+     * 新增数据
+     *
+     * @param userArchivesInterview 实例对象
+     * @return 影响行数
+     */
+    int insert(UserArchivesInterview userArchivesInterview);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<UserArchivesInterview> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<UserArchivesInterview> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<UserArchivesInterview> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<UserArchivesInterview> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param userArchivesInterview 实例对象
+     * @return 影响行数
+     */
+    int update(UserArchivesInterview userArchivesInterview);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+}
+

+ 205 - 0
src/main/java/com/goafanti/common/mapper/UserArchivesInterviewMapper.xml

@@ -0,0 +1,205 @@
+<?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.goafanti.common.dao.UserArchivesInterviewMapper">
+
+    <resultMap type="com.goafanti.common.model.UserArchivesInterview" id="UserArchivesInterviewMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="uid" column="uid" jdbcType="VARCHAR"/>
+        <result property="aid" column="aid" jdbcType="VARCHAR"/>
+        <result property="counts" column="counts" jdbcType="INTEGER"/>
+        <result property="earlyCommunication" column="early_communication" jdbcType="VARCHAR"/>
+        <result property="customerDemand" column="customer_demand" jdbcType="VARCHAR"/>
+        <result property="interviewIdeas" column="interview_ideas" jdbcType="VARCHAR"/>
+        <result property="interviewPurpose" column="interview_purpose" jdbcType="VARCHAR"/>
+        <result property="interviewRecommend" column="interview_recommend" jdbcType="VARCHAR"/>
+        <result property="interviewFeedback" column="interview_feedback" jdbcType="VARCHAR"/>
+        <result property="followUpPlan" column="follow_up_plan" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <sql id="UserArchivesInterviewAllSql">
+        id, uid, aid, counts, early_communication, customer_demand, interview_ideas, interview_purpose, interview_recommend, interview_feedback, follow_up_plan
+    </sql>
+
+    <!--查询单个-->
+    <select id="selectById" resultMap="UserArchivesInterviewMap">
+        select
+        <include refid="UserArchivesInterviewAllSql"/>
+        from user_archives_interview
+        where id = #{id}
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into user_archives_interview(uid, aid, counts, early_communication, customer_demand, interview_ideas,
+                                            interview_purpose, interview_recommend, interview_feedback, follow_up_plan)
+        values (#{uid}, #{aid}, #{counts}, #{earlyCommunication}, #{customerDemand}, #{interviewIdeas},
+                #{interviewPurpose}, #{interviewRecommend}, #{interviewFeedback}, #{followUpPlan})
+    </insert>
+
+    <insert id="insertBatch">
+        insert into user_archives_interview(uid, aid, counts, early_communication, customer_demand, interview_ideas,
+        interview_purpose, interview_recommend, interview_feedback, follow_up_plan)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.aid}, #{entity.counts}, #{entity.earlyCommunication}, #{entity.customerDemand},
+            #{entity.interviewIdeas}, #{entity.interviewPurpose}, #{entity.interviewRecommend},
+            #{entity.interviewFeedback}, #{entity.followUpPlan})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into user_archives_interview(uid, aid, counts, early_communication, customer_demand, interview_ideas,
+        interview_purpose, interview_recommend, interview_feedback, follow_up_plan)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.uid}, #{entity.aid}, #{entity.counts}, #{entity.earlyCommunication}, #{entity.customerDemand},
+            #{entity.interviewIdeas}, #{entity.interviewPurpose}, #{entity.interviewRecommend},
+            #{entity.interviewFeedback}, #{entity.followUpPlan})
+        </foreach>
+        on duplicate key update
+        uid = values(uid),
+        aid = values(aid),
+        counts = values(counts),
+        early_communication = values(early_communication),
+        customer_demand = values(customer_demand),
+        interview_ideas = values(interview_ideas),
+        interview_purpose = values(interview_purpose),
+        interview_recommend = values(interview_recommend),
+        interview_feedback = values(interview_feedback),
+        follow_up_plan = values(follow_up_plan)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update user_archives_interview
+        <set>
+            <if test="uid != null and uid != ''">
+                uid = #{uid},
+            </if>
+            <if test="aid != null and aid != ''">
+                aid = #{aid},
+            </if>
+            <if test="counts != null">
+                counts = #{counts},
+            </if>
+            <if test="earlyCommunication != null and earlyCommunication != ''">
+                early_communication = #{earlyCommunication},
+            </if>
+            <if test="customerDemand != null and customerDemand != ''">
+                customer_demand = #{customerDemand},
+            </if>
+            <if test="interviewIdeas != null and interviewIdeas != ''">
+                interview_ideas = #{interviewIdeas},
+            </if>
+            <if test="interviewPurpose != null and interviewPurpose != ''">
+                interview_purpose = #{interviewPurpose},
+            </if>
+            <if test="interviewRecommend != null and interviewRecommend != ''">
+                interview_recommend = #{interviewRecommend},
+            </if>
+            <if test="interviewFeedback != null and interviewFeedback != ''">
+                interview_feedback = #{interviewFeedback},
+            </if>
+            <if test="followUpPlan != null and followUpPlan != ''">
+                follow_up_plan = #{followUpPlan},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <!--查询指定行数据-->
+    <select id="findUserArchivesInterviewList" resultMap="UserArchivesInterviewMap">
+        select
+        <include refid="UserArchivesInterviewAllSql"/>
+
+        from user_archives_interview
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="uid != null and uid != ''">
+                and uid = #{uid}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="counts != null">
+                and counts = #{counts}
+            </if>
+            <if test="earlyCommunication != null and earlyCommunication != ''">
+                and early_communication = #{earlyCommunication}
+            </if>
+            <if test="customerDemand != null and customerDemand != ''">
+                and customer_demand = #{customerDemand}
+            </if>
+            <if test="interviewIdeas != null and interviewIdeas != ''">
+                and interview_ideas = #{interviewIdeas}
+            </if>
+            <if test="interviewPurpose != null and interviewPurpose != ''">
+                and interview_purpose = #{interviewPurpose}
+            </if>
+            <if test="interviewRecommend != null and interviewRecommend != ''">
+                and interview_recommend = #{interviewRecommend}
+            </if>
+            <if test="interviewFeedback != null and interviewFeedback != ''">
+                and interview_feedback = #{interviewFeedback}
+            </if>
+            <if test="followUpPlan != null and followUpPlan != ''">
+                and follow_up_plan = #{followUpPlan}
+            </if>
+        </where>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="findUserArchivesInterviewCount" resultType="java.lang.Integer">
+        select count(1)
+        from user_archives_interview
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="uid != null and uid != ''">
+                and uid = #{uid}
+            </if>
+            <if test="aid != null and aid != ''">
+                and aid = #{aid}
+            </if>
+            <if test="counts != null">
+                and counts = #{counts}
+            </if>
+            <if test="earlyCommunication != null and earlyCommunication != ''">
+                and early_communication = #{earlyCommunication}
+            </if>
+            <if test="customerDemand != null and customerDemand != ''">
+                and customer_demand = #{customerDemand}
+            </if>
+            <if test="interviewIdeas != null and interviewIdeas != ''">
+                and interview_ideas = #{interviewIdeas}
+            </if>
+            <if test="interviewPurpose != null and interviewPurpose != ''">
+                and interview_purpose = #{interviewPurpose}
+            </if>
+            <if test="interviewRecommend != null and interviewRecommend != ''">
+                and interview_recommend = #{interviewRecommend}
+            </if>
+            <if test="interviewFeedback != null and interviewFeedback != ''">
+                and interview_feedback = #{interviewFeedback}
+            </if>
+            <if test="followUpPlan != null and followUpPlan != ''">
+                and follow_up_plan = #{followUpPlan}
+            </if>
+        </where>
+    </select>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from user_archives_interview
+        where id = #{id}
+    </delete>
+
+</mapper>
+

+ 147 - 0
src/main/java/com/goafanti/common/model/UserArchivesInterview.java

@@ -0,0 +1,147 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+
+
+/**
+ * 客户档案面谈表(UserArchivesInterview)实体类
+ *
+ * @author makejava
+ * @since 2025-04-10 17:06:17
+ */
+public class UserArchivesInterview implements Serializable {
+    private static final long serialVersionUID = -68941623603526443L;
+
+    private Integer id;
+    /**
+     * 客户编号
+     */
+    private String uid;
+    /**
+     * 跟进人编号
+     */
+    private String aid;
+    /**
+     * 次数
+     */
+    private Integer counts;
+    /**
+     * 前期沟通-客户的难处
+     */
+    private String earlyCommunication;
+    /**
+     * 客户的需求
+     */
+    private String customerDemand;
+    /**
+     * 面谈思路
+     */
+    private String interviewIdeas;
+    /**
+     * 面谈达成的目的
+     */
+    private String interviewPurpose;
+    /**
+     * 经理/上级面谈建议
+     */
+    private String interviewRecommend;
+    /**
+     * 面谈后反馈
+     */
+    private String interviewFeedback;
+    /**
+     * 后续跟进计划
+     */
+    private String followUpPlan;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Integer getCounts() {
+        return counts;
+    }
+
+    public void setCounts(Integer counts) {
+        this.counts = counts;
+    }
+
+    public String getEarlyCommunication() {
+        return earlyCommunication;
+    }
+
+    public void setEarlyCommunication(String earlyCommunication) {
+        this.earlyCommunication = earlyCommunication;
+    }
+
+    public String getCustomerDemand() {
+        return customerDemand;
+    }
+
+    public void setCustomerDemand(String customerDemand) {
+        this.customerDemand = customerDemand;
+    }
+
+    public String getInterviewIdeas() {
+        return interviewIdeas;
+    }
+
+    public void setInterviewIdeas(String interviewIdeas) {
+        this.interviewIdeas = interviewIdeas;
+    }
+
+    public String getInterviewPurpose() {
+        return interviewPurpose;
+    }
+
+    public void setInterviewPurpose(String interviewPurpose) {
+        this.interviewPurpose = interviewPurpose;
+    }
+
+    public String getInterviewRecommend() {
+        return interviewRecommend;
+    }
+
+    public void setInterviewRecommend(String interviewRecommend) {
+        this.interviewRecommend = interviewRecommend;
+    }
+
+    public String getInterviewFeedback() {
+        return interviewFeedback;
+    }
+
+    public void setInterviewFeedback(String interviewFeedback) {
+        this.interviewFeedback = interviewFeedback;
+    }
+
+    public String getFollowUpPlan() {
+        return followUpPlan;
+    }
+
+    public void setFollowUpPlan(String followUpPlan) {
+        this.followUpPlan = followUpPlan;
+    }
+
+}
+