SELECT IFNULL(SUM( business_num ),0) businessNum from jg_business_order_product_relational where business_order_id in (SELECT a.id from jg_business_order a
LEFT JOIN flow_task b on a.id = b.f_process_id
where business_type = #{businessOrderEntity.businessType} and b.f_status = 2 and
DATE(a.f_last_modify_time) = #{businessOrderEntity.searchDateString}) AND product_id = #{businessOrderEntity.productId}
SELECT IFNULL(SUM( business_num ),0) businessNum from jg_business_order_product_relational where business_order_id in (SELECT a.id from jg_business_order a
LEFT JOIN flow_task b on a.id = b.f_process_id
where business_type = #{businessOrderEntity.businessType} and b.f_status = 2 and
date_format(a.f_last_modify_time,'%Y-%m') = #{businessOrderEntity.searchDateString}) AND product_id = #{businessOrderEntity.productId}
SELECT IFNULL(SUM( outbound_number ),0) businessNum from jg_warehousing_outbound_product where warehousing_outbound_id in (SELECT a.id from jg_warehousing_outbound a
LEFT JOIN flow_task b on a.id = b.f_process_id
where a.warehousing_outbound_type = #{warehousingOutboundEntity.warehousingOutboundType} and (b.f_status = 2 or b.f_status is null) and
DATE(a.f_last_modify_time) = #{warehousingOutboundEntity.searchDateString}) AND product_id = #{warehousingOutboundEntity.productId}
SELECT IFNULL(SUM( outbound_number ),0) businessNum from jg_warehousing_outbound_product where warehousing_outbound_id in (SELECT a.id from jg_warehousing_outbound a
LEFT JOIN flow_task b on a.id = b.f_process_id
where a.warehousing_outbound_type = #{warehousingOutboundEntity.warehousingOutboundType} and (b.f_status = 2 or b.f_status is null) and
date_format(a.f_last_modify_time,'%Y-%m') = #{warehousingOutboundEntity.searchDateString}) AND product_id = #{warehousingOutboundEntity.productId}
SELECT IFNULL(SUM( storage_number ),0) businessNum from jg_warehousing_storage_product where warehousing_storage_id in (SELECT a.id from jg_warehousing_storage a
LEFT JOIN flow_task b on a.id = b.f_process_id
where a.warehousing_storage_type = #{warehousingStorage.warehousingStorageType} and (b.f_status = 2 or b.f_status is null) and
DATE(a.f_last_modify_time) = #{warehousingStorage.searchDateString}) AND product_id = #{warehousingStorage.productId}
SELECT IFNULL(SUM( storage_number ),0) businessNum from jg_warehousing_storage_product where warehousing_storage_id in (SELECT a.id from jg_warehousing_storage a
LEFT JOIN flow_task b on a.id = b.f_process_id
where a.warehousing_storage_type = #{warehousingStorage.warehousingStorageType} and (b.f_status = 2 or b.f_status is null) and
date_format(a.f_last_modify_time,'%Y-%m') = #{warehousingStorage.searchDateString}) AND product_id = #{warehousingStorage.productId}