zhaoqiaobo 10 months ago
parent
commit
845e8bfe8b
  1. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

12
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -2032,8 +2032,16 @@
</select> </select>
<select id="selectSignforByDeliveryId" <select id="selectSignforByDeliveryId"
resultType="com.logpm.distribution.entity.DistributionSignforEntity"> resultType="com.logpm.distribution.entity.DistributionSignforEntity">
SELECT * FROM logpm_distribution_signfor AS lds LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id SELECT
WHERE lds.delivery_id = #{deliveryId} AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0 lds.*
FROM
logpm_distribution_signfor AS lds
LEFT JOIN ( SELECT b.id,(b.reservation_num+b.reservation_stock_list_num) AS num FROM logpm_distribution_signfor AS a LEFT JOIN logpm_distribution_reservation AS b ON a.reservation_id = b.id GROUP BY a.reservation_id) AS t ON lds.reservation_id = t.id
WHERE
lds.delivery_id = #{deliveryId}
ANd t.num > 0
GROUP BY
lds.reservation_id
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save