Explorar o código

用户档案新增与修改

anderx hai 1 ano
pai
achega
106517b4c6

+ 22 - 19
src/main/java/com/goafanti/common/mapper/UserArchivesMapper.xml

@@ -10,17 +10,21 @@
         <result property="utilityModelCount" column="utility_model_count" jdbcType="INTEGER"/>
         <result property="appearancePatentCount" column="appearance_patent_count" jdbcType="INTEGER"/>
         <result property="softwareWorksCount" column="software_works_count" jdbcType="INTEGER"/>
-        <result property="other" column="other" jdbcType="INTEGER"/>
+        <result property="otherCount" column="other_count" jdbcType="INTEGER"/>
         <result property="financialData" column="financial_data" jdbcType="VARCHAR"/>
         <result property="earlyCommunication" column="early_communication" jdbcType="VARCHAR"/>
         <result property="interviewIdeas" column="interview_ideas" jdbcType="VARCHAR"/>
         <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
     </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        
+    </sql>
 
     <!--查询单个-->
     <select id="queryById" resultMap="UserArchivesMap">
         select
-id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other, financial_data, early_communication, interview_ideas, create_time
+          <include refid="UserArchivesAllSql"/>
         from user_archives
         where id = #{id}
     </select>
@@ -28,7 +32,8 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
     <!--查询指定行数据-->
     <select id="findUserArchivesList" resultMap="UserArchivesMap">
         select
-id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other, financial_data, early_communication, interview_ideas, create_time
+          <include refid="UserArchivesAllSql"/>
+
         from user_archives
         <where>
             <if test="id != null">
@@ -52,8 +57,8 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
             <if test="softwareWorksCount != null">
                 and software_works_count = #{softwareWorksCount}
             </if>
-            <if test="other != null">
-                and other = #{other}
+            <if test="otherCount != null">
+                and other_count = #{otherCount}
             </if>
             <if test="financialData != null and financialData != ''">
                 and financial_data = #{financialData}
@@ -97,8 +102,8 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
             <if test="softwareWorksCount != null">
                 and software_works_count = #{softwareWorksCount}
             </if>
-            <if test="other != null">
-                and other = #{other}
+            <if test="otherCount != null">
+                and other_count = #{otherCount}
             </if>
             <if test="financialData != null and financialData != ''">
                 and financial_data = #{financialData}
@@ -118,23 +123,23 @@ id, uid, patent_count, invention_patent_count, utility_model_count, appearance_p
 
     <!--新增所有列-->
     <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, financial_data, early_communication, interview_ideas, create_time)
-        values (#{uid}, #{patentCount}, #{inventionPatentCount}, #{utilityModelCount}, #{appearancePatentCount}, #{softwareWorksCount}, #{other}, #{financialData}, #{earlyCommunication}, #{interviewIdeas}, #{createTime})
+        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)
+        values (#{uid}, #{patentCount}, #{inventionPatentCount}, #{utilityModelCount}, #{appearancePatentCount}, #{softwareWorksCount}, #{otherCount}, #{financialData}, #{earlyCommunication}, #{interviewIdeas}, #{createTime})
     </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, financial_data, early_communication, interview_ideas, create_time)
+        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)
         values
         <foreach collection="entities" item="entity" separator=",">
-        (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.other}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime})
+        (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime})
         </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, financial_data, early_communication, interview_ideas, create_time)
+        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)
         values
         <foreach collection="entities" item="entity" separator=",">
-            (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.other}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime})
+            (#{entity.uid}, #{entity.patentCount}, #{entity.inventionPatentCount}, #{entity.utilityModelCount}, #{entity.appearancePatentCount}, #{entity.softwareWorksCount}, #{entity.otherCount}, #{entity.financialData}, #{entity.earlyCommunication}, #{entity.interviewIdeas}, #{entity.createTime})
         </foreach>
         on duplicate key update
 uid = values(uid),
@@ -143,7 +148,7 @@ 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 = values(other),
+other_count = values(other_count),
 financial_data = values(financial_data),
 early_communication = values(early_communication),
 interview_ideas = values(interview_ideas),
@@ -172,8 +177,8 @@ create_time = values(create_time)
             <if test="softwareWorksCount != null">
                 software_works_count = #{softwareWorksCount},
             </if>
-            <if test="other != null">
-                other = #{other},
+            <if test="otherCount != null">
+                other_count = #{otherCount},
             </if>
             <if test="financialData != null and financialData != ''">
                 financial_data = #{financialData},
@@ -198,10 +203,8 @@ create_time = values(create_time)
 
     <select id="queryByUid" resultMap="UserArchivesMap">
         select
-            id, uid, patent_count, invention_patent_count, utility_model_count, appearance_patent_count, software_works_count, other, financial_data, early_communication, interview_ideas, create_time
-        from user_archives
+        <include refid="UserArchivesAllSql"/>
         where uid = #{id}
     </select>
-
 </mapper>
 

+ 18 - 12
src/main/java/com/goafanti/common/model/UserArchives.java

@@ -8,10 +8,10 @@ import java.util.Date;
  * 客户档案表(UserArchives)实体类
  *
  * @author makejava
- * @since 2024-07-12 11:52:01
+ * @since 2024-07-12 14:27:30
  */
 public class UserArchives implements Serializable {
-    private static final long serialVersionUID = -77412612272854895L;
+    private static final long serialVersionUID = 144323174694313886L;
 
     private Integer id;
 
@@ -39,7 +39,7 @@ public class UserArchives implements Serializable {
 /**
      * 其他数
      */
-    private Integer other;
+    private Integer otherCount;
 /**
      * 财务数据
      */
@@ -74,7 +74,8 @@ public class UserArchives implements Serializable {
         this.uid = uid;
     }
 
-    public Integer getPatentCount() {
+    public Integer patentCount() {
+        if (patentCount == null) return 0;
         return patentCount;
     }
 
@@ -82,7 +83,8 @@ public class UserArchives implements Serializable {
         this.patentCount = patentCount;
     }
 
-    public Integer getInventionPatentCount() {
+    public Integer inventionPatentCount() {
+        if (inventionPatentCount == null) return 0;
         return inventionPatentCount;
     }
 
@@ -90,7 +92,8 @@ public class UserArchives implements Serializable {
         this.inventionPatentCount = inventionPatentCount;
     }
 
-    public Integer getUtilityModelCount() {
+    public Integer utilityModelCount() {
+        if (utilityModelCount == null) return 0;
         return utilityModelCount;
     }
 
@@ -98,7 +101,8 @@ public class UserArchives implements Serializable {
         this.utilityModelCount = utilityModelCount;
     }
 
-    public Integer getAppearancePatentCount() {
+    public Integer appearancePatentCount() {
+        if (appearancePatentCount == null) return 0;
         return appearancePatentCount;
     }
 
@@ -106,7 +110,8 @@ public class UserArchives implements Serializable {
         this.appearancePatentCount = appearancePatentCount;
     }
 
-    public Integer getSoftwareWorksCount() {
+    public Integer softwareWorksCount() {
+        if (softwareWorksCount == null) return 0;
         return softwareWorksCount;
     }
 
@@ -114,12 +119,13 @@ public class UserArchives implements Serializable {
         this.softwareWorksCount = softwareWorksCount;
     }
 
-    public Integer getOther() {
-        return other;
+    public Integer otherCount() {
+        if (otherCount == null) return 0;
+        return otherCount;
     }
 
-    public void setOther(Integer other) {
-        this.other = other;
+    public void setOtherCount(Integer otherCount) {
+        this.otherCount = otherCount;
     }
 
     public String getFinancialData() {