From d6388d041cc58b9f2be3ddcddfb6042e7af094f7 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期一, 11 五月 2026 10:11:00 +0800
Subject: [PATCH] fix(stock): 修复库存盘点计划中的出入库记录类型错误

---
 src/main/resources/mapper/basic/CustomerContactMapper.xml |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/main/resources/mapper/basic/CustomerContactMapper.xml b/src/main/resources/mapper/basic/CustomerContactMapper.xml
index 1c2f582..c680e53 100644
--- a/src/main/resources/mapper/basic/CustomerContactMapper.xml
+++ b/src/main/resources/mapper/basic/CustomerContactMapper.xml
@@ -5,8 +5,8 @@
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="BaseResultMap" type="com.ruoyi.basic.pojo.CustomerContact">
         <id column="id" property="id" />
-        <result column="contact_name" property="contactName" />
-        <result column="phone" property="phone" />
+        <result column="contact_person" property="contactPerson" />
+        <result column="contact_phone" property="contactPhone" />
         <result column="customer_id" property="customerId" />
         <result column="dept_id" property="deptId" />
         <result column="create_user" property="createUser" />
@@ -17,22 +17,28 @@
         <result column="del_flag" property="delFlag" />
     </resultMap>
     <select id="listPage" resultType="com.ruoyi.basic.dto.CustomerContactDto">
+        select * from (
         SELECT
-        cc.*,
+        c.*,
         (
         SELECT GROUP_CONCAT(ci.customer_name SEPARATOR ',')
         FROM customer ci
-        WHERE FIND_IN_SET(ci.id, cc.customer_id)
+        WHERE FIND_IN_SET(ci.id, c.customer_id)
         ) AS customer_names
-        FROM customer_contact cc
+        FROM customer_contact c
+        ) as cc
         <where>
             cc.del_flag = 0
-            <if test="customerContactDto.contactName != null and customerContactDto.contactName !=''">
-                and cc.contact_name = #{customerContactDto.contactName}
+            <if test="customerContactDto.contactPerson != null and customerContactDto.contactPerson !=''">
+                and cc.contact_person like concat('%',#{customerContactDto.contactPerson},'%')
             </if>
-            <if test="customerContactDto.phone != null and customerContactDto.phone !=''">
-                and cc.phone = #{customerContactDto.phone}
+            <if test="customerContactDto.contactPhone != null and customerContactDto.contactPhone !=''">
+                and cc.contact_phone like concat('%',#{customerContactDto.contactPhone},'%')
             </if>
+            <if test="customerContactDto.customerId != null and customerContactDto.customerId !=''">
+                and FIND_IN_SET(#{customerContactDto.customerId}, cc.customer_id)
+            </if>
+
         </where>
     </select>
 </mapper>

--
Gitblit v1.9.3