1.添加返回字段

main
862857010@qq.com 2 years ago
parent e46843bd9b
commit 580b8213f4
  1. 19
      cjy-module-traceability/cjy-module-traceability-biz/src/main/resources/mapper/product/ProductMapper.xml

@ -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>

Loading…
Cancel
Save