select r.id, r.stat_year, r.stat_month, r.town_dept_id, r.town_name,
r.village_dept_id, r.village_name,
r.farmer_household_count, r.farmer_population_count,
r.yak_outbound_count, r.cattle_outbound_count,
r.sheep_outbound_count, r.goat_outbound_count,
r.horse_mule_outbound_count, r.donkey_outbound_count,
r.self_consumption_cattle_count, r.self_consumption_sheep_count,
r.self_consumption_goat_count,
r.create_by, r.create_time, r.update_by, r.update_time, r.remark
from biz_yak_outbound_report r
insert into biz_yak_outbound_report (
stat_year, stat_month, town_dept_id, town_name, village_dept_id, village_name,
farmer_household_count, farmer_population_count,
yak_outbound_count, cattle_outbound_count,
sheep_outbound_count, goat_outbound_count,
horse_mule_outbound_count, donkey_outbound_count,
self_consumption_cattle_count, self_consumption_sheep_count, self_consumption_goat_count,
create_by, create_time, remark
) values (
#{statYear}, #{statMonth}, #{townDeptId}, #{townName}, #{villageDeptId}, #{villageName},
#{farmerHouseholdCount}, #{farmerPopulationCount},
#{yakOutboundCount}, #{cattleOutboundCount},
#{sheepOutboundCount}, #{goatOutboundCount},
#{horseMuleOutboundCount}, #{donkeyOutboundCount},
#{selfConsumptionCattleCount}, #{selfConsumptionSheepCount}, #{selfConsumptionGoatCount},
#{createBy}, sysdate(), #{remark}
)
update biz_yak_outbound_report set
stat_year = #{statYear},
stat_month = #{statMonth},
town_dept_id = #{townDeptId},
town_name = #{townName},
village_dept_id = #{villageDeptId},
village_name = #{villageName},
farmer_household_count = #{farmerHouseholdCount},
farmer_population_count = #{farmerPopulationCount},
yak_outbound_count = #{yakOutboundCount},
cattle_outbound_count = #{cattleOutboundCount},
sheep_outbound_count = #{sheepOutboundCount},
goat_outbound_count = #{goatOutboundCount},
horse_mule_outbound_count = #{horseMuleOutboundCount},
donkey_outbound_count = #{donkeyOutboundCount},
self_consumption_cattle_count = #{selfConsumptionCattleCount},
self_consumption_sheep_count = #{selfConsumptionSheepCount},
self_consumption_goat_count = #{selfConsumptionGoatCount},
update_by = #{updateBy},
update_time = sysdate(),
remark = #{remark}
where id = #{id}
delete from biz_yak_outbound_report where id in
#{id}
delete from biz_yak_outbound_report
where stat_year = #{statYear}
and stat_month = #{statMonth}