count(*) = ( SELECT count(*) FROM hygf_household_contract WHERE project_user_id = #{amosUserId} and initiate_status = '已发起' AND STATUS = '已作废' )
count(*) = ( SELECT count(*) FROM hygf_household_contract WHERE peasant_household_number = #{peasantHouseholdNo} and initiate_status = '已发起' AND STATUS = '已作废' )
FROM
hygf_household_contract
WHERE
project_user_id = #{amosUserId} and initiate_status = '已发起'
peasant_household_number = #{peasantHouseholdNo} and initiate_status = '已发起'
</select>
<selectid="deleteHphByUserId">
...
...
@@ -112,4 +115,16 @@ on hygf_document_station.preparation_money_id=hygf_preparation_money.sequence_nb
DELETE FROM hygf_household_contract WHERE project_user_id=#{userId}
LEFT JOIN hygf_peasant_household on hygf_peasant_household.sequence_nbr=hygf_work_order_power_station.peasant_household_id
LEFT JOIN hygf_power_station_engineering_info on hygf_power_station_engineering_info.work_order_power_station_id=hygf_work_order_power_station.sequence_nbr