hygf_document_station.preparation_money_id as preparationMoneyId,
hygf_preparation_money.delivery_time as deliveryTime,
hygf_preparation_money.arrival_time as arrivalTime,
(select instance_id from hygf_preparation_money_auditing where hygf_document_station.preparation_money_id = hygf_preparation_money_auditing.preparation_money_id limit 1) as instanceId from
hygf_peasant_household
LEFT JOIN hygf_document_station on hygf_peasant_household.sequence_nbr = hygf_document_station.station_id
LEFT JOIN hygf_power_station on hygf_peasant_household.sequence_nbr = hygf_power_station.peasant_household_id
LEFT JOIN hygf_preparation_money on hygf_preparation_money.sequence_nbr = hygf_document_station.preparation_money_id
<where>
<iftest=" preparationMoneyState == 0 ">
and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货')
...
...
@@ -79,6 +82,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
</if>
</where>
GROUP BY hygf_peasant_household.sequence_nbr
order by hygf_peasant_household.sequence_nbr DESC
order by hygf_peasant_household.sequence_nbr DESC ) b