package org.openlmis.stock.repository.mapper;

import org.apache.ibatis.annotations.Select;
import org.openlmis.stock.domain.Manufacturer;
import org.openlmis.stock.domain.VaccinePackaging;

/**
 * Created by Morley on 6/20/2015.
 */
public interface HasVaccinePackaging {

    @Select("SELECT * FROM vaccine_packaging WHERE id = #{packagingId}")
    VaccinePackaging getVaccinePackagingById(Long packagingId);
}

@@ -40,16 +40,149 @@
 apper;%0A%0A
+import org.apache.ibatis.annotations.One;%0Aimport org.apache.ibatis.annotations.Result;%0Aimport org.apache.ibatis.annotations.Results;%0A
 import o
@@ -218,16 +218,16 @@
 Select;%0A
-
 import o
@@ -265,16 +265,58 @@
 cturer;%0A
+import org.openlmis.stock.domain.Vaccine;%0A
 import o
@@ -439,16 +439,40 @@
 ckaging 
+extends HasVaccineMapper
 %7B%0A%0A    @
@@ -547,63 +547,546 @@
     
-VaccinePackaging getVaccinePackagingById(Long packaging
+@Results(value = %7B%0A            @Result(property = %22vaccine%22, javaType = Vaccine.class, column = %22vaccine_id%22,%0A                    one = @One(select = %22getVaccineById%22)),%0A            @Result(property = %22manufacturer%22, javaType = Manufacturer.class, column = %22manufacturer_id%22,%0A                    one = @One(select = %22getManufacturerById%22))%0A    %7D)%0A    VaccinePackaging getVaccinePackagingById(Long packagingId);%0A%0A    @Select(%22SELECT * FROM manufacturers WHERE id = #%7BmanufacturerId%7D%22)%0A    Manufacturer getManufacturerById(Long manufacturer
 Id);

Add vaccine to every vaccine package