liujie
2025-10-14 08892731ebf9a4a6004700d5b3710f7ea3c7b5b5
ruoyi-system/src/main/resources/mapper/system/TErpClinicWarehousingMapper.xml
@@ -123,19 +123,20 @@
    <select id="warehousePageList" resultType="com.ruoyi.system.vo.TErpClinicWarehousePageListVO">
        select t1.id,t1.warehouse_no,
               case when t1.type =1 then  t2.supplier_name else t4.supplier_name end as supplierName,
               case when t1.type =1 then  t2.supplier_name else t1.supplier_name end as supplierName,
              t3.procurement_code,
              case when t1.type =1 then     t3.pay_money else t1.total_price end as allTotalPrice,
            t1.create_time warehouseTime,t1.type
        from t_erp_clinic_warehousing t1 left join t_erp_procurement t3 on t1.procurement_id = t3.id
        from t_erp_clinic_warehousing t1
        left join t_erp_procurement t3 on t1.procurement_id = t3.id
        left join t_crm_supplier t2 on t3.supplier_id = t2.id and t1.type =1
        left join t_crm_supplier t4 on t1.supplier_id = t4.id and t1.type !=1
        where t1.disabled = 0 and t1.clinic_id = #{supplierClinicId}
        where t1.disabled = 0 and t1.clinic_id = #{supplierClinicId} and t1.status =2
        <if test="query.warehouseNo != null and query.warehouseNo != ''">
            and t1.warehouse_no like concat('%',#{query.warehouseNo},'%')
        </if>
        <if test="query.supplierName != null and query.supplierName != ''">
            and (t2.supplier_name like concat('%',#{query.supplierName},'%') or t4.supplier_name like concat('%',#{query.supplierName},'%'))
            and (t2.supplier_name like concat('%',#{query.supplierName},'%') or t1.supplier_name like concat('%',#{query.supplierName},'%'))
        </if>
        <if test="sTime != null">
            and t1.create_time between #{sTime} and #{eTime}