Browse Source

导入用户打卡数据开发,时间处理修改

anderx 1 year ago
parent
commit
56e2a9edc0

+ 220 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/UserRecord.java

@@ -0,0 +1,220 @@
+package com.ruoyi.system.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 用户考勤记录表
+ * @TableName user_record
+ */
+public class UserRecord implements Serializable {
+    /**
+     * 编号
+     */
+    private Long id;
+
+    /**
+     * 打卡编号
+     */
+    private Long psrId;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 打卡时间
+     */
+    private Date recordTime;
+
+    /**
+     * 开始时间
+     */
+    private Date startTime;
+
+    /**
+     * 结束时间
+     */
+    private Date endTime;
+
+    /**
+     * 时长
+     */
+    private Double duration;
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 编号
+     */
+    public Long getId() {
+        return id;
+    }
+
+    /**
+     * 编号
+     */
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    /**
+     * 打卡编号
+     */
+    public Long getPsrId() {
+        return psrId;
+    }
+
+    /**
+     * 打卡编号
+     */
+    public void setPsrId(Long psrId) {
+        this.psrId = psrId;
+    }
+
+    /**
+     * 状态
+     */
+    public Integer getStatus() {
+        return status;
+    }
+
+    /**
+     * 状态
+     */
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    /**
+     * 内容
+     */
+    public String getContent() {
+        return content;
+    }
+
+    /**
+     * 内容
+     */
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    /**
+     * 打卡时间
+     */
+    public Date getRecordTime() {
+        return recordTime;
+    }
+
+    /**
+     * 打卡时间
+     */
+    public void setRecordTime(Date recordTime) {
+        this.recordTime = recordTime;
+    }
+
+    /**
+     * 开始时间
+     */
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    /**
+     * 开始时间
+     */
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    /**
+     * 结束时间
+     */
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    /**
+     * 结束时间
+     */
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    /**
+     * 时长
+     */
+    public Double getDuration() {
+        return duration;
+    }
+
+    /**
+     * 时长
+     */
+    public void setDuration(Double duration) {
+        this.duration = duration;
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        UserRecord other = (UserRecord) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getPsrId() == null ? other.getPsrId() == null : this.getPsrId().equals(other.getPsrId()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
+            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
+            && (this.getRecordTime() == null ? other.getRecordTime() == null : this.getRecordTime().equals(other.getRecordTime()))
+            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
+            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
+            && (this.getDuration() == null ? other.getDuration() == null : this.getDuration().equals(other.getDuration()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getPsrId() == null) ? 0 : getPsrId().hashCode());
+        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
+        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
+        result = prime * result + ((getRecordTime() == null) ? 0 : getRecordTime().hashCode());
+        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
+        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
+        result = prime * result + ((getDuration() == null) ? 0 : getDuration().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", psrId=").append(psrId);
+        sb.append(", status=").append(status);
+        sb.append(", content=").append(content);
+        sb.append(", recordTime=").append(recordTime);
+        sb.append(", startTime=").append(startTime);
+        sb.append(", endTime=").append(endTime);
+        sb.append(", duration=").append(duration);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,25 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.UserRecord;
+
+/**
+* @author Administrator
+* @description 针对表【user_record(用户考勤记录表)】的数据库操作Mapper
+* @createDate 2024-03-18 15:10:04
+* @Entity com.ruoyi.system.domain.UserRecord
+*/
+public interface UserRecordMapper {
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(UserRecord record);
+
+    int insertSelective(UserRecord record);
+
+    UserRecord selectByPrimaryKey(Long id);
+
+    int updateByPrimaryKeySelective(UserRecord record);
+
+    int updateByPrimaryKey(UserRecord record);
+
+}

+ 106 - 0
ruoyi-system/src/main/resources/mapper/UserRecordMapper.xml

@@ -0,0 +1,106 @@
+<?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.ruoyi.system.mapper.UserRecordMapper">
+
+    <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.UserRecord">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="psrId" column="psr_id" jdbcType="BIGINT"/>
+            <result property="status" column="status" jdbcType="INTEGER"/>
+            <result property="content" column="content" jdbcType="VARCHAR"/>
+            <result property="recordTime" column="record_time" jdbcType="TIMESTAMP"/>
+            <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
+            <result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
+            <result property="duration" column="duration" jdbcType="DOUBLE"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,psr_id,status,
+        content,record_time,start_time,
+        end_time,duration
+    </sql>
+
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from user_record
+        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,status
+        ,content,record_time,start_time
+        ,end_time,duration)
+        values (#{id,jdbcType=BIGINT},#{psrId,jdbcType=BIGINT},#{status,jdbcType=INTEGER}
+        ,#{content,jdbcType=VARCHAR},#{recordTime,jdbcType=TIMESTAMP},#{startTime,jdbcType=TIMESTAMP}
+        ,#{endTime,jdbcType=TIMESTAMP},#{duration,jdbcType=DOUBLE})
+    </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="psrId != null">psr_id,</if>
+                <if test="status != null">status,</if>
+                <if test="content != null">content,</if>
+                <if test="recordTime != null">record_time,</if>
+                <if test="startTime != null">start_time,</if>
+                <if test="endTime != null">end_time,</if>
+                <if test="duration != null">duration,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="id != null">#{id,jdbcType=BIGINT},</if>
+                <if test="psrId != null">#{psrId,jdbcType=BIGINT},</if>
+                <if test="status != null">#{status,jdbcType=INTEGER},</if>
+                <if test="content != null">#{content,jdbcType=VARCHAR},</if>
+                <if test="recordTime != null">#{recordTime,jdbcType=TIMESTAMP},</if>
+                <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
+                <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
+                <if test="duration != null">#{duration,jdbcType=DOUBLE},</if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.UserRecord">
+        update user_record
+        <set>
+                <if test="psrId != null">
+                    psr_id = #{psrId,jdbcType=BIGINT},
+                </if>
+                <if test="status != null">
+                    status = #{status,jdbcType=INTEGER},
+                </if>
+                <if test="content != null">
+                    content = #{content,jdbcType=VARCHAR},
+                </if>
+                <if test="recordTime != null">
+                    record_time = #{recordTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="startTime != null">
+                    start_time = #{startTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="endTime != null">
+                    end_time = #{endTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="duration != null">
+                    duration = #{duration,jdbcType=DOUBLE},
+                </if>
+        </set>
+        where   id = #{id,jdbcType=BIGINT} 
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.UserRecord">
+        update user_record
+        set 
+            psr_id =  #{psrId,jdbcType=BIGINT},
+            status =  #{status,jdbcType=INTEGER},
+            content =  #{content,jdbcType=VARCHAR},
+            record_time =  #{recordTime,jdbcType=TIMESTAMP},
+            start_time =  #{startTime,jdbcType=TIMESTAMP},
+            end_time =  #{endTime,jdbcType=TIMESTAMP},
+            duration =  #{duration,jdbcType=DOUBLE}
+        where   id = #{id,jdbcType=BIGINT} 
+    </update>
+</mapper>