From c83101eb62f5d4906b9c01ceea6b21a37f9e84d8 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 18 十一月 2025 09:24:53 +0800
Subject: [PATCH] bug修复
---
ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml | 108 ++++++++++++++++-------------------------------------
1 files changed, 33 insertions(+), 75 deletions(-)
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml
index da7e9ee..1782835 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CalculateRecordMapper.xml
@@ -1,83 +1,41 @@
-<?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">
+<?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.ycl.platform.mapper.CalculateRecordMapper">
-
- <resultMap type="com.ycl.platform.domain.entity.CalculateRecord" id="CalculateRecordResult">
- <result property="id" column="id" />
- <result property="date" column="date" />
- <result property="ruleId" column="rule_id" />
- <result property="unitId" column="unit_id" />
- <result property="totalAmount" column="total_amount" />
- <result property="deductAmount" column="deduct_amount" />
- <result property="score" column="score" />
+
+ <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+ <resultMap id="BaseResultMap" type="com.ycl.platform.domain.vo.CalculateReportDetailVO">
+ <result column="id" property="id" />
+ <result column="create_time" property="createTime" />
+ <result column="deduct_category" property="unitName" />
+ <result column="score_condition" property="contractName" />
+ <result column="description" property="calculateTime" />
+ <result column="deduct_money" property="deductMoney" />
+ <result column="score" property="deductMoney" />
+ <collection property="recordList" column="contract_id" select="selectByContractId" ofType="com.ycl.platform.domain.vo.CalculateMoneyRuleVO"/>
</resultMap>
- <sql id="selectCalculateRecordVo">
- select id, date, rule_id, unit_id, total_amount, deduct_amount, score from t_calculate_record
- </sql>
-
- <select id="selectCalculateRecordList" resultMap="CalculateRecordResult">
- <include refid="selectCalculateRecordVo"/>
- <where>
- <if test="date != null "> and date = #{date}</if>
- <if test="ruleId != null "> and rule_id = #{ruleId}</if>
- <if test="unitId != null "> and unit_id = #{unitId}</if>
- <if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
- <if test="deductAmount != null "> and deduct_amount = #{deductAmount}</if>
- <if test="score != null "> and score = #{score}</if>
- </where>
- </select>
-
- <select id="selectCalculateRecordById" resultMap="CalculateRecordResult">
- <include refid="selectCalculateRecordVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertCalculateRecord" parameterType="CalculateRecord">
- insert into t_calculate_record
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="date != null">date,</if>
- <if test="ruleId != null">rule_id,</if>
- <if test="unitId != null">unit_id,</if>
- <if test="totalAmount != null">total_amount,</if>
- <if test="deductAmount != null">deduct_amount,</if>
- <if test="score != null">score,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id},</if>
- <if test="date != null">#{date},</if>
- <if test="ruleId != null">#{ruleId},</if>
- <if test="unitId != null">#{unitId},</if>
- <if test="totalAmount != null">#{totalAmount},</if>
- <if test="deductAmount != null">#{deductAmount},</if>
- <if test="score != null">#{score},</if>
- </trim>
- </insert>
-
- <update id="updateCalculateRecord">
+ <update id="updateBatch" parameterType="java.util.List">
update t_calculate_record
- <trim prefix="SET" suffixOverrides=",">
- <if test="date != null">date = #{date},</if>
- <if test="ruleId != null">rule_id = #{ruleId},</if>
- <if test="unitId != null">unit_id = #{unitId},</if>
- <if test="totalAmount != null">total_amount = #{totalAmount},</if>
- <if test="deductAmount != null">deduct_amount = #{deductAmount},</if>
- <if test="score != null">score = #{score},</if>
+ <trim prefix="set" suffixOverrides=","><!-- 琛ㄧず鍦ㄧ敓鎴愮殑 SQL 璇彞鍓嶉潰娣诲姞 set 鍏抽敭瀛楋紝骞剁Щ闄ゆ湯灏鹃�楀彿 -->
+ <trim prefix="deduct_money =case" suffix="end,"><!-- 鏋勯�燾ase璇硶 鏈熬鍔犱笂end锛屽鏋滈渶瑕佹洿鏂板涓瓧娈靛鍒惰繖涓猼rim -->
+ <foreach collection="list" item="item">
+ when id=#{item.id} then #{item.deductMoney}
+ </foreach>
+ </trim>
</trim>
- where id = #{id}
+ where id in
+ <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+ #{item.id,jdbcType=BIGINT}
+ </foreach>
</update>
- <delete id="deleteCalculateRecordById" >
- delete from t_calculate_record where id = #{id}
- </delete>
+ <update id="batchPublish">
+ update t_calculate_record set status = 'PUBLISHED'
+ where contract_id = #{contractId} and which_year =#{whichYear}
+ </update>
- <delete id="deleteCalculateRecordByIds" >
- delete from t_calculate_record where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
-</mapper>
\ No newline at end of file
+ <update id="updatePublishById">
+ update t_calculate_record set status = #{status}
+ where id = #{id}
+ </update>
+</mapper>
--
Gitblit v1.8.0