From 686bd303ddc68db338fe352c38392194217168a5 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: Tue, 11 Mar 2025 15:27:59 +0800
Subject: [PATCH] 修改业务逻辑增加项目编码
---
expert-system/src/main/resources/mapper/system/ProjectExpertDetailMapper.xml | 67 +++++++++++++++++++++++++++------
1 files changed, 54 insertions(+), 13 deletions(-)
diff --git a/expert-system/src/main/resources/mapper/system/ProjectExpertDetailMapper.xml b/expert-system/src/main/resources/mapper/system/ProjectExpertDetailMapper.xml
index 69bdbd6..c306e4b 100644
--- a/expert-system/src/main/resources/mapper/system/ProjectExpertDetailMapper.xml
+++ b/expert-system/src/main/resources/mapper/system/ProjectExpertDetailMapper.xml
@@ -6,9 +6,10 @@
<resultMap type="ProjectExpertDetail" id="ProjectExpertDetailResult">
<result property="id" column="id" />
- <result property="projectExpert" column="project_expert" />
+ <result property="projectExpertId" column="project_expert_id" />
<result property="content" column="content" />
<result property="score" column="score" />
+ <result property="scoreType" column="score_type" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
@@ -17,16 +18,18 @@
</resultMap>
<sql id="selectProjectExpertDetailVo">
- select id, project_expert, content, score, del_flag, create_by, create_time, update_by, update_time from project_expert_detail
+ select id, project_expert_id, content, score, del_flag,score_type, create_by, create_time, update_by, update_time from project_expert_detail
</sql>
<select id="selectProjectExpertDetailList" parameterType="ProjectExpertDetail" resultMap="ProjectExpertDetailResult">
<include refid="selectProjectExpertDetailVo"/>
- <where>
- <if test="projectExpert != null "> and project_expert = #{projectExpert}</if>
+ <where>
+ and del_flag = 0
+ <if test="projectExpertId != null "> and project_expert_id = #{projectExpertId}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
<if test="score != null "> and score = #{score}</if>
</where>
+ order by create_time desc
</select>
<select id="selectProjectExpertDetailById" parameterType="Long" resultMap="ProjectExpertDetailResult">
@@ -37,9 +40,10 @@
<insert id="insertProjectExpertDetail" parameterType="ProjectExpertDetail" useGeneratedKeys="true" keyProperty="id">
insert into project_expert_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="projectExpert != null">project_expert,</if>
+ <if test="projectExpertId != null">project_expert_id,</if>
<if test="content != null and content != ''">content,</if>
<if test="score != null">score,</if>
+ <if test="scoreType != null and scoreType != ''">score_type,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@@ -47,9 +51,10 @@
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="projectExpert != null">#{projectExpert},</if>
+ <if test="projectExpertId != null">#{projectExpertId},</if>
<if test="content != null and content != ''">#{content},</if>
<if test="score != null">#{score},</if>
+ <if test="scoreType != null and scoreType != ''">#{scoreType},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@@ -58,12 +63,30 @@
</trim>
</insert>
+ <insert id="batchInsertProjectExpertDetail" parameterType="java.util.List" >
+ insert into project_expert_detail
+ ( project_expert_id, content, score, score_type, create_by)
+ values
+ <foreach collection="list" item="item" separator=",">
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="item.projectExpertId != null">#{item.projectExpertId},</if>
+ <if test="item.content != null and item.content != ''">#{item.content},</if>
+ <if test="item.score != null">#{item.score},</if>
+ <if test="item.scoreType != null and item.scoreType != ''">#{item.scoreType},</if>
+ <if test="item.createBy != null">#{item.createBy},</if>
+ </trim>
+ </foreach>
+ </insert>
+
+
+
<update id="updateProjectExpertDetail" parameterType="ProjectExpertDetail">
update project_expert_detail
<trim prefix="SET" suffixOverrides=",">
- <if test="projectExpert != null">project_expert = #{projectExpert},</if>
+ <if test="projectExpertId != null">project_expert_id = #{projectExpertId},</if>
<if test="content != null and content != ''">content = #{content},</if>
<if test="score != null">score = #{score},</if>
+ <if test="scoreType != null and scoreType != ''">score_type = #{scoreType},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@@ -73,14 +96,32 @@
where id = #{id}
</update>
- <delete id="deleteProjectExpertDetailById" parameterType="Long">
- delete from project_expert_detail where id = #{id}
- </delete>
+ <update id="batchUpdateProjectExpertDetail" parameterType="java.util.List">
+ <foreach collection="list" item="item" separator=";">
+ update project_expert_detail
+ <trim prefix="SET" suffixOverrides=",">
+ <if test="item.projectExpertId != null">project_expert_id = #{item.projectExpertId},</if>
+ <if test="item.content != null and item.content != ''">content = #{item.content},</if>
+ <if test="item.score != null">score = #{item.score},</if>
+ <if test="item.scoreType != null and item.scoreType != ''">score_type = #{item.scoreType},</if>
+ <if test="item.delFlag != null">del_flag = #{item.delFlag},</if>
+ <if test="item.createBy != null">create_by = #{item.createBy},</if>
+ <if test="item.createTime != null">create_time = #{item.createTime},</if>
+ <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
+ <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
+ </trim>
+ where id = #{item.id}
+ </foreach>
+ </update>
- <delete id="deleteProjectExpertDetailByIds" parameterType="String">
- delete from project_expert_detail where id in
+ <update id="deleteProjectExpertDetailById" parameterType="Long">
+ update project_expert_detail set del_flag = 1 where id = #{id}
+ </update>
+
+ <update id="deleteProjectExpertDetailByIds" parameterType="String">
+ update project_expert_detail set del_flag = 1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
- </delete>
+ </update>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.2