From 047505467a0c4b0e7152fb182d92c02479ca1b79 Mon Sep 17 00:00:00 2001 From: Marijana Glavica Date: Tue, 20 Feb 2018 10:12:48 +0100 Subject: [PATCH] items/ind/01.sql --- items/ind/01.sql | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 items/ind/01.sql diff --git a/items/ind/01.sql b/items/ind/01.sql new file mode 100644 index 0000000..1af5708 --- /dev/null +++ b/items/ind/01.sql @@ -0,0 +1,23 @@ +select + concat( ifnull(copynumber,''), ifnull(stocknumber,'') ) as inventarni_broj, + i.biblionumber, + i.itemnumber, + itype as vrsta_gradje, + a1.lib as lokacija, + i.itemcallnumber as signatura, + a2.lib as nije_za_posudbu, + a3.lib as osteceno, + a4.lib as izgubljeno, + a5.lib as otpisano, + onloan as posudjeno_do +from items i +join biblioitems on i.biblionumber=biblioitems.biblionumber +join biblio on biblio.biblionumber=i.biblionumber +left join authorised_values a1 on a1.authorised_value = i.location and a1.category = 'LOC' +left join authorised_values a2 on a2.authorised_value = i.notforloan and a2.category = 'NOT_LOAN' +left join authorised_values a3 on a3.authorised_value = i.damaged and a3.category = 'DAMAGED' +left join authorised_values a4 on a4.authorised_value = i.itemlost and a4.category = 'LOST' +left join authorised_values a5 on a5.authorised_value = i.withdrawn and a5.category = 'WITHDROWN' +where ccode='IND' and location <> 'IZC' and itype <> 'PER' +order by a1.lib, itemcallnumber, itemlost, withdrawn, damaged +; -- 2.20.1