|
|
|
@ -88,13 +88,20 @@ |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="getAllTraceableProducts" resultType="java.util.Map"> |
|
|
|
|
select t1.id, t1.processing_name as processingName, t3.species_name AS speciesName,t2.product_breed as |
|
|
|
|
productBreed |
|
|
|
|
from traceability_product t1 |
|
|
|
|
left join traceability_agricultural_product t2 on t1.cropper_id = t2.id |
|
|
|
|
LEFT JOIN traceability_cropper t4 on t1.cropper_id = t4.id |
|
|
|
|
SELECT |
|
|
|
|
t1.id, |
|
|
|
|
t1.processing_name AS processingName, |
|
|
|
|
t3.species_name AS speciesName, |
|
|
|
|
t2.product_breed AS productBreed, |
|
|
|
|
t1.traceability_code AS traceabilityProduct, |
|
|
|
|
t2.product_pic AS productPic |
|
|
|
|
FROM |
|
|
|
|
traceability_product t1 |
|
|
|
|
LEFT JOIN traceability_agricultural_product t2 ON t1.cropper_id = t2.id |
|
|
|
|
LEFT JOIN traceability_cropper t4 ON t1.cropper_id = t4.id |
|
|
|
|
LEFT JOIN traceability_species t3 ON t4.species_id = t3.id |
|
|
|
|
where t1.deleted = 0 |
|
|
|
|
WHERE |
|
|
|
|
t1.deleted = 0 |
|
|
|
|
<if test="id!=null and id!=''"> |
|
|
|
|
and t1.id=#{id} |
|
|
|
|
</if> |
|
|
|
|