From 3d191e81842cf3bcd6f841fbe2fc3d451c45ef99 Mon Sep 17 00:00:00 2001
From: hongjli <3117313295@qq.com>
Date: 星期三, 14 五月 2025 13:54:40 +0800
Subject: [PATCH] 钣金计划大表增加“异常状态”字段
---
aps-modules/aps-core/src/main/resources/mapper/core/ApsWorkCalendarMapper.xml | 35 ++++++++++++++++++++++++++++-------
1 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/aps-modules/aps-core/src/main/resources/mapper/core/ApsWorkCalendarMapper.xml b/aps-modules/aps-core/src/main/resources/mapper/core/ApsWorkCalendarMapper.xml
index dc81ab9..b6effe1 100644
--- a/aps-modules/aps-core/src/main/resources/mapper/core/ApsWorkCalendarMapper.xml
+++ b/aps-modules/aps-core/src/main/resources/mapper/core/ApsWorkCalendarMapper.xml
@@ -18,10 +18,13 @@
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
+ <result property="holidays" column="holidays" />
+ <result property="applicable" column="applicable" />
+ <result property="applicableTranslate" column="applicable_translate" />
</resultMap>
<sql id="selectApsWorkCalendarVo">
- select id, description, type, effective_date, expiring_date, content, applicable_factory, applicable_workshop, applicable_process, create_by, create_time, update_by, update_time from aps_work_calendar
+ select id, description, type, effective_date, expiring_date, content, applicable_factory, applicable_workshop, applicable_process, create_by, create_time, update_by, update_time, holidays, applicable, applicable_translate from aps_work_calendar
</sql>
<select id="selectApsWorkCalendarList" parameterType="ApsWorkCalendar" resultMap="ApsWorkCalendarResult">
@@ -29,10 +32,15 @@
<where>
<if test="description != null and description != ''"> and description like '%' || #{description} || '%'</if>
<if test="type != null and type != ''"> and type = #{type}</if>
- <if test="effectiveDate != null "> and effective_date = #{effectiveDate}</if>
- <if test="expiringDate != null "> and expiring_date = #{expiringDate}</if>
- <if test="content != null and content != ''"> and content = #{content}</if>
- <if test="applicableFactory != null and applicableFactory != ''"> and applicable_factory = #{applicableFactory}</if>
+ <if test="effectiveDate != null and expiringDate != null"> and ((effective_date >= #{effectiveDate} and effective_date <= #{expiringDate}) or (expiring_date >= #{effectiveDate} and expiring_date <= #{expiringDate}))</if>
+<!-- <if test="content != null and content != ''"> and content = #{content}</if>-->
+ <if test="applicableFactory != null and applicableFactory != ''">
+ and EXISTS (
+ SELECT 1
+ FROM jsonb_array_elements(applicable) AS obj
+ WHERE obj ->> 'factory' = #{applicableFactory}
+ )
+ </if>
<if test="applicableWorkshop != null and applicableWorkshop != ''"> and applicable_workshop = #{applicableWorkshop}</if>
<if test="applicableProcess != null and applicableProcess != ''"> and applicable_process = #{applicableProcess}</if>
</where>
@@ -59,6 +67,9 @@
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
+ <if test="holidays != null">holidays,</if>
+ <if test="applicable != null">applicable,</if>
+ <if test="applicableTranslate != null">applicable_translate,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@@ -74,6 +85,9 @@
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
+ <if test="holidays != null">#{holidays, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if>
+ <if test="applicable != null">#{applicable, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if>
+ <if test="applicableTranslate != null">#{applicableTranslate},</if>
</trim>
</insert>
@@ -92,6 +106,9 @@
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
+ <if test="holidays != null">holidays = #{holidays, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if>
+ <if test="applicable != null">applicable = #{applicable, typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if>
+ <if test="applicableTranslate != null">applicable_translate = #{applicableTranslate},</if>
</trim>
where id = #{id}
</update>
@@ -100,10 +117,14 @@
delete from aps_work_calendar where id = #{id}
</delete>
- <delete id="deleteApsWorkCalendarByIds" parameterType="String">
- delete from aps_work_calendar where id in
+ <delete id="deleteApsWorkCalendarByIds" parameterType="ApsWorkCalendar">
+ delete from aps_work_calendar where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
+
+ <delete id="deleteApsWorkCalendar" parameterType="ApsWorkCalendar">
+ delete from aps_work_calendar where effective_date=#{effectiveDate} and expiring_date=#{expiringDate} and applicable_factory=#{applicableFactory} and applicable_workshop=#{applicableWorkshop} and applicable_process=#{applicableProcess}
+ </delete>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3