id,
device_no,
device_type,
sys_id,
site_id,
building_id,
floor,
loc_desc,
related_device_no,
manufacturer_id,
device_status,
status,
is_tag,
x_coordinates,
y_coordinates,
create_by,
update_by,
date_create,
date_update,
plan_id,
water_meter_no,
water_meter_file_no,
customer_id,
udip_id
INSERT INTO sc_device (
id,
device_no,
device_type,
sys_id,
site_id,
building_id,
`floor`,
loc_desc,
related_device_no,
manufacturer_id,
device_status,
`status`,
is_tag,
x_coordinates,
y_coordinates,
create_by,
update_by,
date_create,
date_update,
plan_id,
water_meter_no,
water_meter_file_no,
customer_id,
metercode,
account_id,
udip_id,
register_status,
sync_status,
seal_no
) VALUES (
#{device.id,jdbcType=BIGINT},
#{device.deviceNo,jdbcType=VARCHAR},
#{device.deviceType,jdbcType=BIGINT},
#{device.sysId,jdbcType=BIGINT},
#{device.siteId,jdbcType=BIGINT},
#{device.buildingId,jdbcType=BIGINT},
#{device.floor,jdbcType=INTEGER},
#{device.locDesc,jdbcType=VARCHAR},
#{device.relatedDeviceNo,jdbcType=BIGINT},
#{device.manufacturerId,jdbcType=BIGINT},
#{device.deviceStatus,jdbcType=INTEGER},
#{device.status,jdbcType=INTEGER},
#{device.isTag,jdbcType=INTEGER},
#{device.xCoordinates,jdbcType=DECIMAL},
#{device.yCoordinates,jdbcType=DECIMAL},
#{device.createBy,jdbcType=VARCHAR},
#{device.updateBy,jdbcType=VARCHAR},
#{device.dateCreate,jdbcType=TIMESTAMP},
#{device.dateUpdate,jdbcType=TIMESTAMP},
#{device.planId,jdbcType=INTEGER},
#{device.waterMeterNo,jdbcType=VARCHAR},
#{device.waterMeterFileNo,jdbcType=VARCHAR},
#{device.customerId,jdbcType=INTEGER},
#{device.metercode,jdbcType=VARCHAR},
#{device.accountId,jdbcType=BIGINT},
#{device.udipId,jdbcType=VARCHAR},
#{device.registerStatus,jdbcType=INTEGER},
#{device.syncStatus,jdbcType=INTEGER},
#{device.sealNo,jdbcType=VARCHAR}
)
INSERT INTO sc_device
id,
device_no,
device_type,
sys_id,
site_id,
building_id,
`floor`,
loc_desc,
related_device_no,
manufacturer_id,
device_status,
`status`,
is_tag,
x_coordinates,
y_coordinates,
create_by,
update_by,
date_create,
date_update,
plan_id,
water_meter_no,
water_meter_file_no,
customer_id,
udip_id,
register_status,
seal_no
VALUES
#{device.id,jdbcType=BIGINT},
#{device.deviceNo,jdbcType=VARCHAR},
#{device.deviceType,jdbcType=BIGINT},
#{device.sysId,jdbcType=BIGINT},
#{device.siteId,jdbcType=BIGINT},
#{device.buildingId,jdbcType=BIGINT},
#{device.floor,jdbcType=INTEGER},
#{device.locDesc,jdbcType=VARCHAR},
#{device.relatedDeviceNo,jdbcType=BIGINT},
#{device.manufacturerId,jdbcType=BIGINT},
#{device.deviceStatus,jdbcType=INTEGER},
#{device.status,jdbcType=INTEGER},
#{device.isTag,jdbcType=INTEGER},
#{device.xCoordinates,jdbcType=DECIMAL},
#{device.yCoordinates,jdbcType=DECIMAL},
#{device.createBy,jdbcType=VARCHAR},
#{device.updateBy,jdbcType=VARCHAR},
#{device.dateCreate,jdbcType=TIMESTAMP},
#{device.dateUpdate,jdbcType=TIMESTAMP},
#{device.planId,jdbcType=INTEGER},
#{device.waterMeterNo,jdbcType=VARCHAR},
#{device.waterMeterFileNo,jdbcType=VARCHAR},
#{device.customerId,jdbcType=INTEGER},
#{device.udipId,jdbcType=VARCHAR},
#{device.registerStatus,jdbcType=INTEGER},
#{device.sealNo,jdbcType=VARCHAR}
INSERT INTO sc_device(
id,
device_no,
device_type,
sys_id,
site_id,
building_id,
`floor`,
loc_desc,
related_device_no,
manufacturer_id,
device_status,
`status`,
is_tag,
x_coordinates,
y_coordinates,
create_by,
update_by,
date_create,
date_update,
plan_id,
water_meter_no,
water_meter_file_no,
customer_id,
udip_id
)VALUES
(
#{device.id,jdbcType=BIGINT},
#{device.deviceNo,jdbcType=VARCHAR},
#{device.deviceType,jdbcType=BIGINT},
#{device.sysId,jdbcType=BIGINT},
#{device.siteId,jdbcType=BIGINT},
#{device.buildingId,jdbcType=BIGINT},
#{device.floor,jdbcType=INTEGER},
#{device.locDesc,jdbcType=VARCHAR},
#{device.relatedDeviceNo,jdbcType=BIGINT},
#{device.manufacturerId,jdbcType=BIGINT},
#{device.deviceStatus,jdbcType=INTEGER},
#{device.status,jdbcType=INTEGER},
#{device.isTag,jdbcType=INTEGER},
#{device.xCoordinates,jdbcType=DECIMAL},
#{device.yCoordinates,jdbcType=DECIMAL},
#{device.createBy,jdbcType=VARCHAR},
#{device.updateBy,jdbcType=VARCHAR},
#{device.dateCreate,jdbcType=TIMESTAMP},
#{device.dateUpdate,jdbcType=TIMESTAMP},
#{device.planId,jdbcType=INTEGER},
#{device.waterMeterNo,jdbcType=VARCHAR},
#{device.waterMeterFileNo,jdbcType=VARCHAR},
#{device.customerId,jdbcType=INTEGER},
#{device.udipId,jdbcType=VARCHAR}
)
UPDATE sc_device
device_no = #{device.deviceNo,jdbcType=VARCHAR},
device_type = #{device.deviceType,jdbcType=BIGINT},
sys_id = #{device.sysId,jdbcType=BIGINT},
site_id = #{device.siteId,jdbcType=BIGINT},
building_id = #{device.buildingId,jdbcType=BIGINT},
`floor` = #{device.floor,jdbcType=INTEGER},
loc_desc = #{device.locDesc,jdbcType=VARCHAR},
related_device_no = #{device.relatedDeviceNo,jdbcType=BIGINT},
manufacturer_id = #{device.manufacturerId,jdbcType=BIGINT},
device_status = #{device.deviceStatus,jdbcType=INTEGER},
`status` = #{device.status,jdbcType=INTEGER},
is_tag = #{device.isTag,jdbcType=INTEGER},
x_coordinates = #{device.xCoordinates,jdbcType=DECIMAL},
y_coordinates = #{device.yCoordinates,jdbcType=DECIMAL},
update_by = #{device.updateBy,jdbcType=VARCHAR},
date_update = #{device.dateUpdate,jdbcType=TIMESTAMP},
plan_id = #{device.planId,jdbcType=INTEGER},
water_meter_no = #{device.waterMeterNo,jdbcType=VARCHAR},
water_meter_file_no = #{device.waterMeterFileNo,jdbcType=VARCHAR},
customer_id = #{device.customerId,jdbcType=INTEGER},
udip_id = #{device.udipId,jdbcType=VARCHAR},
register_status = #{device.registerStatus,jdbcType=INTEGER},
sync_status = #{device.syncStatus,jdbcType=INTEGER},
seal_no = #{device.sealNo,jdbcType=VARCHAR}
WHERE id = #{device.id,jdbcType=BIGINT}
update sc_device set status = 0,date_update=NOW(),update_by=#{updateBy}
where status = 1
and id in #{item}
update sc_device set status = 0,date_update = NOW(),update_by=#{updateBy}
where status = 1 and site_id = #{siteId}
update sc_device set status = 0,date_update = NOW(),update_by=#{updateBy}
where status = 1 and sys_id = #{sysId}
UPDATE sc_device
when id=#{item.id} then #{item.buildingId}
when id=#{item.id} then #{item.siteId}
when id=#{item.id} then #{item.locDesc}
when id=#{item.id} then #{item.waterMeterNo}
when id=#{item.id} then #{item.waterMeterFileNo}
id in #{item.id}
update sc_device set metercode=#{meterNo}
where metercode=#{meterNo} and customer_id=#{customerId}