Browse Source

新增项目评分

anderx 1 year ago
parent
commit
6fd38882c7

+ 85 - 0
src/main/java/com/goafanti/common/dao/TaskScoreMapper.java

@@ -0,0 +1,85 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TaskScore;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.data.domain.Pageable;
+
+import java.util.List;
+
+/**
+ * 项目评分列表(TaskScore)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-09-27 11:47:46
+ */
+public interface TaskScoreMapper {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    TaskScore queryById(Integer id);
+
+
+    /**
+     * 查询指定行数据
+     *
+     * @param taskScore 查询条件
+     * @param pageable  分页对象
+     * @return 对象列表
+     */
+    List<TaskScore> findTaskScoreList(TaskScore taskScore, @Param("pageable") Pageable pageable);
+
+    /**
+     * 统计总行数
+     *
+     * @param taskScore 查询条件
+     * @return 总行数
+     */
+    int findTaskScoreCount(TaskScore taskScore);
+
+    /**
+     * 新增数据
+     *
+     * @param taskScore 实例对象
+     * @return 影响行数
+     */
+    int insert(TaskScore taskScore);
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<TaskScore> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<TaskScore> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<TaskScore> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<TaskScore> entities);
+
+    /**
+     * 修改数据
+     *
+     * @param taskScore 实例对象
+     * @return 影响行数
+     */
+    int update(TaskScore taskScore);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+}
+

+ 181 - 0
src/main/java/com/goafanti/common/mapper/TaskScoreMapper.xml

@@ -0,0 +1,181 @@
+<?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.goafanti.common.dao.TaskScoreMapper">
+
+    <resultMap type="com.goafanti.common.model.TaskScore" id="TaskScoreMap">
+        <result property="id" column="id" jdbcType="INTEGER"/>
+        <result property="tid" column="tid" jdbcType="INTEGER"/>
+        <result property="professionalism" column="professionalism" jdbcType="INTEGER"/>
+        <result property="communicationSkills" column="communication_skills" jdbcType="INTEGER"/>
+        <result property="responsiveness" column="responsiveness" jdbcType="INTEGER"/>
+        <result property="publicImage" column="public_image" jdbcType="INTEGER"/>
+        <result property="serviceAttitude" column="service_attitude" jdbcType="INTEGER"/>
+        <result property="monthlyReport" column="monthly_report" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="TaskScoreAllSql">
+        id, tid, professionalism, communication_skills, responsiveness, public_image, service_attitude, monthly_report, create_time
+    </sql>
+
+    <!--查询单个-->
+    <select id="queryById" resultMap="TaskScoreMap">
+        select
+        <include refid="TaskScoreAllSql"/>
+        from task_score
+        where id = #{id}
+    </select>
+
+    <!--查询指定行数据-->
+    <select id="findTaskScoreList" resultMap="TaskScoreMap">
+        select
+        <include refid="TaskScoreAllSql"/>
+
+        from task_score
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="tid != null">
+                and tid = #{tid}
+            </if>
+            <if test="professionalism != null">
+                and professionalism = #{professionalism}
+            </if>
+            <if test="communicationSkills != null">
+                and communication_skills = #{communicationSkills}
+            </if>
+            <if test="responsiveness != null">
+                and responsiveness = #{responsiveness}
+            </if>
+            <if test="publicImage != null">
+                and public_image = #{publicImage}
+            </if>
+            <if test="serviceAttitude != null">
+                and service_attitude = #{serviceAttitude}
+            </if>
+            <if test="monthlyReport != null">
+                and monthly_report = #{monthlyReport}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+        <if test="page_sql != null">
+            ${page_sql}
+        </if>
+    </select>
+
+    <!--统计总行数-->
+    <select id="findTaskScoreCount" resultType="java.lang.Integer">
+        select count(1)
+        from task_score
+        <where>
+            <if test="id != null">
+                and id = #{id}
+            </if>
+            <if test="tid != null">
+                and tid = #{tid}
+            </if>
+            <if test="professionalism != null">
+                and professionalism = #{professionalism}
+            </if>
+            <if test="communicationSkills != null">
+                and communication_skills = #{communicationSkills}
+            </if>
+            <if test="responsiveness != null">
+                and responsiveness = #{responsiveness}
+            </if>
+            <if test="publicImage != null">
+                and public_image = #{publicImage}
+            </if>
+            <if test="serviceAttitude != null">
+                and service_attitude = #{serviceAttitude}
+            </if>
+            <if test="monthlyReport != null">
+                and monthly_report = #{monthlyReport}
+            </if>
+            <if test="createTime != null">
+                and create_time = #{createTime}
+            </if>
+        </where>
+    </select>
+
+    <!--新增所有列-->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into task_score(tid, professionalism, communication_skills, responsiveness, public_image,
+                               service_attitude, monthly_report, create_time)
+        values (#{tid}, #{professionalism}, #{communicationSkills}, #{responsiveness}, #{publicImage},
+                #{serviceAttitude}, #{monthlyReport}, #{createTime})
+    </insert>
+
+    <insert id="insertBatch">
+        insert into task_score(tid, professionalism, communication_skills, responsiveness, public_image,
+        service_attitude, monthly_report, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.tid}, #{entity.professionalism}, #{entity.communicationSkills}, #{entity.responsiveness},
+            #{entity.publicImage}, #{entity.serviceAttitude}, #{entity.monthlyReport}, #{entity.createTime})
+        </foreach>
+    </insert>
+
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into task_score(tid, professionalism, communication_skills, responsiveness, public_image,
+        service_attitude, monthly_report, create_time)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.tid}, #{entity.professionalism}, #{entity.communicationSkills}, #{entity.responsiveness},
+            #{entity.publicImage}, #{entity.serviceAttitude}, #{entity.monthlyReport}, #{entity.createTime})
+        </foreach>
+        on duplicate key update
+        tid = values(tid),
+        professionalism = values(professionalism),
+        communication_skills = values(communication_skills),
+        responsiveness = values(responsiveness),
+        public_image = values(public_image),
+        service_attitude = values(service_attitude),
+        monthly_report = values(monthly_report),
+        create_time = values(create_time)
+    </insert>
+
+    <!--通过主键修改数据-->
+    <update id="update">
+        update task_score
+        <set>
+            <if test="tid != null">
+                tid = #{tid},
+            </if>
+            <if test="professionalism != null">
+                professionalism = #{professionalism},
+            </if>
+            <if test="communicationSkills != null">
+                communication_skills = #{communicationSkills},
+            </if>
+            <if test="responsiveness != null">
+                responsiveness = #{responsiveness},
+            </if>
+            <if test="publicImage != null">
+                public_image = #{publicImage},
+            </if>
+            <if test="serviceAttitude != null">
+                service_attitude = #{serviceAttitude},
+            </if>
+            <if test="monthlyReport != null">
+                monthly_report = #{monthlyReport},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete
+        from task_score
+        where id = #{id}
+    </delete>
+
+</mapper>
+

+ 126 - 0
src/main/java/com/goafanti/common/model/TaskScore.java

@@ -0,0 +1,126 @@
+package com.goafanti.common.model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 项目评分列表(TaskScore)实体类
+ *
+ * @author makejava
+ * @since 2024-09-27 11:47:46
+ */
+public class TaskScore implements Serializable {
+    private static final long serialVersionUID = -64552566971079184L;
+    /**
+     * id
+     */
+    private Integer id;
+    /**
+     * 项目编号
+     */
+    private Integer tid;
+    /**
+     * 专业度 0=不专业,1=一般(2),2=专业(5),3很专业(10)
+     */
+    private Integer professionalism;
+    /**
+     * 沟通力 0=不满意,1=一般,2=满意,3=很满意
+     */
+    private Integer communicationSkills;
+    /**
+     * 响应度 0=很慢,1=一般,2=速度,3=很速度
+     */
+    private Integer responsiveness;
+    /**
+     * 公出形象 0=不满意,1=一般,2=满意,3=很满意
+     */
+    private Integer publicImage;
+    /**
+     * 服务态度 0=不满意,1=一般,2=满意,3=很满意
+     */
+    private Integer serviceAttitude;
+    /**
+     * 月度汇报 0=不满意,1=一般,2=满意,3=很满意
+     */
+    private Integer monthlyReport;
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getTid() {
+        return tid;
+    }
+
+    public void setTid(Integer tid) {
+        this.tid = tid;
+    }
+
+    public Integer getProfessionalism() {
+        return professionalism;
+    }
+
+    public void setProfessionalism(Integer professionalism) {
+        this.professionalism = professionalism;
+    }
+
+    public Integer getCommunicationSkills() {
+        return communicationSkills;
+    }
+
+    public void setCommunicationSkills(Integer communicationSkills) {
+        this.communicationSkills = communicationSkills;
+    }
+
+    public Integer getResponsiveness() {
+        return responsiveness;
+    }
+
+    public void setResponsiveness(Integer responsiveness) {
+        this.responsiveness = responsiveness;
+    }
+
+    public Integer getPublicImage() {
+        return publicImage;
+    }
+
+    public void setPublicImage(Integer publicImage) {
+        this.publicImage = publicImage;
+    }
+
+    public Integer getServiceAttitude() {
+        return serviceAttitude;
+    }
+
+    public void setServiceAttitude(Integer serviceAttitude) {
+        this.serviceAttitude = serviceAttitude;
+    }
+
+    public Integer getMonthlyReport() {
+        return monthlyReport;
+    }
+
+    public void setMonthlyReport(Integer monthlyReport) {
+        this.monthlyReport = monthlyReport;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+}
+