INSERT INTO ReportFileList(ReportID, ReportFamily, Reportfile, ReportType, Remark, PrintDirection, ZplCode,rfidFlag,
PaperSize, PaperOrientation, Dpi, CanvasWidth, CanvasHeight,
PhysicalWidthMm, PhysicalHeightMm, UpdatedTime,paper_id)
VALUES (#{labelNo}, #{labelType}, #{labelName}, #{labelClass}, #{remark}, #{printDirection}, #{zplCode},#{rfidFlag},
#{paperSize}, #{paperOrientation}, #{dpi}, #{canvasWidth}, #{canvasHeight},
#{physicalWidthMm}, #{physicalHeightMm}, GETDATE(),#{paperSize})
UPDATE ReportFileList SET
ReportFamily = #{labelType},
Reportfile = #{labelName},
ReportType = #{labelClass},
Remark = #{remark},
PrintDirection = #{printDirection},
ZplCode = #{zplCode},
rfidFlag= #{rfidFlag},
PaperSize = #{paperSize},
paper_id = #{paperSize},
PaperOrientation = #{paperOrientation},
Dpi = #{dpi},
CanvasWidth = #{canvasWidth},
CanvasHeight = #{canvasHeight},
PhysicalWidthMm = #{physicalWidthMm},
PhysicalHeightMm = #{physicalHeightMm},
UpdatedTime = GETDATE()
AND ReportID = #{labelNo}
DELETE FROM ReportFileList
AND ReportID = #{labelNo}
INSERT INTO ReportFileDefDefault(FamilyID, ReportFamily, ReportID, Remark, SubReportFlag, ParentReportID)
VALUES ('*', #{labelType}, #{labelNo}, #{remark}, #{subLabelFlag}, #{parentLabelNo})
UPDATE ReportFileDefDefault SET SubReportFlag = #{subLabelFlag}, ParentReportID = #{parentLabelNo}, Remark =
#{remark}
AND ReportID = #{labelNo} AND ReportFamily = #{labelType} AND FamilyID = '*'
DELETE FROM ReportFileDefDefault
AND ReportID = #{labelNo} AND ReportFamily = #{labelType} AND FamilyID = '*'
INSERT INTO ReportFileDefCustomer(Site, CustomerID, FamilyID, ReportFamily, ReportID, Remark, SubReportFlag,
ParentReportID)
VALUES (#{site}, #{customerId}, '*', #{labelType}, #{labelNo}, #{remark}, #{subLabelFlag}, #{parentLabelNo})
UPDATE ReportFileDefCustomer SET SubReportFlag = #{subLabelFlag}, ParentReportID = #{parentLabelNo}, Remark =
#{remark}
AND ReportID = #{labelNo} AND CustomerID = #{customerId} AND FamilyID = '*'
DELETE FROM ReportFileDefCustomer
AND ReportID = #{labelNo} AND CustomerID = #{customerId} AND FamilyID = '*'
INSERT INTO ReportFileList_UserPrinter(ReportID, UserID, PrinterName, IPAddress, NewPrinterName)
VALUES (#{labelNo}, #{userId}, '', #{ipAddress}, #{printerName})
UPDATE ReportFileList_UserPrinter SET IPAddress = #{ipAddress}, NewPrinterName = #{printerName}
AND ReportID = #{labelNo} AND UserID = #{userId}
DELETE FROM ReportFileList_UserPrinter
AND ReportID = #{labelNo} AND UserID = #{userId}
INSERT INTO ReportParameters(ReportID, ItemNo, ShowSeqNo, ParameterDesc, ParameterName, ValueType_DB,
ValueType, OptionValue, DefaultValue)
VALUES (#{labelNo}, #{itemNo}, #{showSeqNo}, #{parameterDesc}, #{parameterName}, #{valueTypeDb},
#{valueType}, #{optionValue}, #{defaultValue})
UPDATE ReportParameters SET OptionValue = #{optionValue}, DefaultValue = #{defaultValue}, ShowSeqNo =
#{showSeqNo}
AND ReportID = #{labelNo} AND ItemNo = #{itemNo}
DELETE FROM ReportParameters
AND ReportID = #{labelNo} AND ItemNo = #{itemNo}
INSERT INTO ReportContentItem(ReportID, ItemNo, ShowSeqNo, ItemDesc, ObjectName, ObjectGroup,
DBFieldName, SequenceNoflag, SequenceBits, [Interval])
VALUES (#{labelNo}, #{itemNo}, #{showSeqNo}, #{itemDesc}, #{objectName}, #{objectGroup},
#{dbFieldName}, #{sequenceNoFlag}, #{sequenceBits}, #{intervalValue})
INSERT INTO ReportContentItem_SeqRule(ReportID, ItemNo, SeqNo, ObjectName)
VALUES (#{labelNo}, #{itemNo}, #{seqNo}, #{objectName})
UPDATE ReportContentItem SET ShowSeqNo = #{showSeqNo}, ObjectName = #{objectName}, ObjectGroup = #{objectGroup},
DBFieldName = #{dbFieldName}, SequenceNoflag = #{sequenceNoFlag}, SequenceBits = #{sequenceBits},
[Interval] = #{intervalValue}, ItemDesc = #{itemDesc}
AND ReportID = #{labelNo} AND ItemNo = #{itemNo}
DELETE FROM ReportContentItem
AND ReportID = #{labelNo} AND ItemNo = #{itemNo}
DELETE FROM ReportContentItem
AND ReportID = #{labelNo}
DELETE FROM ReportContentItem_SeqRule
AND ReportID = #{labelNo}
INSERT INTO ReportContentItem(ReportID, ItemNo, ShowSeqNo, ItemDesc, ObjectName, ObjectGroup,
DBFieldName, SequenceNoflag, SequenceBits, [Interval])
SELECT #{labelNo},
ItemNo,
ShowSeqNo,
ItemDesc,
ObjectName,
ObjectGroup,
DBFieldName,
SequenceNoflag,
SequenceBits,
[Interval]
FROM ReportContentItem
WHERE ReportID = #{newLabelNo}
DELETE FROM ReportContentItem_SeqRule
AND ReportID = #{labelNo} AND ItemNo = #{itemNo} AND SeqNo = #{seqNo}
INSERT INTO ReportFile_SeqInfo(ReportID, ItemNo, KeyInfo, LastSeqNo)
VALUES (#{labelNo}, #{itemNo}, #{keyInfo}, #{lastSeqNo})
UPDATE ReportFile_SeqInfo SET KeyInfo = #{keyInfo}, LastSeqNo = #{lastSeqNo}
AND ReportID = #{labelNo} AND ItemNo = #{itemNo} AND KeyInfo = #{oriKeyInfo}
DELETE FROM ReportFile_SeqInfo
AND ReportID = #{labelNo} AND ItemNo = #{itemNo} AND KeyInfo = #{keyInfo}
UPDATE report_label_list SET full_serial_number = #{fullSerialNumber}
AND report_id = #{reportId} AND label_no = #{labelNo} AND type = 'serialNumber'
INSERT INTO wms_label (
site, serial_no, part_no, qty, in_stock_flag,
label_type, batch_no, warehouse_id, location_id, remark, tid, epc
) VALUES (
#{site}, #{serialNo}, #{partNo}, #{qty}, #{inStockFlag},
#{labelType}, #{batchNo}, #{warehouseId}, #{locationId}, #{remark}, #{tid}, #{epc}
)