Browse Source

项目上链修改

anderx 1 year ago
parent
commit
1abcada980

+ 201 - 3
ruoyi-system/src/main/java/com/ruoyi/project/domain/ProjectTask.java

@@ -7,8 +7,8 @@ import java.io.Serializable;
 import java.util.Date;
 
 /**
- * project_task
- * @author
+ * 项目任务表
+ * @TableName project_task
  */
 public class ProjectTask implements Serializable {
     /**
@@ -96,6 +96,11 @@ public class ProjectTask implements Serializable {
      */
     private Long createAid;
 
+    /**
+     * 天河存证url
+     */
+    private String tianheUrl;
+
     private String staffObject;
 
     public String getStaffObject() {
@@ -108,132 +113,325 @@ public class ProjectTask implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    /**
+     * 项目编号
+     */
     public Long getId() {
         return id;
     }
 
+    /**
+     * 项目编号
+     */
     public void setId(Long id) {
         this.id = id;
     }
 
+    /**
+     * 负责人
+     */
     public Long getAid() {
         return aid;
     }
 
+    /**
+     * 负责人
+     */
     public void setAid(Long aid) {
         this.aid = aid;
     }
 
+    /**
+     * 项目名称
+     */
     public String getName() {
         return name;
     }
 
+    /**
+     * 项目名称
+     */
     public void setName(String name) {
         this.name = name;
     }
 
+    /**
+     * 项目状态
+     */
     public Integer getProjectStatus() {
         return projectStatus;
     }
 
+    /**
+     * 项目状态
+     */
     public void setProjectStatus(Integer projectStatus) {
         this.projectStatus = projectStatus;
     }
 
+    /**
+     * 创建时间
+     */
     public Date getCreateTime() {
         return createTime;
     }
 
+    /**
+     * 创建时间
+     */
     public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
 
+    /**
+     * 备注
+     */
     public String getRemark() {
         return remark;
     }
 
+    /**
+     * 备注
+     */
     public void setRemark(String remark) {
         this.remark = remark;
     }
 
+    /**
+     * 负责人名称
+     */
     public String getAdminName() {
         return adminName;
     }
 
+    /**
+     * 负责人名称
+     */
     public void setAdminName(String adminName) {
         this.adminName = adminName;
     }
 
+    /**
+     * 成员名称
+     */
     public String getStaffName() {
         return staffName;
     }
 
+    /**
+     * 成员名称
+     */
     public void setStaffName(String staffName) {
         this.staffName = staffName;
     }
 
+    /**
+     * 项目编号
+     */
     @NotNull(message = "项目编号必须存在")
     public String getProjectNumber() {
         return projectNumber;
     }
 
+    /**
+     * 项目编号
+     */
     public void setProjectNumber(String projectNumber) {
         this.projectNumber = projectNumber;
     }
 
+    /**
+     * 项目年份
+     */
     public Object getProjectYear() {
         return projectYear;
     }
 
+    /**
+     * 项目年份
+     */
     public void setProjectYear(Object projectYear) {
         this.projectYear = projectYear;
     }
 
+    /**
+     * 创建年份
+     */
     public Object getCreateYear() {
         return createYear;
     }
 
+    /**
+     * 创建年份
+     */
     public void setCreateYear(Object createYear) {
         this.createYear = createYear;
     }
 
+    /**
+     * 0=非跨年,1=跨年
+     */
     public Integer getCrossYear() {
         return crossYear;
     }
 
+    /**
+     * 0=非跨年,1=跨年
+     */
     public void setCrossYear(Integer crossYear) {
         this.crossYear = crossYear;
     }
 
+    /**
+     * 时长
+     */
     public Double getDuration() {
         return duration;
     }
 
+    /**
+     * 时长
+     */
     public void setDuration(Double duration) {
         this.duration = duration;
     }
 
+    /**
+     * 开始时间
+     */
     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 Long getCreateAid() {
         return createAid;
     }
 
+    /**
+     * 项目创建人
+     */
     public void setCreateAid(Long createAid) {
         this.createAid = createAid;
     }
-}
+
+    /**
+     * 天河存证url
+     */
+    public String getTianheUrl() {
+        return tianheUrl;
+    }
+
+    /**
+     * 天河存证url
+     */
+    public void setTianheUrl(String tianheUrl) {
+        this.tianheUrl = tianheUrl;
+    }
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        ProjectTask other = (ProjectTask) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getAid() == null ? other.getAid() == null : this.getAid().equals(other.getAid()))
+            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
+            && (this.getProjectStatus() == null ? other.getProjectStatus() == null : this.getProjectStatus().equals(other.getProjectStatus()))
+            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
+            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
+            && (this.getAdminName() == null ? other.getAdminName() == null : this.getAdminName().equals(other.getAdminName()))
+            && (this.getStaffName() == null ? other.getStaffName() == null : this.getStaffName().equals(other.getStaffName()))
+            && (this.getProjectNumber() == null ? other.getProjectNumber() == null : this.getProjectNumber().equals(other.getProjectNumber()))
+            && (this.getProjectYear() == null ? other.getProjectYear() == null : this.getProjectYear().equals(other.getProjectYear()))
+            && (this.getCreateYear() == null ? other.getCreateYear() == null : this.getCreateYear().equals(other.getCreateYear()))
+            && (this.getCrossYear() == null ? other.getCrossYear() == null : this.getCrossYear().equals(other.getCrossYear()))
+            && (this.getDuration() == null ? other.getDuration() == null : this.getDuration().equals(other.getDuration()))
+            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
+            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
+            && (this.getCreateAid() == null ? other.getCreateAid() == null : this.getCreateAid().equals(other.getCreateAid()))
+            && (this.getTianheUrl() == null ? other.getTianheUrl() == null : this.getTianheUrl().equals(other.getTianheUrl()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getAid() == null) ? 0 : getAid().hashCode());
+        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
+        result = prime * result + ((getProjectStatus() == null) ? 0 : getProjectStatus().hashCode());
+        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
+        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
+        result = prime * result + ((getAdminName() == null) ? 0 : getAdminName().hashCode());
+        result = prime * result + ((getStaffName() == null) ? 0 : getStaffName().hashCode());
+        result = prime * result + ((getProjectNumber() == null) ? 0 : getProjectNumber().hashCode());
+        result = prime * result + ((getProjectYear() == null) ? 0 : getProjectYear().hashCode());
+        result = prime * result + ((getCreateYear() == null) ? 0 : getCreateYear().hashCode());
+        result = prime * result + ((getCrossYear() == null) ? 0 : getCrossYear().hashCode());
+        result = prime * result + ((getDuration() == null) ? 0 : getDuration().hashCode());
+        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
+        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
+        result = prime * result + ((getCreateAid() == null) ? 0 : getCreateAid().hashCode());
+        result = prime * result + ((getTianheUrl() == null) ? 0 : getTianheUrl().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(", aid=").append(aid);
+        sb.append(", name=").append(name);
+        sb.append(", projectStatus=").append(projectStatus);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", remark=").append(remark);
+        sb.append(", adminName=").append(adminName);
+        sb.append(", staffName=").append(staffName);
+        sb.append(", projectNumber=").append(projectNumber);
+        sb.append(", projectYear=").append(projectYear);
+        sb.append(", createYear=").append(createYear);
+        sb.append(", crossYear=").append(crossYear);
+        sb.append(", duration=").append(duration);
+        sb.append(", startTime=").append(startTime);
+        sb.append(", endTime=").append(endTime);
+        sb.append(", createAid=").append(createAid);
+        sb.append(", tianheUrl=").append(tianheUrl);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/project/mapper/ProjectTaskMapper.java

@@ -9,7 +9,14 @@ import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
+/**
+* @author Administrator
+* @description 针对表【project_task(项目任务表)】的数据库操作Mapper
+* @createDate 2024-06-26 16:20:23
+* @Entity com.ruoyi.project.domain.ProjectTask
+*/
 public interface ProjectTaskMapper {
+
     int deleteByPrimaryKey(Long id);
 
     int insert(ProjectTask record);

+ 298 - 338
ruoyi-system/src/main/resources/mapper/project/ProjectTaskMapper.xml

@@ -1,347 +1,307 @@
 <?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">
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.mapper.ProjectTaskMapper">
-  <resultMap id="BaseResultMap" type="com.ruoyi.project.domain.ProjectTask">
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="aid" jdbcType="BIGINT" property="aid" />
-    <result column="name" jdbcType="VARCHAR" property="name" />
-    <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <result column="admin_name" jdbcType="VARCHAR" property="adminName" />
-    <result column="staff_name" jdbcType="VARCHAR" property="staffName" />
-    <result column="project_number" jdbcType="VARCHAR" property="projectNumber" />
-    <result column="project_year" jdbcType="OTHER" property="projectYear" />
-    <result column="create_year" jdbcType="OTHER" property="createYear" />
-    <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
-    <result column="duration" jdbcType="DOUBLE" property="duration" />
-    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
-    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
-    <result column="create_aid" jdbcType="BIGINT" property="createAid" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    id, aid, `name`, project_status, create_time, remark, admin_name, staff_name, project_number,
-    project_year, create_year, cross_year, duration, start_time, end_time, create_aid
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select
-    <include refid="Base_Column_List" />
-    from project_task
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    delete from project_task
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectTask" useGeneratedKeys="true">
-    insert into project_task (aid, `name`, project_status,
-      create_time, remark, admin_name,
-      staff_name, project_number, project_year,
-      create_year, cross_year, duration,
-      start_time, end_time, create_aid
-      )
-    values (#{aid,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{projectStatus,jdbcType=INTEGER},
-      #{createTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{adminName,jdbcType=VARCHAR},
-      #{staffName,jdbcType=VARCHAR}, #{projectNumber,jdbcType=VARCHAR}, #{projectYear,jdbcType=OTHER},
-      #{createYear,jdbcType=OTHER}, #{crossYear,jdbcType=INTEGER}, #{duration,jdbcType=DOUBLE},
-      #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{createAid,jdbcType=BIGINT}
-      )
-  </insert>
-  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectTask" useGeneratedKeys="true">
-    insert into project_task
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="aid != null">
-        aid,
-      </if>
-      <if test="name != null">
-        `name`,
-      </if>
-      <if test="projectStatus != null">
-        project_status,
-      </if>
-      <if test="createTime != null">
-        create_time,
-      </if>
-      <if test="remark != null">
-        remark,
-      </if>
-      <if test="adminName != null">
-        admin_name,
-      </if>
-      <if test="staffName != null">
-        staff_name,
-      </if>
-      <if test="projectNumber != null">
-        project_number,
-      </if>
-      <if test="projectYear != null">
-        project_year,
-      </if>
-      <if test="createYear != null">
-        create_year,
-      </if>
-      <if test="crossYear != null">
-        cross_year,
-      </if>
-      <if test="duration != null">
-        duration,
-      </if>
-      <if test="startTime != null">
-        start_time,
-      </if>
-      <if test="endTime != null">
-        end_time,
-      </if>
-      <if test="createAid != null">
-        create_aid,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="aid != null">
-        #{aid,jdbcType=BIGINT},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="projectStatus != null">
-        #{projectStatus,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="remark != null">
-        #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="adminName != null">
-        #{adminName,jdbcType=VARCHAR},
-      </if>
-      <if test="staffName != null">
-        #{staffName,jdbcType=VARCHAR},
-      </if>
-      <if test="projectNumber != null">
-        #{projectNumber,jdbcType=VARCHAR},
-      </if>
-      <if test="projectYear != null">
-        #{projectYear,jdbcType=OTHER},
-      </if>
-      <if test="createYear != null">
-        #{createYear,jdbcType=OTHER},
-      </if>
-      <if test="crossYear != null">
-        #{crossYear,jdbcType=INTEGER},
-      </if>
-      <if test="duration != null">
-        #{duration,jdbcType=DOUBLE},
-      </if>
-      <if test="startTime != null">
-        #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="endTime != null">
-        #{endTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="createAid != null">
-        #{createAid,jdbcType=BIGINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.project.domain.ProjectTask">
-    update project_task
-    <set>
-      <if test="aid != null">
-        aid = #{aid,jdbcType=BIGINT},
-      </if>
-      <if test="name != null">
-        `name` = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="projectStatus != null">
-        project_status = #{projectStatus,jdbcType=INTEGER},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="remark != null">
-        remark = #{remark,jdbcType=VARCHAR},
-      </if>
-      <if test="adminName != null">
-        admin_name = #{adminName,jdbcType=VARCHAR},
-      </if>
-      <if test="staffName != null">
-        staff_name = #{staffName,jdbcType=VARCHAR},
-      </if>
-      <if test="projectNumber != null">
-        project_number = #{projectNumber,jdbcType=VARCHAR},
-      </if>
-      <if test="projectYear != null">
-        project_year = #{projectYear,jdbcType=OTHER},
-      </if>
-      <if test="createYear != null">
-        create_year = #{createYear,jdbcType=OTHER},
-      </if>
-      <if test="crossYear != null">
-        cross_year = #{crossYear,jdbcType=INTEGER},
-      </if>
-      <if test="duration != null">
-        duration = #{duration,jdbcType=DOUBLE},
-      </if>
-      <if test="startTime != null">
-        start_time = #{startTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="endTime != null">
-        end_time = #{endTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="createAid != null">
-        create_aid = #{createAid,jdbcType=BIGINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.ruoyi.project.domain.ProjectTask">
-    update project_task
-    set aid = #{aid,jdbcType=BIGINT},
-      `name` = #{name,jdbcType=VARCHAR},
-      project_status = #{projectStatus,jdbcType=INTEGER},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      remark = #{remark,jdbcType=VARCHAR},
-      admin_name = #{adminName,jdbcType=VARCHAR},
-      staff_name = #{staffName,jdbcType=VARCHAR},
-      project_number = #{projectNumber,jdbcType=VARCHAR},
-      project_year = #{projectYear,jdbcType=OTHER},
-      create_year = #{createYear,jdbcType=OTHER},
-      cross_year = #{crossYear,jdbcType=INTEGER},
-      duration = #{duration,jdbcType=DOUBLE},
-      start_time = #{startTime,jdbcType=TIMESTAMP},
-      end_time = #{endTime,jdbcType=TIMESTAMP},
-      create_aid = #{createAid,jdbcType=BIGINT}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
 
+    <resultMap id="BaseResultMap" type="com.ruoyi.project.domain.ProjectTask">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="aid" column="aid" jdbcType="BIGINT"/>
+            <result property="name" column="name" jdbcType="VARCHAR"/>
+            <result property="projectStatus" column="project_status" jdbcType="INTEGER"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="remark" column="remark" jdbcType="VARCHAR"/>
+            <result property="adminName" column="admin_name" jdbcType="VARCHAR"/>
+            <result property="staffName" column="staff_name" jdbcType="VARCHAR"/>
+            <result property="projectNumber" column="project_number" jdbcType="VARCHAR"/>
+            <result property="projectYear" column="project_year" jdbcType="OTHER"/>
+            <result property="createYear" column="create_year" jdbcType="OTHER"/>
+            <result property="crossYear" column="cross_year" jdbcType="INTEGER"/>
+            <result property="duration" column="duration" jdbcType="DOUBLE"/>
+            <result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
+            <result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
+            <result property="createAid" column="create_aid" jdbcType="BIGINT"/>
+            <result property="tianheUrl" column="tianhe_url" jdbcType="VARCHAR"/>
+    </resultMap>
 
-  <update id="updateDuration">
-    update project_task
-    set duration=(select sum(a.duration)
-                  from project_staff_record a
-                  where a.pid= #{pid})
-    where id = #{pid}
-  </update>
-  <update id="updateAdminNameByAid" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
-    update project_task
-    set admin_name = #{nickName}
-    where aid= #{userId}
-  </update>
-  <update id="batchUpdateProjectStatus" >
-    update project_task
-    set project_status = 1
-    where id in
-    <foreach collection="ids" item="id" open="(" close=")" separator=",">
-      #{id}
-    </foreach>
-  </update>
+    <sql id="Base_Column_List">
+        id,aid,name,
+        project_status,create_time,remark,
+        admin_name,staff_name,project_number,
+        project_year,create_year,cross_year,
+        duration,start_time,end_time,
+        create_aid,tianhe_url
+    </sql>
 
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from project_task
+        where  id = #{id,jdbcType=BIGINT} 
+    </select>
 
-  <resultMap id="BaseResultOutMap" type="com.ruoyi.project.bo.ProjectTaskListOut">
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="aid" jdbcType="BIGINT" property="aid" />
-    <result column="name" jdbcType="VARCHAR" property="name" />
-    <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="remark" jdbcType="VARCHAR" property="remark" />
-    <result column="admin_name" jdbcType="VARCHAR" property="adminName" />
-    <result column="staff_name" jdbcType="VARCHAR" property="staffName" />
-    <result column="project_number" jdbcType="VARCHAR" property="projectNumber" />
-    <result column="project_year" jdbcType="OTHER" property="projectYear" />
-    <result column="create_year" jdbcType="OTHER" property="createYear" />
-    <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
-    <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
-    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
-    <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
-  </resultMap>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        delete from project_task
+        where  id = #{id,jdbcType=BIGINT} 
+    </delete>
+    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectTask" useGeneratedKeys="true">
+        insert into project_task
+        ( id,aid,name
+        ,project_status,create_time,remark
+        ,admin_name,staff_name,project_number
+        ,project_year,create_year,cross_year
+        ,duration,start_time,end_time
+        ,create_aid,tianhe_url)
+        values (#{id,jdbcType=BIGINT},#{aid,jdbcType=BIGINT},#{name,jdbcType=VARCHAR}
+        ,#{projectStatus,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{remark,jdbcType=VARCHAR}
+        ,#{adminName,jdbcType=VARCHAR},#{staffName,jdbcType=VARCHAR},#{projectNumber,jdbcType=VARCHAR}
+        ,#{projectYear,jdbcType=OTHER},#{createYear,jdbcType=OTHER},#{crossYear,jdbcType=INTEGER}
+        ,#{duration,jdbcType=DOUBLE},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP}
+        ,#{createAid,jdbcType=BIGINT},#{tianheUrl,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.ruoyi.project.domain.ProjectTask" useGeneratedKeys="true">
+        insert into project_task
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                <if test="id != null">id,</if>
+                <if test="aid != null">aid,</if>
+                <if test="name != null">name,</if>
+                <if test="projectStatus != null">project_status,</if>
+                <if test="createTime != null">create_time,</if>
+                <if test="remark != null">remark,</if>
+                <if test="adminName != null">admin_name,</if>
+                <if test="staffName != null">staff_name,</if>
+                <if test="projectNumber != null">project_number,</if>
+                <if test="projectYear != null">project_year,</if>
+                <if test="createYear != null">create_year,</if>
+                <if test="crossYear != null">cross_year,</if>
+                <if test="duration != null">duration,</if>
+                <if test="startTime != null">start_time,</if>
+                <if test="endTime != null">end_time,</if>
+                <if test="createAid != null">create_aid,</if>
+                <if test="tianheUrl != null">tianhe_url,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                <if test="id != null">#{id,jdbcType=BIGINT},</if>
+                <if test="aid != null">#{aid,jdbcType=BIGINT},</if>
+                <if test="name != null">#{name,jdbcType=VARCHAR},</if>
+                <if test="projectStatus != null">#{projectStatus,jdbcType=INTEGER},</if>
+                <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
+                <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
+                <if test="adminName != null">#{adminName,jdbcType=VARCHAR},</if>
+                <if test="staffName != null">#{staffName,jdbcType=VARCHAR},</if>
+                <if test="projectNumber != null">#{projectNumber,jdbcType=VARCHAR},</if>
+                <if test="projectYear != null">#{projectYear,jdbcType=OTHER},</if>
+                <if test="createYear != null">#{createYear,jdbcType=OTHER},</if>
+                <if test="crossYear != null">#{crossYear,jdbcType=INTEGER},</if>
+                <if test="duration != null">#{duration,jdbcType=DOUBLE},</if>
+                <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if>
+                <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if>
+                <if test="createAid != null">#{createAid,jdbcType=BIGINT},</if>
+                <if test="tianheUrl != null">#{tianheUrl,jdbcType=VARCHAR},</if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.project.domain.ProjectTask">
+        update project_task
+        <set>
+                <if test="aid != null">
+                    aid = #{aid,jdbcType=BIGINT},
+                </if>
+                <if test="name != null">
+                    name = #{name,jdbcType=VARCHAR},
+                </if>
+                <if test="projectStatus != null">
+                    project_status = #{projectStatus,jdbcType=INTEGER},
+                </if>
+                <if test="createTime != null">
+                    create_time = #{createTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="remark != null">
+                    remark = #{remark,jdbcType=VARCHAR},
+                </if>
+                <if test="adminName != null">
+                    admin_name = #{adminName,jdbcType=VARCHAR},
+                </if>
+                <if test="staffName != null">
+                    staff_name = #{staffName,jdbcType=VARCHAR},
+                </if>
+                <if test="projectNumber != null">
+                    project_number = #{projectNumber,jdbcType=VARCHAR},
+                </if>
+                <if test="projectYear != null">
+                    project_year = #{projectYear,jdbcType=OTHER},
+                </if>
+                <if test="createYear != null">
+                    create_year = #{createYear,jdbcType=OTHER},
+                </if>
+                <if test="crossYear != null">
+                    cross_year = #{crossYear,jdbcType=INTEGER},
+                </if>
+                <if test="duration != null">
+                    duration = #{duration,jdbcType=DOUBLE},
+                </if>
+                <if test="startTime != null">
+                    start_time = #{startTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="endTime != null">
+                    end_time = #{endTime,jdbcType=TIMESTAMP},
+                </if>
+                <if test="createAid != null">
+                    create_aid = #{createAid,jdbcType=BIGINT},
+                </if>
+                <if test="tianheUrl != null">
+                    tianhe_url = #{tianheUrl,jdbcType=VARCHAR},
+                </if>
+        </set>
+        where   id = #{id,jdbcType=BIGINT} 
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.ruoyi.project.domain.ProjectTask">
+        update project_task
+        set 
+            aid =  #{aid,jdbcType=BIGINT},
+            name =  #{name,jdbcType=VARCHAR},
+            project_status =  #{projectStatus,jdbcType=INTEGER},
+            create_time =  #{createTime,jdbcType=TIMESTAMP},
+            remark =  #{remark,jdbcType=VARCHAR},
+            admin_name =  #{adminName,jdbcType=VARCHAR},
+            staff_name =  #{staffName,jdbcType=VARCHAR},
+            project_number =  #{projectNumber,jdbcType=VARCHAR},
+            project_year =  #{projectYear,jdbcType=OTHER},
+            create_year =  #{createYear,jdbcType=OTHER},
+            cross_year =  #{crossYear,jdbcType=INTEGER},
+            duration =  #{duration,jdbcType=DOUBLE},
+            start_time =  #{startTime,jdbcType=TIMESTAMP},
+            end_time =  #{endTime,jdbcType=TIMESTAMP},
+            create_aid =  #{createAid,jdbcType=BIGINT},
+            tianhe_url =  #{tianheUrl,jdbcType=VARCHAR}
+        where   id = #{id,jdbcType=BIGINT} 
+    </update>
 
-  <select id="selectList" resultMap="BaseResultOutMap">
-    select
-    a.id, a.aid, a.`name`, a.project_status , a.create_time, a.remark, a.admin_name, a.staff_name, a.project_number,
-    a.project_year, a.create_year, a.cross_year,a.duration,a.start_time,a.end_time
-    from project_task a
-      left join sys_user c on a.aid=c.user_id
-      left join sys_dept d on c.dept_id=d.dept_id
-    where project_status > 0
-    <if test="roleType ==0">
-      and (a.aid =#{uid} or  a.id in (select pid from project_staff where aid= #{uid}))
-    </if>
-    <if test="headId !=null">
-      and a.aid= #{headId}
-    </if>
-    <if test="headName !=null">
-      and a.admin_name like concat('%',#{headName},'%')
-    </if>
-    <if test="staffId !=null">
-      and a.id in (select pid from project_staff where aid= #{staffId})
-    </if>
-    <if test="staffName !=null">
-      and a.id in (select pid from project_staff where name  like concat('%',#{staffName},'%'))
-    </if>
-      <if test="createAid !=null">
-        and a.create_aid= #{createAid}
-      </if>
-    <if test="name !=null">
-      and a.name like concat('%',#{name},'%')
-    </if>
-<!--    <if test="startTime !=null and endTime !=null">-->
-<!--      and a.create_time  between #{startTime} and #{endTime}-->
-<!--    </if>-->
-    <if test="startTime !=null and endTime !=null">
-      and ( #{startTime}  between a.start_time and a.end_time or  #{endTime}  between a.start_time and a.end_time)
-    </if>
-    <if test="projectNumber !=null ">
-      and a.project_number like concat('%',#{projectNumber},'%')
-    </if>
-    <if test="projectYear !=null ">
-      and a.project_year =#{projectYear}
-    </if>
-    <if test="crossYear !=null ">
-      and a.cross_year =#{crossYear}
-    </if>
-    <if test="projectStatus !=null ">
-      and a.project_status =#{projectStatus}
-    </if>
-    <if test="companyId !=null">
-      and (d.dept_id= #{companyId} or find_in_set(#{companyId},d.ancestors))
-    </if>
-    <if test="deptId !=null">
-      and (d.dept_id= #{deptId} or find_in_set(#{deptId},d.ancestors))
-    </if>
-  </select>
-  <select id="projectAddDuration">
-    update project_task
-    set duration=round(duration+#{duration},2)
-    where id =#{pid}
-  </select>
-  <select id="selectProjectImg" resultType="com.ruoyi.project.domain.ProjectStaffRecord">
-    select a.id,a.pid,a.name,a.annex_url annexUrl
-    from project_staff_record a
-    where a.pid=#{pid}
-  </select>
-  <select id="selectByProjectNumber" resultMap="BaseResultMap">
-    select
-    a.id, a.aid, a.`name`, a.project_status, a.create_time, a.remark, a.admin_name, a.staff_name, a.project_number,
-    a.project_year, a.create_year, a.cross_year, a.duration, a.start_time, a.end_time
-    FROM project_task a  left join sys_user  b on a.aid=b.user_id
-    left join sys_dept d on b.dept_id=d.dept_id
-    where project_number= #{projectNumber}
-    <if test="companyId !=null">
-      and (d.dept_id= #{companyId} or find_in_set(#{companyId},d.ancestors))
-    </if>
-  </select>
-  <select id="selectAll" resultMap="BaseResultMap">
-    select
-    <include refid="Base_Column_List" />
-    from project_task
-    where project_status =0
-  </select>
+    <update id="updateDuration">
+        update project_task
+        set duration=(select sum(a.duration)
+                      from project_staff_record a
+                      where a.pid= #{pid})
+        where id = #{pid}
+    </update>
+    <update id="updateAdminNameByAid" parameterType="com.ruoyi.common.core.domain.entity.SysUser">
+        update project_task
+        set admin_name = #{nickName}
+        where aid= #{userId}
+    </update>
+    <update id="batchUpdateProjectStatus" >
+        update project_task
+        set project_status = 1
+        where id in
+        <foreach collection="ids" item="id" open="(" close=")" separator=",">
+            #{id}
+        </foreach>
+    </update>
 
-  <update id="updateStaffName"  >
-    update project_task
-    set staff_name=(select group_concat(name)name from project_staff
-    where pid = #{pid} group by  pid)
-    where id= #{pid}
-  </update>
+
+    <resultMap id="BaseResultOutMap" type="com.ruoyi.project.bo.ProjectTaskListOut">
+        <id column="id" jdbcType="BIGINT" property="id" />
+        <result column="aid" jdbcType="BIGINT" property="aid" />
+        <result column="name" jdbcType="VARCHAR" property="name" />
+        <result column="project_status" jdbcType="INTEGER" property="projectStatus" />
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+        <result column="remark" jdbcType="VARCHAR" property="remark" />
+        <result column="admin_name" jdbcType="VARCHAR" property="adminName" />
+        <result column="staff_name" jdbcType="VARCHAR" property="staffName" />
+        <result column="project_number" jdbcType="VARCHAR" property="projectNumber" />
+        <result column="project_year" jdbcType="OTHER" property="projectYear" />
+        <result column="create_year" jdbcType="OTHER" property="createYear" />
+        <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
+        <result column="cross_year" jdbcType="INTEGER" property="crossYear" />
+        <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
+        <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
+    </resultMap>
+
+    <select id="selectList" resultMap="BaseResultOutMap">
+        select
+        a.id, a.aid, a.`name`, a.project_status , a.create_time, a.remark, a.admin_name, a.staff_name, a.project_number,
+        a.project_year, a.create_year, a.cross_year,a.duration,a.start_time,a.end_time
+        from project_task a
+        left join sys_user c on a.aid=c.user_id
+        left join sys_dept d on c.dept_id=d.dept_id
+        where project_status > 0
+        <if test="roleType ==0">
+            and (a.aid =#{uid} or  a.id in (select pid from project_staff where aid= #{uid}))
+        </if>
+        <if test="headId !=null">
+            and a.aid= #{headId}
+        </if>
+        <if test="headName !=null">
+            and a.admin_name like concat('%',#{headName},'%')
+        </if>
+        <if test="staffId !=null">
+            and a.id in (select pid from project_staff where aid= #{staffId})
+        </if>
+        <if test="staffName !=null">
+            and a.id in (select pid from project_staff where name  like concat('%',#{staffName},'%'))
+        </if>
+        <if test="createAid !=null">
+            and a.create_aid= #{createAid}
+        </if>
+        <if test="name !=null">
+            and a.name like concat('%',#{name},'%')
+        </if>
+        <!--    <if test="startTime !=null and endTime !=null">-->
+        <!--      and a.create_time  between #{startTime} and #{endTime}-->
+        <!--    </if>-->
+        <if test="startTime !=null and endTime !=null">
+            and ( #{startTime}  between a.start_time and a.end_time or  #{endTime}  between a.start_time and a.end_time)
+        </if>
+        <if test="projectNumber !=null ">
+            and a.project_number like concat('%',#{projectNumber},'%')
+        </if>
+        <if test="projectYear !=null ">
+            and a.project_year =#{projectYear}
+        </if>
+        <if test="crossYear !=null ">
+            and a.cross_year =#{crossYear}
+        </if>
+        <if test="projectStatus !=null ">
+            and a.project_status =#{projectStatus}
+        </if>
+        <if test="companyId !=null">
+            and (d.dept_id= #{companyId} or find_in_set(#{companyId},d.ancestors))
+        </if>
+        <if test="deptId !=null">
+            and (d.dept_id= #{deptId} or find_in_set(#{deptId},d.ancestors))
+        </if>
+    </select>
+    <select id="projectAddDuration">
+        update project_task
+        set duration=round(duration+#{duration},2)
+        where id =#{pid}
+    </select>
+    <select id="selectProjectImg" resultType="com.ruoyi.project.domain.ProjectStaffRecord">
+        select a.id,a.pid,a.name,a.annex_url annexUrl
+        from project_staff_record a
+        where a.pid=#{pid}
+    </select>
+    <select id="selectByProjectNumber" resultMap="BaseResultMap">
+        select
+        a.id, a.aid, a.`name`, a.project_status, a.create_time, a.remark, a.admin_name, a.staff_name, a.project_number,
+        a.project_year, a.create_year, a.cross_year, a.duration, a.start_time, a.end_time
+        FROM project_task a  left join sys_user  b on a.aid=b.user_id
+        left join sys_dept d on b.dept_id=d.dept_id
+        where project_number= #{projectNumber}
+        <if test="companyId !=null">
+            and (d.dept_id= #{companyId} or find_in_set(#{companyId},d.ancestors))
+        </if>
+    </select>
+    <select id="selectAll" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from project_task
+        where project_status =0
+    </select>
+
+    <update id="updateStaffName"  >
+        update project_task
+        set staff_name=(select group_concat(name)name from project_staff
+                        where pid = #{pid} group by  pid)
+        where id= #{pid}
+    </update>
 </mapper>