Browse Source

新增客户档案创建时间与修改时间

anderx 1 year ago
parent
commit
543931aacb

+ 2 - 3
src/main/java/com/goafanti/common/dao/UserArchivesMapper.java

@@ -10,7 +10,7 @@ import java.util.List;
  * 客户档案表(UserArchives)表数据库访问层
  *
  * @author makejava
- * @since 2024-08-12 10:38:57
+ * @since 2024-11-07 11:26:46
  */
 public interface UserArchivesMapper {
 
@@ -22,13 +22,12 @@ public interface UserArchivesMapper {
      */
     UserArchives queryById(Integer id);
 
-    
 
     /**
      * 查询指定行数据
      *
      * @param userArchives 查询条件
-     * @param pageable         分页对象
+     * @param pageable     分页对象
      * @return 对象列表
      */
     List<UserArchives> findUserArchivesList(UserArchives userArchives, @Param("pageable") Pageable pageable);

+ 82 - 27
src/main/java/com/goafanti/common/mapper/UserArchivesMapper.xml

@@ -18,16 +18,19 @@
         <result property="enterpriseCount" column="enterprise_count" jdbcType="INTEGER"/>
         <result property="channelIndicators" column="channel_indicators" jdbcType="VARCHAR"/>
         <result property="interviewDistribution" column="interview_distribution" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="awardsTime" column="awards_time" jdbcType="TIMESTAMP"/>
+        <result property="awardsStatus" column="awards_status" jdbcType="INTEGER"/>
     </resultMap>
-    
+
     <sql id="UserArchivesAllSql">
-id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution        
+        id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution, update_time, awards_time, awards_status
     </sql>
 
     <!--查询单个-->
     <select id="queryById" resultMap="UserArchivesMap">
         select
-          <include refid="UserArchivesAllSql"/>
+        <include refid="UserArchivesAllSql"/>
         from user_archives
         where id = #{id}
     </select>
@@ -35,7 +38,7 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
     <!--查询指定行数据-->
     <select id="findUserArchivesList" resultMap="UserArchivesMap">
         select
-          <include refid="UserArchivesAllSql"/>
+        <include refid="UserArchivesAllSql"/>
 
         from user_archives
         <where>
@@ -84,9 +87,18 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
             <if test="interviewDistribution != null and interviewDistribution != ''">
                 and interview_distribution = #{interviewDistribution}
             </if>
+            <if test="updateTime != null">
+                and update_time = #{updateTime}
+            </if>
+            <if test="awardsTime != null">
+                and awards_time = #{awardsTime}
+            </if>
+            <if test="awardsStatus != null">
+                and awards_status = #{awardsStatus}
+            </if>
         </where>
         <if test="page_sql != null">
-    		${page_sql}
+            ${page_sql}
         </if>
     </select>
 
@@ -140,44 +152,76 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
             <if test="interviewDistribution != null and interviewDistribution != ''">
                 and interview_distribution = #{interviewDistribution}
             </if>
+            <if test="updateTime != null">
+                and update_time = #{updateTime}
+            </if>
+            <if test="awardsTime != null">
+                and awards_time = #{awardsTime}
+            </if>
+            <if test="awardsStatus != null">
+                and awards_status = #{awardsStatus}
+            </if>
         </where>
     </select>
 
     <!--新增所有列-->
     <insert id="insert" keyProperty="id" useGeneratedKeys="true">
-        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution)
-        values (#{uid}, #{patentCount}, #{inventionPatentCount}, #{utilityModelCount}, #{appearancePatentCount}, #{softwareWorksCount}, #{otherCount}, #{financialData}, #{earlyCommunication}, #{interviewIdeas}, #{createTime}, #{enterpriseCount}, #{channelIndicators}, #{interviewDistribution})
+        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count,
+                                  appearance_patent_count, software_works_count, other_count, financial_data,
+                                  early_communication, interview_ideas, create_time, enterprise_count,
+                                  channel_indicators, interview_distribution, update_time, awards_time, awards_status)
+        values (#{uid}, #{patentCount}, #{inventionPatentCount}, #{utilityModelCount}, #{appearancePatentCount},
+                #{softwareWorksCount}, #{otherCount}, #{financialData}, #{earlyCommunication}, #{interviewIdeas},
+                #{createTime}, #{enterpriseCount}, #{channelIndicators}, #{interviewDistribution}, #{updateTime},
+                #{awardsTime}, #{awardsStatus})
     </insert>
 
-    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
-        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution)
+    <insert id="insertBatch">
+        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count,
+        appearance_patent_count, software_works_count, other_count, financial_data, early_communication,
+        interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution, update_time,
+        awards_time, awards_status)
         values
         <foreach collection="entities" item="entity" separator=",">
-        (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime}, #{entity.enterpriseCount}, #{entity.channelIndicators}, #{entity.interviewDistribution})
+            (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount},
+            #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount},
+            #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime},
+            #{entity.enterpriseCount}, #{entity.channelIndicators}, #{entity.interviewDistribution},
+            #{entity.updateTime}, #{entity.awardsTime}, #{entity.awardsStatus})
         </foreach>
     </insert>
 
     <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
-        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other_count, financial_data, early_communication, interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution)
+        insert into user_archives(uid, patent_count, invention_patent_count, utility_model_count,
+        appearance_patent_count, software_works_count, other_count, financial_data, early_communication,
+        interview_ideas, create_time, enterprise_count, channel_indicators, interview_distribution, update_time,
+        awards_time, awards_status)
         values
         <foreach collection="entities" item="entity" separator=",">
-            (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime}, #{entity.enterpriseCount}, #{entity.channelIndicators}, #{entity.interviewDistribution})
+            (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount},
+            #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount},
+            #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime},
+            #{entity.enterpriseCount}, #{entity.channelIndicators}, #{entity.interviewDistribution},
+            #{entity.updateTime}, #{entity.awardsTime}, #{entity.awardsStatus})
         </foreach>
         on duplicate key update
-uid = values(uid),
-patent_count = values(patent_count),
-invention_patent_count = values(invention_patent_count),
-utility_model_count = values(utility_model_count),
-appearance_patent_count = values(appearance_patent_count),
-software_works_count = values(software_works_count),
-other_count = values(other_count),
-financial_data = values(financial_data),
-early_communication = values(early_communication),
-interview_ideas = values(interview_ideas),
-create_time = values(create_time),
-enterprise_count = values(enterprise_count),
-channel_indicators = values(channel_indicators),
-interview_distribution = values(interview_distribution)
+        uid = values(uid),
+        patent_count = values(patent_count),
+        invention_patent_count = values(invention_patent_count),
+        utility_model_count = values(utility_model_count),
+        appearance_patent_count = values(appearance_patent_count),
+        software_works_count = values(software_works_count),
+        other_count = values(other_count),
+        financial_data = values(financial_data),
+        early_communication = values(early_communication),
+        interview_ideas = values(interview_ideas),
+        create_time = values(create_time),
+        enterprise_count = values(enterprise_count),
+        channel_indicators = values(channel_indicators),
+        interview_distribution = values(interview_distribution),
+        update_time = values(update_time),
+        awards_time = values(awards_time),
+        awards_status = values(awards_status)
     </insert>
 
     <!--通过主键修改数据-->
@@ -226,13 +270,24 @@ interview_distribution = values(interview_distribution)
             <if test="interviewDistribution != null and interviewDistribution != ''">
                 interview_distribution = #{interviewDistribution},
             </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime},
+            </if>
+            <if test="awardsTime != null">
+                awards_time = #{awardsTime},
+            </if>
+            <if test="awardsStatus != null">
+                awards_status = #{awardsStatus},
+            </if>
         </set>
         where id = #{id}
     </update>
 
     <!--通过主键删除-->
     <delete id="deleteById">
-        delete from user_archives where id = #{id}
+        delete
+        from user_archives
+        where id = #{id}
     </delete>
 
     <select id="queryByUid" resultMap="UserArchivesMap">

+ 51 - 15
src/main/java/com/goafanti/common/model/UserArchives.java

@@ -10,66 +10,78 @@ import java.util.Date;
  * 客户档案表(UserArchives)实体类
  *
  * @author makejava
- * @since 2024-08-12 10:38:57
+ * @since 2024-11-07 11:26:46
  */
 public class UserArchives implements Serializable {
-    private static final long serialVersionUID = -61985340141600786L;
+    private static final long serialVersionUID = 430576271799432429L;
 
     private Integer id;
 
     private String uid;
-/**
+    /**
      * 专利数
      */
     private Integer patentCount;
-/**
+    /**
      * 发明专利数
      */
     private Integer inventionPatentCount;
-/**
+    /**
      * 实用新型数
      */
     private Integer utilityModelCount;
-/**
+    /**
      * 外观专利数
      */
     private Integer appearancePatentCount;
-/**
+    /**
      * 软著数
      */
     private Integer softwareWorksCount;
-/**
+    /**
      * 其他数
      */
     private Integer otherCount;
-/**
+    /**
      * 财务数据
      */
     private String financialData;
-/**
+    /**
      * 前期沟通
      */
     private String earlyCommunication;
-/**
+    /**
      * 面谈思路
      */
     private String interviewIdeas;
-/**
+    /**
      * 创建时间
      */
     private Date createTime;
-/**
+    /**
      * 企业数
      */
     private Integer enterpriseCount;
-/**
+    /**
      * 渠道考核指标
      */
     private String channelIndicators;
-/**
+    /**
      * 我方主要面谈及分工
      */
     private String interviewDistribution;
+    /**
+     * 修改时间
+     */
+    private Date updateTime;
+    /**
+     * 获奖时间
+     */
+    private Date awardsTime;
+    /**
+     * 获奖状态 0=未参评,1=已参评,2=已获奖
+     */
+    private Integer awardsStatus;
 
 
     public Integer getId() {
@@ -193,5 +205,29 @@ public class UserArchives implements Serializable {
         this.interviewDistribution = interviewDistribution;
     }
 
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Date getAwardsTime() {
+        return awardsTime;
+    }
+
+    public void setAwardsTime(Date awardsTime) {
+        this.awardsTime = awardsTime;
+    }
+
+    public Integer getAwardsStatus() {
+        return awardsStatus;
+    }
+
+    public void setAwardsStatus(Integer awardsStatus) {
+        this.awardsStatus = awardsStatus;
+    }
+
 }
 

+ 4 - 0
src/main/java/com/goafanti/customer/service/impl/UserArchivesServiceImpl.java

@@ -141,6 +141,9 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
                 userArchives.setPatentCount(count);
             }
             if(userArchives.getPatentCount()==null)userArchives.setPatentCount(0);
+            Date date = new Date();
+            userArchives.setCreateTime(date);
+            userArchives.setUpdateTime(date);
             this.userArchivesMapper.insert(userArchives);
         }
         return userArchives;
@@ -177,6 +180,7 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
             return insert(userArchives);
         }else {
             addUserLog( userArchives);
+            userArchives.setUpdateTime(new Date());
             this.userArchivesMapper.update(userArchives);
             return this.queryById(userArchives.getId());
         }