INSERT INTO cs_device_status (create_user, order_number)
VALUES (#{createUser}, #{orderNumber})
INSERT INTO cs_device_real_dev (cs_id, dev_id)
VALUES (#{orderId}, #{maId})
INSERT INTO ma_dev_info (
device_name,
device_count,
item_type_model,
manage_type,
code,
identify_code,
type_id,
brand,
production_date,
max_working_hours,
expiration_time,
buy_price,
purchase_date,
is_active,
change_status,
up_down_status
)
VALUES (
#{name},
#{count},
#{specificationModel},
#{manageType},
#{code},
#{originalCode},
#{typeId},
#{manufacturerId},
#{productionDate},
#{maxServiceLifeYears},
#{expirationTime},
#{originalValue},
#{purchaseDate},
'1',
'3',
'0'
)
UPDATE cs_device_status
SET status = #{status}
WHERE id = #{id}
UPDATE ma_dev_info
SET entry_status = 0
WHERE ma_id IN (select dev_id
from cs_device_real_dev
where cs_id = #{id})
update cs_device_status
set is_active = 0
where id = #{id}
UPDATE ma_dev_info SET entry_status = #{data.value} WHERE ma_id = #{data.key}