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
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.routhPathId != null and dto.routhPathId != ''">
and hygf_preparation_money.sequence_nbr = #{dto.routhPathId}
</if>
<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},'%')
</if>
</if>
...
@@ -71,6 +74,9 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
...
@@ -71,6 +74,9 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
LEFT JOIN hygf_power_station on hygf_peasant_household.sequence_nbr = hygf_power_station.peasant_household_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
LEFT JOIN hygf_preparation_money on hygf_preparation_money.sequence_nbr = hygf_document_station.preparation_money_id
<where>
<where>
<iftest="routhPathId != null and routhPathId != ''">
and hygf_preparation_money.sequence_nbr = #{routhPathId}
</if>
<iftest=" preparationMoneyState == 0 ">
<iftest=" preparationMoneyState == 0 ">
and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货')
and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货')
<iftest="dto.routhPathId != null and dto.routhPathId != ''">
and hygf_work_order.sequence_nbr = #{dto.routhPathId}
</if>
<iftest="dto.workOrderNum!=null and dto.workOrderNum!=''">
<iftest="dto.workOrderNum!=null and dto.workOrderNum!=''">
and hygf_work_order.work_order_num like concat(concat('%',#{dto.workOrderNum}),'%')
and hygf_work_order.work_order_num like concat(concat('%',#{dto.workOrderNum}),'%')
</if>
</if>
...
@@ -106,6 +109,9 @@
...
@@ -106,6 +109,9 @@
SELECT work_order_power_station_id, MIN( operation_time ) as firstConstructionDate FROM hygf_construction_records WHERE operation_content = '编辑施工资料' GROUP BY work_order_power_station_id
SELECT work_order_power_station_id, MIN( operation_time ) as firstConstructionDate FROM hygf_construction_records WHERE operation_content = '编辑施工资料' GROUP BY work_order_power_station_id
) newHcr ON newHcr.work_order_power_station_id = hygf_work_order_power_station.sequence_nbr
) newHcr ON newHcr.work_order_power_station_id = hygf_work_order_power_station.sequence_nbr
<where>
<where>
<iftest="dto.routhPathId != null and dto.routhPathId != ''">
and hygf_work_order_power_station.sequence_nbr = #{dto.routhPathId}
</if>
<iftest="dto.workOrderId!=null and dto.workOrderId!=''">
<iftest="dto.workOrderId!=null and dto.workOrderId!=''">
and hygf_work_order.sequence_nbr = #{dto.workOrderId}
and hygf_work_order.sequence_nbr = #{dto.workOrderId}