SELECT w.id, w.warehoseCode, w.pastureId FROM warehouse w INNER JOIN warehouse_provider wp ON wp.`warehouseId` = w.`id` WHERE w.`enable`=1 AND isWhPostion = 1 AND (w.pastureId=541) AND wp.`providerId`= 2795