Просмотр исходного кода

导入用户打卡数据开发第二版,导入数据库再做处理

anderx 1 год назад
Родитель
Сommit
9b8e181908

+ 25 - 3
ruoyi-system/src/main/java/com/ruoyi/system/domain/UserRecord.java

@@ -14,6 +14,11 @@ public class UserRecord implements Serializable {
     private Long id;
 
     /**
+     * 钉钉userId
+     */
+    private Long ddUserId;
+
+    /**
      * 打卡编号
      */
     private Long psrId;
@@ -24,7 +29,7 @@ public class UserRecord implements Serializable {
     private String name;
 
     /**
-     * 状态
+     * 状态 0正常 1缺卡 2多打卡  3缺卡+多打卡
      */
     private Integer status;
 
@@ -80,6 +85,20 @@ public class UserRecord implements Serializable {
     }
 
     /**
+     * 钉钉userId
+     */
+    public Long getDdUserId() {
+        return ddUserId;
+    }
+
+    /**
+     * 钉钉userId
+     */
+    public void setDdUserId(Long ddUserId) {
+        this.ddUserId = ddUserId;
+    }
+
+    /**
      * 打卡编号
      */
     public Long getPsrId() {
@@ -108,14 +127,14 @@ public class UserRecord implements Serializable {
     }
 
     /**
-     * 状态
+     * 状态 0正常 1缺卡 2多打卡  3缺卡+多打卡
      */
     public Integer getStatus() {
         return status;
     }
 
     /**
-     * 状态
+     * 状态 0正常 1缺卡 2多打卡  3缺卡+多打卡
      */
     public void setStatus(Integer status) {
         this.status = status;
@@ -232,6 +251,7 @@ public class UserRecord implements Serializable {
         }
         UserRecord other = (UserRecord) that;
         return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getDdUserId() == null ? other.getDdUserId() == null : this.getDdUserId().equals(other.getDdUserId()))
             && (this.getPsrId() == null ? other.getPsrId() == null : this.getPsrId().equals(other.getPsrId()))
             && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
             && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
@@ -249,6 +269,7 @@ public class UserRecord implements Serializable {
         final int prime = 31;
         int result = 1;
         result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getDdUserId() == null) ? 0 : getDdUserId().hashCode());
         result = prime * result + ((getPsrId() == null) ? 0 : getPsrId().hashCode());
         result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
         result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
@@ -269,6 +290,7 @@ public class UserRecord implements Serializable {
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
+        sb.append(", ddUserId=").append(ddUserId);
         sb.append(", psrId=").append(psrId);
         sb.append(", name=").append(name);
         sb.append(", status=").append(status);

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserRecordMapper.java

@@ -8,7 +8,7 @@ import java.util.List;
 /**
 * @author Administrator
 * @description 针对表【user_record(用户考勤记录表)】的数据库操作Mapper
-* @createDate 2024-03-18 15:14:13
+* @createDate 2024-03-19 09:20:43
 * @Entity com.ruoyi.system.domain.UserRecord
 */
 public interface UserRecordMapper {

+ 21 - 14
ruoyi-system/src/main/resources/mapper/UserRecordMapper.xml

@@ -6,6 +6,7 @@
 
     <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.UserRecord">
             <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="ddUserId" column="dd_user_id" jdbcType="BIGINT"/>
             <result property="psrId" column="psr_id" jdbcType="BIGINT"/>
             <result property="name" column="name" jdbcType="VARCHAR"/>
             <result property="status" column="status" jdbcType="INTEGER"/>
@@ -19,10 +20,10 @@
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,psr_id,name,
-        status,content,record_time,
-        start_time,end_time,sum_duration,
-        check_duration,create_id
+        id,dd_user_id,psr_id,
+        name,status,content,
+        record_time,start_time,end_time,
+        sum_duration,check_duration,create_id
     </sql>
 
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -32,26 +33,28 @@
         where  id = #{id,jdbcType=BIGINT} 
     </select>
 
-
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from user_record
         where  id = #{id,jdbcType=BIGINT} 
     </delete>
     <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.system.domain.UserRecord" useGeneratedKeys="true">
         insert into user_record
-        ( id,psr_id,name
-        ,status,content,record_time
-        ,start_time,end_time,sum_duration
-        ,check_duration,create_id)
-        values (#{id,jdbcType=BIGINT},#{psrId,jdbcType=BIGINT},#{name,jdbcType=VARCHAR}
-        ,#{status,jdbcType=INTEGER},#{content,jdbcType=VARCHAR},#{recordTime,jdbcType=TIMESTAMP}
-        ,#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{sumDuration,jdbcType=DOUBLE}
-        ,#{checkDuration,jdbcType=DOUBLE},#{createId,jdbcType=BIGINT})
+        ( id,dd_user_id,psr_id
+        ,name,status,content
+        ,record_time,start_time,end_time
+        ,sum_duration,check_duration,create_id
+        )
+        values (#{id,jdbcType=BIGINT},#{ddUserId,jdbcType=BIGINT},#{psrId,jdbcType=BIGINT}
+        ,#{name,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{content,jdbcType=VARCHAR}
+        ,#{recordTime,jdbcType=TIMESTAMP},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP}
+        ,#{sumDuration,jdbcType=DOUBLE},#{checkDuration,jdbcType=DOUBLE},#{createId,jdbcType=BIGINT}
+        )
     </insert>
     <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.system.domain.UserRecord" useGeneratedKeys="true">
         insert into user_record
         <trim prefix="(" suffix=")" suffixOverrides=",">
                 <if test="id != null">id,</if>
+                <if test="ddUserId != null">dd_user_id,</if>
                 <if test="psrId != null">psr_id,</if>
                 <if test="name != null">name,</if>
                 <if test="status != null">status,</if>
@@ -65,6 +68,7 @@
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=BIGINT},</if>
+                <if test="ddUserId != null">#{ddUserId,jdbcType=BIGINT},</if>
                 <if test="psrId != null">#{psrId,jdbcType=BIGINT},</if>
                 <if test="name != null">#{name,jdbcType=VARCHAR},</if>
                 <if test="status != null">#{status,jdbcType=INTEGER},</if>
@@ -77,10 +81,12 @@
                 <if test="createId != null">#{createId,jdbcType=BIGINT},</if>
         </trim>
     </insert>
-
     <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.UserRecord">
         update user_record
         <set>
+                <if test="ddUserId != null">
+                    dd_user_id = #{ddUserId,jdbcType=BIGINT},
+                </if>
                 <if test="psrId != null">
                     psr_id = #{psrId,jdbcType=BIGINT},
                 </if>
@@ -117,6 +123,7 @@
     <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.UserRecord">
         update user_record
         set 
+            dd_user_id =  #{ddUserId,jdbcType=BIGINT},
             psr_id =  #{psrId,jdbcType=BIGINT},
             name =  #{name,jdbcType=VARCHAR},
             status =  #{status,jdbcType=INTEGER},