INSERT INTO ReportFileList(ReportID, ReportFamily, Reportfile, ReportType, Remark)
VALUES (#{labelNo}, #{labelType}, #{labelName}, #{labelClass}, #{remark})
UPDATE ReportFileList SET ReportFamily = #{labelType}, Reportfile = #{labelName}, ReportType = #{labelClass},
Remark = #{remark}
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})
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}
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}