From 8585b431e9257333413358eb37c30ae58f74db76 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Thu, 13 Aug 2026 15:46:10 +0800
Subject: [PATCH] refactor(database): 优化数据库查询中的字段映射
---
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/mapper/GdFlyerMapper.xml | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/mapper/GdFlyerMapper.xml b/drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/mapper/GdFlyerMapper.xml
index 89a5f7b..2f2a9c5 100644
--- a/drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/mapper/GdFlyerMapper.xml
+++ b/drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/mapper/GdFlyerMapper.xml
@@ -11,7 +11,7 @@
<result column="project_experience" property="projectExperience"/>
<result column="technical_strength" property="technicalStrength"/>
<result column="skilled_uav_type" property="skilledUavType"/>
- <result column="skilled_task_type" property="skilledTaskType"/>
+ <result column="skilled_task_type" property="skilledTaskType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/>
<result column="area_code" property="areaCode"/>
<result column="flyer_address" property="flyerAddress"/>
<result column="certification" property="certification" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
@@ -33,7 +33,7 @@
<result column="project_experience" property="projectExperience"/>
<result column="technical_strength" property="technicalStrength"/>
<result column="skilled_uav_type" property="skilledUavType"/>
- <result column="skilled_task_type" property="skilledTaskType"/>
+ <result column="skilled_task_type" property="skilledTaskType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/>
<result column="area_code" property="areaCode"/>
<result column="flyer_address" property="flyerAddress"/>
<result column="certification" property="certification" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
@@ -43,9 +43,10 @@
<select id="selectGdFlyerPage" resultMap="gdFlyerVOResultMap">
select
*,
- CASE
- WHEN #{param2.areaCode} IS NOT NULL AND #{param2.areaCode} != ''
- AND area_code LIKE concat('%',#{param2.areaCode},'%') THEN 1
+ CASE
+ WHEN CAST(#{param2.skilledTaskType} AS VARCHAR) IS NOT NULL
+ AND CAST(#{param2.skilledTaskType} AS VARCHAR) != ''
+ AND skilled_task_type = #{param2.skilledTaskType} THEN 1
ELSE 0
END as area_match_flag
from
@@ -64,9 +65,9 @@
<if test="param2.skilledUavType != null and param2.skilledUavType != ''">
and skilled_uav_type = #{param2.skilledUavType}
</if>
- <if test="param2.skilledTaskType != null and param2.skilledTaskType != ''">
- and skilled_task_type = #{param2.skilledTaskType}
- </if>
+ <!-- <if test="param2.skilledTaskType != null and param2.skilledTaskType != ''"> -->
+ <!-- and skilled_task_type = #{param2.skilledTaskType} -->
+ <!-- </if> -->
<!-- <if test="param2.deptList != null and param2.deptList.size > 0"> -->
<!-- AND create_dept in -->
<!-- <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")"> -->
--
Gitblit v1.9.3