From 3664ff0935aeab26d23926331333a1f55caea1c1 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Mon, 19 Jan 2026 15:23:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/mapper/GdSupplyDemandMapper.xml |  208 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 208 insertions(+), 0 deletions(-)

diff --git a/drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/mapper/GdSupplyDemandMapper.xml b/drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/mapper/GdSupplyDemandMapper.xml
index 235af03..a5ed39f 100644
--- a/drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/mapper/GdSupplyDemandMapper.xml
+++ b/drone-service/drone-gd/src/main/java/org/sxkj/gd/orderdata/mapper/GdSupplyDemandMapper.xml
@@ -29,6 +29,103 @@
         <result column="is_deleted" property="isDeleted"/>
     </resultMap>
 
+    <sql id="gdSupplyDemandCondition">
+        <if test="param.id != null">
+            AND id = #{param.id}
+        </if>
+        <if test="param.demandName != null and param.demandName != ''">
+            AND demand_name = #{param.demandName}
+        </if>
+        <if test="param.demandType != null and param.demandType != ''">
+            AND demand_type = #{param.demandType}
+        </if>
+        <if test="param.contactPerson != null and param.contactPerson != ''">
+            AND contact_person = #{param.contactPerson}
+        </if>
+        <if test="param.contactPhone != null and param.contactPhone != ''">
+            AND contact_phone = #{param.contactPhone}
+        </if>
+        <if test="param.contactEmail != null and param.contactEmail != ''">
+            AND contact_email = #{param.contactEmail}
+        </if>
+        <if test="param.demandStatus != null and param.demandStatus != ''">
+            AND demand_status = #{param.demandStatus}
+        </if>
+        <if test="param.updateCycle != null and param.updateCycle != ''">
+            AND update_cycle = #{param.updateCycle}
+        </if>
+        <if test="param.applyBasis != null and param.applyBasis != ''">
+            AND apply_basis = #{param.applyBasis}
+        </if>
+        <if test="param.shareType != null and param.shareType != ''">
+            AND share_type = #{param.shareType}
+        </if>
+        <if test="param.applicationScene != null and param.applicationScene != ''">
+            AND application_scene = #{param.applicationScene}
+        </if>
+        <if test="param.responsibleDeptId != null and param.responsibleDeptId != ''">
+            AND responsible_dept_id = #{param.responsibleDeptId}
+        </if>
+        <if test="param.applyTargetDeptId != null and param.applyTargetDeptId != ''">
+            AND apply_target_dept_id = #{param.applyTargetDeptId}
+        </if>
+        <if test="param.dataSource != null and param.dataSource != ''">
+            AND data_source = #{param.dataSource}
+        </if>
+        <if test="param.demandInfo != null and param.demandInfo != ''">
+            AND demand_info = #{param.demandInfo}
+        </if>
+        <if test="param.areaCode != null and param.areaCode != ''">
+            AND area_code = #{param.areaCode}
+        </if>
+        <if test="param.createUser != null">
+            AND create_user = #{param.createUser}
+        </if>
+        <if test="param.createDept != null">
+            AND create_dept = #{param.createDept}
+        </if>
+        <if test="param.createTime != null">
+            AND create_time = #{param.createTime}
+        </if>
+        <if test="param.updateUser != null">
+            AND update_user = #{param.updateUser}
+        </if>
+        <if test="param.updateTime != null">
+            AND update_time = #{param.updateTime}
+        </if>
+        <if test="param.status != null and param.status != ''">
+            AND status = #{param.status}
+        </if>
+    </sql>
+
+    <select id="selectGdSupplyDemandList" resultMap="gdSupplyDemandResultMap">
+        select * from ja_gd_supply_demand
+        <where>
+            is_deleted = 0
+            <include refid="gdSupplyDemandCondition"/>
+        </where>
+    </select>
+
+    <select id="selectGdSupplyDemandDetail" resultMap="gdSupplyDemandResultMap">
+        select * from ja_gd_supply_demand
+        <where>
+            is_deleted = 0
+            <include refid="gdSupplyDemandCondition"/>
+            <if test="deptIdList != null and deptIdList.size > 0">
+                AND (
+                    create_dept IN
+                    <foreach collection="deptIdList" item="deptId" open="(" separator="," close=")">
+                        #{deptId}
+                    </foreach>
+                    OR apply_target_dept_id IN
+                    <foreach collection="deptIdList" item="deptId" open="(" separator="," close=")">
+                        #{deptId}
+                    </foreach>
+                )
+            </if>
+        </where>
+        limit 1
+    </select>
 
     <select id="selectGdSupplyDemandPage" resultMap="gdSupplyDemandResultMap">
         select * from ja_gd_supply_demand
@@ -40,9 +137,120 @@
             <if test="param.demandStatus != null and param.demandStatus != ''">
                 AND demand_status = #{param.demandStatus}
             </if>
+            <if test="deptIdList != null and deptIdList.size > 0">
+                AND (
+                    create_dept IN
+                    <foreach collection="deptIdList" item="deptId" open="(" separator="," close=")">
+                        #{deptId}
+                    </foreach>
+                    OR apply_target_dept_id IN
+                    <foreach collection="deptIdList" item="deptId" open="(" separator="," close=")">
+                        #{deptId}
+                    </foreach>
+                )
+            </if>
         </where>
     </select>
 
+    <insert id="insertGdSupplyDemand" useGeneratedKeys="true" keyProperty="id">
+        insert into ja_gd_supply_demand (
+            demand_name,
+            demand_type,
+            contact_person,
+            contact_phone,
+            contact_email,
+            demand_status,
+            update_cycle,
+            apply_basis,
+            share_type,
+            application_scene,
+            responsible_dept_id,
+            apply_target_dept_id,
+            data_source,
+            demand_info,
+            area_code,
+            create_user,
+            create_dept,
+            update_user
+        ) values (
+            #{demandName},
+            #{demandType},
+            #{contactPerson},
+            #{contactPhone},
+            #{contactEmail},
+            #{demandStatus},
+            #{updateCycle},
+            #{applyBasis},
+            #{shareType},
+            #{applicationScene},
+            #{responsibleDeptId},
+            #{applyTargetDeptId},
+            #{dataSource},
+            #{demandInfo},
+            #{areaCode},
+            #{createUser},
+            #{createDept},
+            #{updateUser}
+        )
+    </insert>
+
+    <update id="updateGdSupplyDemand">
+        update ja_gd_supply_demand
+        <set>
+            <if test="demandName != null">
+                demand_name = #{demandName},
+            </if>
+            <if test="demandType != null">
+                demand_type = #{demandType},
+            </if>
+            <if test="contactPerson != null">
+                contact_person = #{contactPerson},
+            </if>
+            <if test="contactPhone != null">
+                contact_phone = #{contactPhone},
+            </if>
+            <if test="contactEmail != null">
+                contact_email = #{contactEmail},
+            </if>
+            <if test="demandStatus != null">
+                demand_status = #{demandStatus},
+            </if>
+            <if test="updateCycle != null">
+                update_cycle = #{updateCycle},
+            </if>
+            <if test="applyBasis != null">
+                apply_basis = #{applyBasis},
+            </if>
+            <if test="shareType != null">
+                share_type = #{shareType},
+            </if>
+            <if test="applicationScene != null">
+                application_scene = #{applicationScene},
+            </if>
+            <if test="responsibleDeptId != null">
+                responsible_dept_id = #{responsibleDeptId},
+            </if>
+            <if test="applyTargetDeptId != null">
+                apply_target_dept_id = #{applyTargetDeptId},
+            </if>
+            <if test="dataSource != null">
+                data_source = #{dataSource},
+            </if>
+            <if test="demandInfo != null">
+                demand_info = #{demandInfo},
+            </if>
+            <if test="areaCode != null">
+                area_code = #{areaCode},
+            </if>
+            <if test="updateUser != null">
+                update_user = #{updateUser},
+            </if>
+            <if test="status != null">
+                status = #{status},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
 
     <select id="exportGdSupplyDemand" resultType="org.sxkj.gd.orderdata.excel.GdSupplyDemandExcel">
         SELECT * FROM ja_gd_supply_demand ${ew.customSqlSegment}

--
Gitblit v1.9.3