You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

612 lines
26 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 months ago
1 year ago
3 months ago
1 year ago
3 months ago
1 year ago
3 months ago
1 year ago
1 year ago
3 months ago
1 year ago
1 week ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 months ago
1 year ago
3 months ago
3 months ago
1 year ago
3 months ago
1 year ago
2 months ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
2 months ago
1 year ago
10 months ago
1 year ago
1 year ago
2 months ago
1 year ago
2 months ago
1 year ago
2 months ago
1 year ago
2 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
1 year ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.gaotao.modules.base.dao.BaseMapper">
  4. <!--查询标签定义的相关信息-->
  5. <select id="getLabelSettingList" parameterType="LabelSettingData" resultType="LabelSettingData">
  6. SELECT ReportID labelNo, ReportFamily labelType, Reportfile labelName, ReportType labelClass, Remark remark,
  7. PrintDirection printDirection, ZplCode zplCode, PaperSize paperSize, paper_id paperId, PaperOrientation paperOrientation,
  8. Dpi dpi, CanvasWidth canvasWidth, CanvasHeight canvasHeight,rfidFlag,
  9. PhysicalWidthMm physicalWidthMm, PhysicalHeightMm physicalHeightMm
  10. FROM ReportFileList
  11. <where>
  12. <if test="labelNo != null and labelNo != ''">
  13. and ReportID LIKE #{labelNo}
  14. </if>
  15. <if test="labelType != null and labelType != ''">
  16. and ReportFamily LIKE #{labelType}
  17. </if>
  18. <if test="labelName != null and labelName != ''">
  19. and Reportfile LIKE #{labelName}
  20. </if>
  21. </where>
  22. ORDER BY ReportID desc
  23. </select>
  24. <!--查询标签定义的相关信息按照标签的编码-->
  25. <select id="getLabelSettingByLabelNo" parameterType="java.lang.String" resultType="LabelSettingData">
  26. SELECT ReportID labelNo, ReportFamily labelType, Reportfile labelName, ReportType labelClass, Remark remark,
  27. PrintDirection printDirection, ZplCode zplCode, PaperSize paperSize, paper_id paperId, PaperOrientation paperOrientation,
  28. Dpi dpi, CanvasWidth canvasWidth, CanvasHeight canvasHeight,rfidFlag,
  29. PhysicalWidthMm physicalWidthMm, PhysicalHeightMm physicalHeightMm
  30. FROM ReportFileList
  31. <where>
  32. AND ReportID = #{labelNo}
  33. </where>
  34. </select>
  35. <!--插入标签自定义的数据-->
  36. <insert id="insertLabelSetting" parameterType="LabelSettingData">
  37. INSERT INTO ReportFileList(ReportID, ReportFamily, Reportfile, ReportType, Remark, PrintDirection, ZplCode,rfidFlag,
  38. PaperSize, PaperOrientation, Dpi, CanvasWidth, CanvasHeight,
  39. PhysicalWidthMm, PhysicalHeightMm, UpdatedTime,paper_id)
  40. VALUES (#{labelNo}, #{labelType}, #{labelName}, #{labelClass}, #{remark}, #{printDirection}, #{zplCode},#{rfidFlag},
  41. #{paperSize}, #{paperOrientation}, #{dpi}, #{canvasWidth}, #{canvasHeight},
  42. #{physicalWidthMm}, #{physicalHeightMm}, GETDATE(),#{paperSize})
  43. </insert>
  44. <!--修改标签自定义的信息-->
  45. <update id="updateLabelSetting" parameterType="LabelSettingData">
  46. UPDATE ReportFileList SET
  47. ReportFamily = #{labelType},
  48. Reportfile = #{labelName},
  49. ReportType = #{labelClass},
  50. Remark = #{remark},
  51. PrintDirection = #{printDirection},
  52. ZplCode = #{zplCode},
  53. rfidFlag= #{rfidFlag},
  54. PaperSize = #{paperSize},
  55. paper_id = #{paperSize},
  56. PaperOrientation = #{paperOrientation},
  57. Dpi = #{dpi},
  58. CanvasWidth = #{canvasWidth},
  59. CanvasHeight = #{canvasHeight},
  60. PhysicalWidthMm = #{physicalWidthMm},
  61. PhysicalHeightMm = #{physicalHeightMm},
  62. UpdatedTime = GETDATE()
  63. <where>
  64. AND ReportID = #{labelNo}
  65. </where>
  66. </update>
  67. <!--删除标签定义的主表信息-->
  68. <delete id="deleteLabelSettingByLabelNo" parameterType="java.lang.String">
  69. DELETE FROM ReportFileList
  70. <where>
  71. AND ReportID = #{labelNo}
  72. </where>
  73. </delete>
  74. <!--查询标签的默认配置信息-->
  75. <select id="getDefaultLabelSettingList" parameterType="DefaultLabelSettingData"
  76. resultType="DefaultLabelSettingData">
  77. SELECT rfd.ReportFamily labelType, rfd.ReportID labelNo, rfl.ReportType labelClass, rfl.Reportfile labelName,
  78. rfd.Remark remark,
  79. rfd.SubReportFlag subLabelFlag,
  80. CASE WHEN ISNULL(rfd.ParentReportID, '') = '*' THEN '' ELSE ISNULL(rfd.ParentReportID, '') END parentLabelNo
  81. FROM ReportFileDefDefault rfd
  82. LEFT JOIN ReportFileList rfl ON rfl.ReportID = rfd.ReportID
  83. <where>
  84. AND rfl.ReportID = rfd.ReportID
  85. <if test="labelNo != null and labelNo != ''">
  86. and rfd.ReportID LIKE #{labelNo}
  87. </if>
  88. <if test="labelType != null and labelType != ''">
  89. and rfd.ReportFamily LIKE #{labelType}
  90. </if>
  91. <if test="labelName != null and labelName != ''">
  92. and rfl.Reportfile LIKE #{labelName}
  93. </if>
  94. </where>
  95. ORDER BY rfd.ReportFamily ASC
  96. </select>
  97. <!--插入默认标签配置信息-->
  98. <insert id="insertDefaultLabelSetting" parameterType="DefaultLabelSettingData">
  99. INSERT INTO ReportFileDefDefault(FamilyID, ReportFamily, ReportID, Remark, SubReportFlag, ParentReportID)
  100. VALUES ('*', #{labelType}, #{labelNo}, #{remark}, #{subLabelFlag}, #{parentLabelNo})
  101. </insert>
  102. <!--修改默认标签配置信息-->
  103. <update id="updateDefaultLabelSetting" parameterType="DefaultLabelSettingData">
  104. UPDATE ReportFileDefDefault SET SubReportFlag = #{subLabelFlag}, ParentReportID = #{parentLabelNo}, Remark =
  105. #{remark}
  106. <where>
  107. AND ReportID = #{labelNo}
  108. AND FamilyID = '*'
  109. <if test="labelType != null and labelType != ''">
  110. AND ReportFamily = #{labelType}
  111. </if>
  112. </where>
  113. </update>
  114. <!--删除默认标签配置信息-->
  115. <delete id="deleteDefaultLabelSetting" parameterType="DefaultLabelSettingData">
  116. DELETE FROM ReportFileDefDefault
  117. <where>
  118. AND ReportID = #{labelNo}
  119. AND FamilyID = '*'
  120. <if test="labelType != null and labelType != ''">
  121. AND ReportFamily = #{labelType}
  122. </if>
  123. </where>
  124. </delete>
  125. <select id="countDefaultLabelSetting" parameterType="DefaultLabelSettingData" resultType="int">
  126. SELECT COUNT(1)
  127. FROM ReportFileDefDefault
  128. <where>
  129. AND ReportID = #{labelNo}
  130. AND FamilyID = '*'
  131. <if test="labelType != null and labelType != ''">
  132. AND ReportFamily = #{labelType}
  133. </if>
  134. </where>
  135. </select>
  136. <!--查询父标签信息-->
  137. <select id="getParentLabelInfo" parameterType="java.lang.String" resultType="java.util.Map">
  138. SELECT
  139. rfd.ParentReportID as parentLabelNo,
  140. rfl.Reportfile as parentLabelName,
  141. rfl.ReportFamily as parentLabelType
  142. FROM ReportFileDefDefault rfd
  143. LEFT JOIN ReportFileList rfl ON rfl.ReportID = rfd.ParentReportID
  144. <where>
  145. AND rfd.ReportID = #{labelNo}
  146. AND rfd.FamilyID = '*'
  147. AND rfd.ParentReportID IS NOT NULL
  148. AND rfd.ParentReportID != ''
  149. </where>
  150. </select>
  151. <select id="getParentSerialElements" parameterType="java.lang.String" resultType="java.util.Map">
  152. SELECT * FROM report_label_list rfd
  153. <where>
  154. AND rfd.report_id = #{labelNo}
  155. AND rfd.type = 'serialNumber'
  156. </where>
  157. </select>
  158. <!--查询标签的客制化配置信息-->
  159. <select id="getCustomerLabelSettingList" parameterType="CustomerLabelSettingData"
  160. resultType="CustomerLabelSettingData">
  161. SELECT rfc.ReportFamily labelType, rfc.CustomerID customerId, rfc.AddressNo addressNo, rfc.ReportID labelNo,
  162. rfl.Reportfile labelName, rfl.ReportType labelClass, rfc.Site site, rfc.Remark remark, rfc.SubReportFlag
  163. subLabelFlag, CASE WHEN ISNULL(rfc.ParentReportID, '') = '*' THEN '' ELSE ISNULL(rfc.ParentReportID, '') END parentLabelNo
  164. FROM ReportFileDefCustomer rfc
  165. LEFT JOIN ReportFileList rfl ON rfl.ReportID = rfc.ReportID AND rfl.ReportFamily = rfc.ReportFamily
  166. <where>
  167. AND rfl.ReportID = rfc.ReportID
  168. <if test="customerId != null and customerId != ''">
  169. and rfc.CustomerID LIKE #{customerId}
  170. </if>
  171. <if test="site != null and site != ''">
  172. and rfc.Site = #{site}
  173. </if>
  174. <if test="addressNo != null and addressNo != ''">
  175. and rfc.AddressNo LIKE #{addressNo}
  176. </if>
  177. <if test="labelNo != null and labelNo != ''">
  178. and rfc.ReportID LIKE #{labelNo}
  179. </if>
  180. <if test="labelType != null and labelType != ''">
  181. and rfc.ReportFamily LIKE #{labelType}
  182. </if>
  183. <if test="labelName != null and labelName != ''">
  184. and rfl.Reportfile LIKE #{labelName}
  185. </if>
  186. </where>
  187. ORDER BY rfc.CustomerID ASC, rfc.AddressNo ASC
  188. </select>
  189. <!--插入客制化标签配置信息-->
  190. <insert id="insertCustomerLabelSetting" parameterType="CustomerLabelSettingData">
  191. INSERT INTO ReportFileDefCustomer(Site, CustomerID, AddressNo, FamilyID, ReportFamily, ReportID, Remark, SubReportFlag,
  192. ParentReportID)
  193. VALUES (#{site}, #{customerId}, #{addressNo}, '*', #{labelType}, #{labelNo}, #{remark}, #{subLabelFlag}, #{parentLabelNo})
  194. </insert>
  195. <!--修改客制化标签配置信息-->
  196. <update id="updateCustomerLabelSetting" parameterType="CustomerLabelSettingData">
  197. UPDATE ReportFileDefCustomer SET AddressNo = #{addressNo}, SubReportFlag = #{subLabelFlag}, ParentReportID = #{parentLabelNo}, Remark = #{remark}
  198. <where>
  199. AND Site = #{site}
  200. AND ReportID = #{labelNo}
  201. AND CustomerID = #{customerId}
  202. AND FamilyID = '*'
  203. <if test="labelType != null and labelType != ''">
  204. AND ReportFamily = #{labelType}
  205. </if>
  206. </where>
  207. </update>
  208. <!--删除客制化标签配置信息-->
  209. <delete id="deleteCustomerLabelSetting" parameterType="CustomerLabelSettingData">
  210. DELETE FROM ReportFileDefCustomer
  211. <where>
  212. AND Site = #{site}
  213. AND ReportID = #{labelNo}
  214. AND CustomerID = #{customerId}
  215. AND FamilyID = '*'
  216. <if test="labelType != null and labelType != ''">
  217. AND ReportFamily = #{labelType}
  218. </if>
  219. AND AddressNo = #{addressNo}
  220. </where>
  221. </delete>
  222. <select id="countCustomerLabelSetting" parameterType="CustomerLabelSettingData" resultType="int">
  223. SELECT COUNT(1)
  224. FROM ReportFileDefCustomer
  225. <where>
  226. AND Site = #{site}
  227. AND ReportID = #{labelNo}
  228. AND CustomerID = #{customerId}
  229. AND FamilyID = '*'
  230. <if test="labelType != null and labelType != ''">
  231. AND ReportFamily = #{labelType}
  232. </if>
  233. AND AddressNo = #{addressNo}
  234. </where>
  235. </select>
  236. <!--查询标签的客制化配置信息-->
  237. <select id="getUserLabelPrinters" parameterType="UserLabelPrinterData" resultType="UserLabelPrinterData">
  238. SELECT rfp.UserID userId, ssu.user_display userDisplay, rfp.ReportID labelNo, rfp.ReportFamily labelType,
  239. '' labelName, '' labelClass,
  240. rfp.NewPrinterName printerName, rfp.IPAddress ipAddress
  241. FROM ReportFileList_UserPrinter rfp
  242. LEFT JOIN sys_user ssu ON ssu.username = rfp.UserID
  243. <where>
  244. <if test="userId != null and userId != ''">
  245. and rfp.UserID LIKE CONCAT('%', #{userId}, '%')
  246. </if>
  247. <if test="labelNo != null and labelNo != ''">
  248. and rfp.ReportID LIKE CONCAT('%', #{labelNo}, '%')
  249. </if>
  250. <if test="labelType != null and labelType != ''">
  251. and rfp.ReportFamily = #{labelType}
  252. </if>
  253. <if test="labelName != null and labelName != ''">
  254. and rfp.IPAddress LIKE CONCAT('%', #{labelName}, '%')
  255. </if>
  256. <if test="printerName != null and printerName != ''">
  257. and rfp.NewPrinterName LIKE #{printerName}
  258. </if>
  259. </where>
  260. ORDER BY rfp.ReportFamily ASC
  261. </select>
  262. <!--按照userId 查询用户的信息-->
  263. <select id="getSysUserDataByUserId" parameterType="UserLabelPrinterData" resultType="SysUserData">
  264. SELECT user_id, username, password, salt, email, mobile, status, create_user_id,
  265. create_time, language_default, site, user_display FROM sys_user
  266. <where>
  267. AND username = #{userId}
  268. </where>
  269. </select>
  270. <!--插入用户的标签打印机参数-->
  271. <insert id="insertUserLabelPrinter" parameterType="UserLabelPrinterData">
  272. INSERT INTO ReportFileList_UserPrinter(ReportFamily, ReportID, UserID, PrinterName, IPAddress, NewPrinterName)
  273. VALUES (#{labelType}, ISNULL(#{labelNo}, ''), #{userId}, '', #{ipAddress}, #{printerName})
  274. </insert>
  275. <!--修改用户的标签打印机参数-->
  276. <update id="updateUserLabelPrinter" parameterType="UserLabelPrinterData">
  277. UPDATE ReportFileList_UserPrinter SET IPAddress = #{ipAddress}, NewPrinterName = #{printerName}
  278. <where>
  279. AND ReportFamily = #{labelType} AND UserID = #{userId}
  280. </where>
  281. </update>
  282. <!--删除用户标签的打印机的信息-->
  283. <delete id="deleteUserLabelPrinter" parameterType="UserLabelPrinterData">
  284. DELETE FROM ReportFileList_UserPrinter
  285. <where>
  286. AND ReportFamily = #{labelType} AND UserID = #{userId}
  287. </where>
  288. </delete>
  289. <!--获取标签打印参数配置信息-->
  290. <select id="getLabelParameterList" parameterType="LabelParameterData" resultType="LabelParameterData">
  291. SELECT ReportID labelNo, ItemNo itemNo, ShowSeqNo showSeqNo, ParameterDesc parameterDesc, ParameterName
  292. parameterName,
  293. ValueType_DB valueTypeDb, ValueType valueType, OptionValue optionValue, DefaultValue defaultValue
  294. FROM ReportParameters
  295. <where>
  296. AND ReportID = #{labelNo}
  297. </where>
  298. ORDER BY ItemNo
  299. </select>
  300. <!--插入标签的打印参数-->
  301. <insert id="insertLabelPrintParameter" parameterType="LabelParameterData">
  302. INSERT INTO ReportParameters(ReportID, ItemNo, ShowSeqNo, ParameterDesc, ParameterName, ValueType_DB,
  303. ValueType, OptionValue, DefaultValue)
  304. VALUES (#{labelNo}, #{itemNo}, #{showSeqNo}, #{parameterDesc}, #{parameterName}, #{valueTypeDb},
  305. #{valueType}, #{optionValue}, #{defaultValue})
  306. </insert>
  307. <!--修改标签打印参数的信息-->
  308. <update id="updateLabelPrintParameter" parameterType="LabelParameterData">
  309. UPDATE ReportParameters SET OptionValue = #{optionValue}, DefaultValue = #{defaultValue}, ShowSeqNo =
  310. #{showSeqNo}
  311. <where>
  312. AND ReportID = #{labelNo} AND ItemNo = #{itemNo}
  313. </where>
  314. </update>
  315. <!--删除标签打印参数的信息-->
  316. <delete id="deleteLabelPrintParameter" parameterType="LabelParameterData">
  317. DELETE FROM ReportParameters
  318. <where>
  319. AND ReportID = #{labelNo} AND ItemNo = #{itemNo}
  320. </where>
  321. </delete>
  322. <!--查询标签内容定义列表-->
  323. <select id="getLabelContentList" parameterType="LabelContentData" resultType="LabelContentData">
  324. SELECT ItemNo itemNo, ShowSeqNo showSeqNo, ItemDesc itemDesc, ObjectName objectName, ObjectGroup objectGroup,
  325. DBFieldName dbFieldName, SequenceNoflag sequenceNoFlag, SequenceBits sequenceBits, [Interval] intervalValue,
  326. ReportID labelNo
  327. FROM ReportContentItem
  328. <where>
  329. AND ReportID = #{labelNo}
  330. </where>
  331. ORDER BY ItemNo
  332. </select>
  333. <!--插入标签内容定义-->
  334. <insert id="insertLabelContent" parameterType="LabelContentData">
  335. INSERT INTO ReportContentItem(ReportID, ItemNo, ShowSeqNo, ItemDesc, ObjectName, ObjectGroup,
  336. DBFieldName, SequenceNoflag, SequenceBits, [Interval])
  337. VALUES (#{labelNo}, #{itemNo}, #{showSeqNo}, #{itemDesc}, #{objectName}, #{objectGroup},
  338. #{dbFieldName}, #{sequenceNoFlag}, #{sequenceBits}, #{intervalValue})
  339. </insert>
  340. <!--插入标签内容定义规则-->
  341. <insert id="insertLabelContentRule" parameterType="LabelContentData">
  342. INSERT INTO ReportContentItem_SeqRule(ReportID, ItemNo, SeqNo, ObjectName)
  343. VALUES (#{labelNo}, #{itemNo}, #{seqNo}, #{objectName})
  344. </insert>
  345. <!--修改标签的打印参数-->
  346. <update id="updateLabelContent" parameterType="LabelContentData">
  347. UPDATE ReportContentItem SET ShowSeqNo = #{showSeqNo}, ObjectName = #{objectName}, ObjectGroup = #{objectGroup},
  348. DBFieldName = #{dbFieldName}, SequenceNoflag = #{sequenceNoFlag}, SequenceBits = #{sequenceBits},
  349. [Interval] = #{intervalValue}, ItemDesc = #{itemDesc}
  350. <where>
  351. AND ReportID = #{labelNo} AND ItemNo = #{itemNo}
  352. </where>
  353. </update>
  354. <!--删除标签打印参数的信息-->
  355. <delete id="deleteLabelContent" parameterType="LabelContentData">
  356. DELETE FROM ReportContentItem
  357. <where>
  358. AND ReportID = #{labelNo} AND ItemNo = #{itemNo}
  359. </where>
  360. </delete>
  361. <!--查询可以复制的标签内容定义-->
  362. <select id="getCopyLabelSettingList" parameterType="LabelSettingData" resultType="LabelSettingData">
  363. SELECT ReportID labelNo, ReportFamily labelType, Reportfile labelName, ReportType labelClass, Remark remark,
  364. PrintDirection printDirection,ZplCode zplCode
  365. FROM ReportFileList
  366. <where>
  367. AND ReportID != #{labelNo} AND ReportFamily = #{labelType} AND ReportType = #{labelClass}
  368. </where>
  369. ORDER BY ReportID ASC
  370. </select>
  371. <!--首先删除原标签内容定义-->
  372. <delete id="deleteLabelAllContentsByLabelNo" parameterType="LabelSettingData">
  373. DELETE FROM ReportContentItem
  374. <where>
  375. AND ReportID = #{labelNo}
  376. </where>
  377. </delete>
  378. <delete id="deleteLabelAllContentRulesByLabelNo" parameterType="LabelSettingData">
  379. DELETE FROM ReportContentItem_SeqRule
  380. <where>
  381. AND ReportID = #{labelNo}
  382. </where>
  383. </delete>
  384. <!--复制其他标签的标签内容定义-->
  385. <insert id="copyLabelAllContentsWithOther" parameterType="LabelSettingData">
  386. INSERT INTO ReportContentItem(ReportID, ItemNo, ShowSeqNo, ItemDesc, ObjectName, ObjectGroup,
  387. DBFieldName, SequenceNoflag, SequenceBits, [Interval])
  388. SELECT #{labelNo},
  389. ItemNo,
  390. ShowSeqNo,
  391. ItemDesc,
  392. ObjectName,
  393. ObjectGroup,
  394. DBFieldName,
  395. SequenceNoflag,
  396. SequenceBits,
  397. [Interval]
  398. FROM ReportContentItem
  399. WHERE ReportID = #{newLabelNo}
  400. </insert>
  401. <!--获取要用的标签内容-->
  402. <select id="getUsedLabelContent" parameterType="LabelContentData" resultType="LabelContentData">
  403. SELECT ItemNo itemNo, ShowSeqNo showSeqNo, ItemDesc itemDesc, ObjectName objectName, ObjectGroup objectGroup,
  404. DBFieldName dbFieldName, SequenceNoflag sequenceNoFlag, SequenceBits sequenceBits, [Interval] intervalValue,
  405. ReportID labelNo
  406. FROM ReportContentItem
  407. <where>
  408. AND ReportID = #{labelNo} AND ItemNo != #{itemNo}
  409. </where>
  410. ORDER BY ItemNo
  411. </select>
  412. <!--获取要用的标签内容-->
  413. <select id="getLabelContent" parameterType="LabelContentData" resultType="LabelContentData">
  414. SELECT ItemNo itemNo, ShowSeqNo showSeqNo, ItemDesc itemDesc, ObjectName objectName, ObjectGroup objectGroup,
  415. DBFieldName dbFieldName, SequenceNoflag sequenceNoFlag, SequenceBits sequenceBits, [Interval] intervalValue,
  416. ReportID labelNo
  417. FROM ReportContentItem
  418. <where>
  419. AND ReportID = #{labelNo} AND ItemNo = #{itemNo}
  420. </where>
  421. ORDER BY ItemNo
  422. </select>
  423. <!--获取标签内容的流水号规则-->
  424. <select id="getLabelContentSerialRule" parameterType="LabelContentData" resultType="LabelContentSerialRuleData">
  425. SELECT rcs.ReportID labelNo, rcs.ItemNo itemNo, rcs.SeqNo seqNo, rcs.ObjectName objectName
  426. FROM ReportContentItem_SeqRule rcs
  427. <where>
  428. AND rcs.ReportID = #{labelNo} AND rcs.ItemNo = #{itemNo}
  429. </where>
  430. ORDER BY rcs.SeqNo
  431. </select>
  432. <!--删除标签内容的流水号规则-->
  433. <delete id="deleteLabelContentSerialRule" parameterType="LabelContentSerialRuleData">
  434. DELETE FROM ReportContentItem_SeqRule
  435. <where>
  436. AND ReportID = #{labelNo} AND ItemNo = #{itemNo} AND SeqNo = #{seqNo}
  437. </where>
  438. </delete>
  439. <!--获取标签内容的流水号信息-->
  440. <select id="getLabelSerialInfos" parameterType="LabelContentData" resultType="LabelContentSerialInfoData">
  441. SELECT rcs.ReportID labelNo, rcs.ItemNo itemNo, rcs.KeyInfo keyInfo, rcs.LastSeqNo lastSeqNo
  442. FROM ReportFile_SeqInfo rcs
  443. <where>
  444. AND rcs.ReportID = #{labelNo} AND rcs.ItemNo = #{itemNo}
  445. </where>
  446. </select>
  447. <!--插入标签流水号信息-->
  448. <insert id="insertLabelSerialInfo" parameterType="LabelContentSerialInfoData">
  449. INSERT INTO ReportFile_SeqInfo(ReportID, ItemNo, KeyInfo, LastSeqNo)
  450. VALUES (#{labelNo}, #{itemNo}, #{keyInfo}, #{lastSeqNo})
  451. </insert>
  452. <!--修改标签流水号信息-->
  453. <update id="updateLabelSerialInfo" parameterType="LabelContentSerialInfoData">
  454. UPDATE ReportFile_SeqInfo SET KeyInfo = #{keyInfo}, LastSeqNo = #{lastSeqNo}
  455. <where>
  456. AND ReportID = #{labelNo} AND ItemNo = #{itemNo} AND KeyInfo = #{oriKeyInfo}
  457. </where>
  458. </update>
  459. <!--删除标签流水号信息-->
  460. <delete id="deleteLabelSerialInfo" parameterType="LabelContentSerialRuleData">
  461. DELETE FROM ReportFile_SeqInfo
  462. <where>
  463. AND ReportID = #{labelNo} AND ItemNo = #{itemNo} AND KeyInfo = #{keyInfo}
  464. </where>
  465. </delete>
  466. <!-- 获取标签类型列表 -->
  467. <select id="getLabelTypeList" resultType="java.util.Map">
  468. SELECT name as label, name as value, view_sql as viewSql, ifs_view_sql as ifsViewSql
  469. FROM report_family_list
  470. <where>
  471. <if test="labelType != null and labelType != ''">
  472. name = #{labelType}
  473. </if>
  474. </where>
  475. </select>
  476. <!-- 根据ReportId获取ReportFamily信息 -->
  477. <select id="getReportFileByReportId" parameterType="java.lang.String" resultType="ReportFileList">
  478. SELECT ReportID as reportId, ReportFamily as reportFamily
  479. FROM ReportFileList
  480. WHERE ReportID = #{reportId}
  481. </select>
  482. <!-- 根据ReportFamily获取视图SQL名称 -->
  483. <select id="getReportFamilyByName" resultType="ReportFamilyList">
  484. SELECT name, view_sql as viewSql, ifs_view_sql as ifsViewSql
  485. FROM report_family_list
  486. WHERE name = #{name}
  487. </select>
  488. <!-- 执行视图查询获取数据 -->
  489. <select id="getViewData" resultType="java.util.Map">
  490. SELECT * FROM ${viewSql}
  491. <where>
  492. <if test="params != null">
  493. <!-- 动态生成查询条件 -->
  494. <if test="params.site != null and params.site != ''">
  495. AND site = #{params.site}
  496. </if>
  497. <if test="params.receiptNo != null and params.receiptNo != ''">
  498. AND receipt_no = #{params.receiptNo}
  499. </if>
  500. <if test="params.warehouseId != null and params.warehouseId != ''">
  501. AND warehouse_id = #{params.warehouseId}
  502. </if>
  503. <if test="params.partNo != null and params.partNo != ''">
  504. AND part_no = #{params.partNo}
  505. </if>
  506. <if test="params.batchNo != null and params.batchNo != ''">
  507. AND batch_no = #{params.batchNo}
  508. </if>
  509. <if test="params.locationId != null and params.locationId != ''">
  510. AND location_id = #{params.locationId}
  511. </if>
  512. <if test="params.wdr != null and params.wdr != ''">
  513. AND wdr = #{params.wdr}
  514. </if>
  515. <if test="params.unitIds != null and params.unitIds.size > 0">
  516. AND unit_id IN
  517. <foreach collection="params.unitIds" item="unitId" open="(" separator="," close=")">
  518. #{unitId}
  519. </foreach>
  520. </if>
  521. <!-- 可以根据需要添加更多参数 -->
  522. </if>
  523. </where>
  524. </select>
  525. <update id="saveFullSerialNumber" parameterType="ReportLabelList">
  526. UPDATE report_label_list SET full_serial_number = #{fullSerialNumber}
  527. <where>
  528. AND report_id = #{reportId} AND label_no = #{labelNo} AND type = 'serialNumber'
  529. </where>
  530. </update>
  531. <!-- 保存WMS标签记录 -->
  532. <insert id="saveWmsLabel" parameterType="WmsLabel">
  533. INSERT INTO wms_label (
  534. site, serial_no, part_no, qty, in_stock_flag,
  535. label_type, batch_no, warehouse_id, location_id, remark, tid, epc
  536. ) VALUES (
  537. #{site}, #{serialNo}, #{partNo}, #{qty}, #{inStockFlag},
  538. #{labelType}, #{batchNo}, #{warehouseId}, #{locationId}, #{remark}, #{tid}, #{epc}
  539. )
  540. </insert>
  541. <select id="getReportLabelListByLabelNo" parameterType="java.lang.String" resultType="ReportLabelList">
  542. SELECT * FROM report_label_list
  543. <where>
  544. AND label_no = #{labelNo}
  545. </where>
  546. </select>
  547. <select id="getReportLabelListByReportId" parameterType="java.lang.String" resultType="ReportLabelList">
  548. SELECT * FROM report_label_list
  549. <where>
  550. AND report_id = #{labelNo}
  551. </where>
  552. </select>
  553. <select id="getSysParamValue" resultType="java.lang.String">
  554. select value from sys_param
  555. where site =#{site} and group_code=#{groupCode} and code=#{code}
  556. </select>
  557. </mapper>