hejianhao
2026-08-28 cc31d303d12f9c7cd2c4574351b67db04069ae0d
tcm-training-admin-backend/src/main/resources/mapper/ClinicQueryMapper.xml
@@ -18,6 +18,9 @@
        <if test="phone != null and phone.trim() != ''">
            AND c.contact_phone LIKE CONCAT('%', #{phone}, '%')
        </if>
        <if test="agentName != null and agentName.trim() != ''">
            AND pa.agent_name LIKE CONCAT('%', #{agentName}, '%')
        </if>
        <if test="createdFrom != null">
            AND c.created_at &gt;= #{createdFrom}
        </if>
@@ -44,10 +47,12 @@
                ELSE NULL
            END AS regionName,
            c.status,
            pa.agent_name AS agentName,
            COUNT(u.id) AS userCount,
            c.created_at AS createdAt,
            c.business_license_url AS businessLicenseUrl
        FROM tcm_clinic c
        LEFT JOIN tcm_provincial_agent pa ON pa.id = c.agent_id AND pa.deleted = 0
        LEFT JOIN tcm_app_user u ON u.clinic_id = c.id AND u.deleted = 0
        <include refid="ClinicWhere"/>
        GROUP BY
@@ -58,6 +63,7 @@
            c.city_name,
            c.district_name,
            c.status,
            pa.agent_name,
            c.created_at,
            c.business_license_url
        ORDER BY c.id DESC
@@ -78,10 +84,12 @@
                ELSE NULL
            END AS regionName,
            c.status,
            pa.agent_name AS agentName,
            COUNT(u.id) AS userCount,
            c.created_at AS createdAt,
            c.business_license_url AS businessLicenseUrl
        FROM tcm_clinic c
        LEFT JOIN tcm_provincial_agent pa ON pa.id = c.agent_id AND pa.deleted = 0
        LEFT JOIN tcm_app_user u ON u.clinic_id = c.id AND u.deleted = 0
        <include refid="ClinicWhere"/>
        GROUP BY
@@ -92,6 +100,7 @@
            c.city_name,
            c.district_name,
            c.status,
            pa.agent_name,
            c.created_at,
            c.business_license_url
        ORDER BY c.id DESC