7 | | select u.* |
8 | | from manager m join users u on m.user_id=u.user_id |
9 | | where u.email=input_email and u.pass=input_pass |
| 7 | select user_id as userId, |
| 8 | user_name as userName, |
| 9 | user_surname as userSurname, |
| 10 | user_pass as userPassword, |
| 11 | user_email as userEmail, |
| 12 | user_mobile as userMobile, |
| 13 | user_salt as userSalt, |
| 14 | user_active as userActive, |
| 15 | user_image as userImage, |
| 16 | user_role as userRole, |
| 17 | clazz_ |
| 18 | from users |
| 19 | where user_email = ?1 |
17 | | select a.article_name, man.manufacturer_name, count(au.article_id) as total_units |
18 | | from warehouse w |
19 | | join manager m on m.warehouse_id = w.warehouse_id |
20 | | join article_unit au on au.warehouse_id = w.warehouse_id |
21 | | join article a on au.article_id = a.article_id |
22 | | join manufacturer man on a.manufacturer_id = man.manufacturer_id |
23 | | where m.user_id = curr_user_id |
24 | | group by a.article_name, man.manufacturer_name |
25 | | order by total_units |
| 26 | select a.art_name as articleName, |
| 27 | man.man_name as manufacturerName, |
| 28 | count(au.unit_id) as totalUnits |
| 29 | from warehouse w |
| 30 | join manager m on m.wh_id = w.wh_id |
| 31 | join article_unit au on au.wh_id = w.wh_id |
| 32 | join unit_price up on au.unit_id = up.unit_id |
| 33 | join price p on p.price_id=up.price_id |
| 34 | join article a on p.art_id=a.art_id |
| 35 | join manufacturer man on a.man_id = man.man_id |
| 36 | where m.user_id = :manager |
| 37 | group by a.art_name, man.man_name |
| 38 | order by totalUnits |
30 | | select v.vehicle_plate,v.vehicle_reg |
31 | | from warehouse w |
32 | | join manager m on w.warehouse_id = m.warehouse_id |
33 | | join vehicle v on w.warehouse_id=v.warehouse_id |
34 | | where m.user_id=curr_user_id |
35 | | group by v.vehicle_plate,v.vehicle_reg |
36 | | order by v.vehicle_reg |
| 43 | select v.veh_id as id, |
| 44 | v.veh_carry_weight as carryWeight, |
| 45 | v.veh_service_interval as serviceInterval, |
| 46 | v.veh_kilometers as kilometers, |
| 47 | v.veh_last_service as lastServiceDate, |
| 48 | v.veh_last_service_km as lastServiceKm, |
| 49 | v.veh_plate as plate, |
| 50 | v.veh_vin as vin, |
| 51 | v.veh_reg as registrationDate, |
| 52 | w.wh_id as whId, |
| 53 | c.city_name as city, |
| 54 | r.region_name as region, |
| 55 | d.user_id as driverId, |
| 56 | u1.user_name as driverName, |
| 57 | u1.user_email as driverEmail, |
| 58 | u1.user_mobile as driverPhone, |
| 59 | u1.user_image as driverImg |
| 60 | from warehouse w |
| 61 | join city c on w.city_id = c.city_id |
| 62 | join region r on c.region_id = r.region_id |
| 63 | join manager m on w.wh_id = m.wh_id |
| 64 | join users u on m.user_id = u.user_id |
| 65 | join vehicle v on w.wh_id=v.wh_id |
| 66 | join driver d on d.veh_id=v.veh_id |
| 67 | join users u1 on d.user_id=u1.user_id |
| 68 | where m.user_id = :manager |
| 69 | group by v.veh_id, v.veh_carry_weight, v.veh_service_interval, v.veh_kilometers, v.veh_last_service, v.veh_last_service_km, v.veh_plate, v.veh_vin, v.veh_reg, w.wh_id, c.city_name, r.region_name, d.user_id, u1.user_name, u1.user_email, u1.user_mobile, u1.user_image |
| 70 | order by v.veh_reg |
41 | | select o.* |
42 | | from warehouse w |
43 | | join manager m on w.warehouse_id = m.warehouse_id |
44 | | join article_unit au on au.warehouse_id = w.warehouse_id |
45 | | join orders o on au.order_id = o.order_id |
46 | | where m.user_id = curr_user_id |
47 | | and o.order_status_id = 1 |
48 | | order by o.order_date desc |
| 75 | select o.ord_id as id, |
| 76 | o.ord_date as ordDate, |
| 77 | o.ord_sum as ordSum, |
| 78 | o.ord_fulfillment_date as ordFulfillmentDate, |
| 79 | c.cust_company_name as customerName, |
| 80 | o.ord_comment as ordComment, |
| 81 | o.o_status_id as oStatusId, |
| 82 | o.cust_id as customerId, |
| 83 | o.del_id as deliveryId, |
| 84 | o.pf_id as pfId |
| 85 | from warehouse w |
| 86 | join manager m on w.wh_id= m.wh_id |
| 87 | join article_unit au on au.wh_id = w.wh_id |
| 88 | join orders o on au.ord_id = o.ord_id |
| 89 | join customer c on o.cust_id = c.user_id |
| 90 | join order_status os on os.o_status_id = o.o_status_id |
| 91 | where m.user_id = ?1 |
53 | | select d.* |
54 | | from warehouse w |
55 | | join manager m on w.warehouse_id = m.warehouse_id |
56 | | join article_unit au on w.warehouse_id = au.warehouse_id |
57 | | join orders o on au.order_id = o.order_id |
58 | | join delivery d on o.delivery_id = d.delivery_id |
59 | | where m.user_id=curr_user_id and d.delivery_status_id<>4 |
| 96 | select d.del_id as id, |
| 97 | d.del_date_created as dateCreated, |
| 98 | d.del_date as deliveryDate, |
| 99 | d.del_start_km as delStartKm, |
| 100 | d.del_end_km as delEndKm, |
| 101 | to_char(d.del_start_time, 'HH24:MI:22') as delStartTime, |
| 102 | to_char(d.del_end_time, 'HH24:MI:SS') as delEndTime, |
| 103 | d.d_status_id as dStatusId, |
| 104 | ds.d_status_name as delStatus, |
| 105 | v.veh_id as vehId, |
| 106 | dr.user_id as driverId, |
| 107 | u.user_name as driverName, |
| 108 | u.user_image as driverImage |
| 109 | from warehouse w |
| 110 | join manager m on w.wh_id = m.wh_id |
| 111 | join article_unit au on w.wh_id = au.wh_id |
| 112 | join orders o on au.ord_id = o.ord_id |
| 113 | join delivery d on o.del_id = d.del_id |
| 114 | join delivery_status ds on d.d_status_id=ds.d_status_id |
| 115 | join vehicle v on v.veh_id=d.veh_id |
| 116 | join driver dr on dr.veh_id=v.veh_id |
| 117 | join users u on u.user_id=dr.user_id |
| 118 | where m.user_id=:manager and d.d_status_id<>4 |
96 | | insert into delivery(delivery_date_created,delivery_date,delivery_status_id,vehicle_id) |
97 | | values (current_date,chosen_date,1,chosen_vehicle_id) |
| 150 | insert into delivery(del_date_created, del_date, del_start_km, del_end_km, del_start_time, del_end_time, d_status_id, veh_id) |
| 151 | values (?1,?2,?3,?4,?5,?6,?7,?8) |