huminmin
10 天以前 c383c8ca7053005ffa3ee58efd89956fbf52c9ea
src/main/resources/mapper/basic/CustomerMapper.xml
@@ -12,10 +12,10 @@
        u.user_name usage_user_name,
        (
        select group_concat(u2.user_name separator ', ')
        from customer_private_pool cpp2
        left join sys_user u2 on cpp2.bound_id = u2.user_id
        where cpp2.customer_id = c.id and cpp2.delete_flag = 0
        and cpp2.bound_id != c.usage_user
        from customer_user cu
        left join sys_user u2 on cu.user_id = u2.user_id
        where cu.customer_id = c.id
        and cu.user_id != c.usage_user
        ) as together_user_names
        from customer c
        left join sys_user u on c.usage_user = u.user_id
@@ -26,6 +26,14 @@
            <if test="c.customerType != null and c.customerType != ''">
                and customer_type = #{c.customerType}
            </if>
            <!-- 私海查询:type = 0(私海客户)或者 type = 1(公海客户)且已被分配 -->
            <if test="c.type != null and c.type == 0">
                and type = #{c.type} or (type = 1 and is_assigned = 1)
            </if>
            <!-- 公海查询:type = 1(公海客户)-->
            <if test="c.type != null and c.type == 1">
                and type = #{c.type}
            </if>
        </where>
    </select>