| | |
| | | </select> |
| | | |
| | | <select id="warehousePageList" resultType="com.ruoyi.system.vo.TErpClinicWarehousePageListVO"> |
| | | select t1.id,t1.warehouse_no,t2.supplier_name,t3.procurement_code,t3.pay_money allTotalPrice,t1.create_time warehouseTime,t1.type |
| | | select t1.id,t1.warehouse_no, |
| | | case when t1.type =1 then t2.supplier_name else t4.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 |
| | | left join t_crm_supplier t2 on t3.supplier_id = t2.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} |
| | | <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},'%') |
| | | and (t2.supplier_name like concat('%',#{query.supplierName},'%') or t4.supplier_name like concat('%',#{query.supplierName},'%')) |
| | | </if> |
| | | <if test="sTime != null"> |
| | | and t1.create_time between #{sTime} and #{eTime} |