From 62a7f3228c94db41bf57858a6549eb0db033bf1e Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期三, 29 五月 2024 11:44:17 +0800
Subject: [PATCH] 2024-05-29 朱宝民
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrGroupUnitMapper.xml | 37 ++++++++++++++++---------------------
1 files changed, 16 insertions(+), 21 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrGroupUnitMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrGroupUnitMapper.xml
index 4fa6d92..de655c8 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrGroupUnitMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrGroupUnitMapper.xml
@@ -9,12 +9,11 @@
<result column="unit_id" jdbcType="BIGINT" property="unitId" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="operate_time" jdbcType="TIMESTAMP" property="operateDt" />
- <result column="deleted" jdbcType="TINYINT" property="deleted" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, group_id, unit_id, `operator`,
- operate_time, deleted
+ operate_time
</sql>
<!--娣诲姞-->
@@ -37,9 +36,7 @@
<if test="operateDt != null">
operate_time,
</if>
- <if test="deleted != null">
- deleted,
- </if>
+
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -57,35 +54,33 @@
<if test="operateDt != null">
#{operateDt,jdbcType=TIMESTAMP},
</if>
- <if test="deleted != null">
- #{deleted,jdbcType=TINYINT},
- </if>
+
</trim>
</insert>
- <!--閫昏緫鍒犻櫎-->
- <delete id="deleteLogicById" parameterType="java.lang.Long">
- <!--@mbg.generated-->
- update ir_group_unit
- set deleted = 1
- where id = #{id,jdbcType=BIGINT}
- </delete>
+
<delete id="deleteByUnitIdGroupId" parameterType="com.dy.pipIrrGlobal.pojoIr.IrGroupUnit">
- update ir_group_unit
- set deleted = 1,operator = #{operator,jdbcType=BIGINT},operate_time = #{operateDt,jdbcType=TIMESTAMP}
+ delete from ir_group_unit
where group_id = #{groupId,jdbcType=BIGINT} and unit_id = #{unitId,jdbcType=BIGINT}
</delete>
<delete id="deleteByUnitId">
- update ir_group_unit
- set deleted = 1
+ delete from ir_group_unit
where unit_id = #{unitId,jdbcType=BIGINT}
</delete>
<delete id="deleteByGroupId">
- update ir_group_unit
- set deleted = 1
+ delete from ir_group_unit
where group_id = #{groupId,jdbcType=BIGINT}
</delete>
+
+<!-- //鏌ヤ竴涓疆鐏岀粍缁戝畾鐨勭亴婧夊崟鍏僫d-->
+ <select id="getGroupBindUnits" parameterType="Long" resultType="java.lang.Long">
+ SELECT unit_id AS unitId FROM `ir_group_unit`WHERE group_id = #{groupId,jdbcType=BIGINT}
+ </select>
+
+ <select id="getNotBindUnits" resultType="java.lang.Long">
+ SELECT id FROM ir_irrigate_unit WHERE id NOT IN (SELECT unit_id FROM ir_group_unit)
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0