select s.id, s.bs_manage_tags, s.sheepfold_id, s.variety, s.sheep_name, s.gender, s.month_age, s.parity, s.breed, s.post_lambing_day, s.lactation_day, s.lambing_day, s.event_type, s.sale_date, s.pricing_method, s.unit_price, s.total_price, s.total_weight, s.avg_weight, s.avg_price_per_sheep, s.sale_type, s.disease_type, s.secondary_reason, s.group_code, s.customer_id, s.sales_person_id, s.quarantine_no, s.approval_no, s.technician_id, s.handler_id, s.created_by, s.created_at, s.remark, s.user_id, s.dept_id
from sx_sheep_sale s
select
bs_manage_tags,
variety,
name as sheep_name,
gender,
month_age,
parity,
breed,
post_lambing_day,
lactation_day,
lambing_day,
sheepfold_id
from sheep_file
insert into sx_sheep_sale
bs_manage_tags,
sheepfold_id,
variety,
sheep_name,
gender,
month_age,
parity,
breed,
post_lambing_day,
lactation_day,
lambing_day,
event_type,
sale_date,
pricing_method,
unit_price,
total_price,
total_weight,
avg_weight,
avg_price_per_sheep,
sale_type,
disease_type,
secondary_reason,
group_code,
customer_id,
sales_person_id,
quarantine_no,
approval_no,
technician_id,
handler_id,
created_by,
created_at,
remark,
user_id,
dept_id,
#{bsManageTags},
#{sheepfoldId},
#{variety},
#{sheepName},
#{gender},
#{monthAge},
#{parity},
#{breed},
#{postLambingDay},
#{lactationDay},
#{lambingDay},
#{eventType},
#{saleDate},
#{pricingMethod},
#{unitPrice},
#{totalPrice},
#{totalWeight},
#{avgWeight},
#{avgPricePerSheep},
#{saleType},
#{diseaseType},
#{secondaryReason},
#{groupCode},
#{customerId},
#{salesPersonId},
#{quarantineNo},
#{approvalNo},
#{technicianId},
#{handlerId},
#{createdBy},
#{createdAt},
#{remark},
#{userId},
#{deptId},
update sx_sheep_sale
bs_manage_tags = #{bsManageTags},
sheepfold_id = #{sheepfoldId},
variety = #{variety},
sheep_name = #{sheepName},
gender = #{gender},
month_age = #{monthAge},
parity = #{parity},
breed = #{breed},
post_lambing_day = #{postLambingDay},
lactation_day = #{lactationDay},
lambing_day = #{lambingDay},
event_type = #{eventType},
sale_date = #{saleDate},
pricing_method = #{pricingMethod},
unit_price = #{unitPrice},
total_price = #{totalPrice},
total_weight = #{totalWeight},
avg_weight = #{avgWeight},
avg_price_per_sheep = #{avgPricePerSheep},
sale_type = #{saleType},
disease_type = #{diseaseType},
secondary_reason = #{secondaryReason},
group_code = #{groupCode},
customer_id = #{customerId},
sales_person_id = #{salesPersonId},
quarantine_no = #{quarantineNo},
approval_no = #{approvalNo},
technician_id = #{technicianId},
handler_id = #{handlerId},
created_by = #{createdBy},
created_at = #{createdAt},
remark = #{remark},
where id = #{id}
delete from sx_sheep_sale where id = #{id}
delete from sx_sheep_sale where id in
#{id}