SELECT hygf_preparation_money.*,IFNULL(order_status,arrival_state) as arrivalState,IFNULL(order_status,delivery_state) as deliveryState,(select instance_id from hygf_preparation_money_auditing where preparation_money_id = hygf_preparation_money.sequence_nbr limit 1 ) as instanceId FROM hygf_preparation_money
SELECT hygf_preparation_money.*,IFNULL(order_status,arrival_state) as orderStatus,IFNULL(order_status,delivery_state) as deliveryState,(select instance_id from hygf_preparation_money_auditing where preparation_money_id = hygf_preparation_money.sequence_nbr limit 1 ) as instanceId FROM hygf_preparation_money
<where>
<where>
<iftest="dto.consigneeRegion != null and dto.consigneeRegion != ''">
<iftest="dto.consigneeRegion != null and dto.consigneeRegion != ''">
and hygf_preparation_money.consignee_region like concat ('%',#{dto.consigneeRegion},'%')
and hygf_preparation_money.consignee_region like concat ('%',#{dto.consigneeRegion},'%')
...
@@ -66,10 +66,10 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
...
@@ -66,10 +66,10 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货')
and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货')
</if>
</if>
<iftest="regionalCompaniesSeq!=null and regionalCompaniesSeq !='' ">
<iftest="regionalCompaniesSeq!=null and regionalCompaniesSeq !='' ">
and hygf_peasant_household.regional_companies_seq = #{regionalCompaniesSeq}
and hygf_peasant_household.regional_companies_code like concat('%',#{regionalCompaniesSeq},'%')
</if>
</if>
<iftest="developerId!=null and developerId !=''">
<iftest="developerId!=null and developerId !=''">
and hygf_peasant_household.developer_id = #{developerId}
and hygf_peasant_household.developer_code like concat('%',#{developerId},'%')
</if>
</if>
<iftest="state!=null and state !=''">
<iftest="state!=null and state !=''">
and hygf_peasant_household.preparation_money_state = #{state}
and hygf_peasant_household.preparation_money_state = #{state}