substring_index ( hygf_peasant_household.project_address_name, '/', 1 ) AS province,
b.stamp_status,
b.stamp_status,
b.status
b.status
from hygf_power_station LEFT JOIN ( SELECT bb.peasant_household_id, initiate_status, contract_lock_id, stamp_status, status FROM (SELECT peasant_household_id,MAX(sequence_nbr) AS sequence_nbr from hygf_household_contract GROUP BY peasant_household_id ) aa LEFT JOIN hygf_household_contract bb ON aa.sequence_nbr=bb.sequence_nbr) b on b.peasant_household_id=hygf_power_station.peasant_household_id
from hygf_power_station LEFT JOIN ( SELECT bb.peasant_household_id, initiate_status, contract_lock_id, stamp_status, status FROM (SELECT peasant_household_id,MAX(sequence_nbr) AS sequence_nbr from hygf_household_contract GROUP BY peasant_household_id ) aa LEFT JOIN hygf_household_contract bb ON aa.sequence_nbr=bb.sequence_nbr) b on b.peasant_household_id=hygf_power_station.peasant_household_id
...
@@ -32,6 +33,9 @@
...
@@ -32,6 +33,9 @@
<iftest="processStatus != null and processStatus != ''">
<iftest="processStatus != null and processStatus != ''">
and hygf_power_station.process_status = #{processStatus}
and hygf_power_station.process_status = #{processStatus}
</if>
</if>
<iftest="province != null and province != ''">
and hygf_peasant_household.project_address like concat(concat('%',#{province}),'%')
</if>
<!-- GROUP BY hygf_peasant_household.sequence_nbr-->
<!-- GROUP BY hygf_peasant_household.sequence_nbr-->