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.

115 lines
4.3 KiB

3 years ago
3 years ago
3 years ago
3 years 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.xujie.sys.modules.pms.mapper.EamObjectMapper">
  4. <!--查询设备清单的接口-->
  5. <select id="getEamObjectList" parameterType="EamObjectData" resultType="EamObjectData">
  6. SELECT * FROM (
  7. SELECT DISTINCT
  8. eo.Site,
  9. eo.ObjectID,
  10. eo.ObjectDesc,
  11. eo.LocationID,
  12. el.LocationName,
  13. eo.FamilyID,
  14. ef.FamilyDesc,
  15. eo.GroupID,
  16. eg.GroupDesc,
  17. eo.SupplierID,
  18. es.SupplierName,
  19. eo.manufacturerID,
  20. eo.SeqNo,
  21. eo.PurchessDate,
  22. eo.Active,
  23. eo.CreateDate,
  24. eo.CreateBy,
  25. eo.update_date,
  26. eo.update_by,
  27. eo.ClosedDate,
  28. eo.ClosedBy,
  29. eo.resourceID,
  30. res.resource_desc,
  31. eo.dept_id,
  32. dbo.eam_Get_nextPlanDate(eo.Site, eo.ObjectID,'A') nextCDate,
  33. dbo.eam_Get_nextPlanDate(eo.Site, eo.ObjectID,'B') nextMDate,
  34. eo.asset_no,
  35. eo.asset_remark
  36. FROM eam_object as eo
  37. LEFT JOIN eam_location as el ON eo.site = el.site and eo.LocationID = el.LocationID
  38. LEFT JOIN eam_family as ef ON eo.site = ef.site and eo.FamilyID = ef.FamilyID
  39. LEFT JOIN eam_supplier as es ON eo.site = es.site and eo.SupplierID = es.SupplierID
  40. LEFT JOIN eam_group as eg ON eo.site = eg.site and eo.GroupID = eg.GroupID
  41. LEFT JOIN resource as res ON eo.site = res.site and eo.resourceID = res.resource_id
  42. <where>
  43. eo.site = #{query.site}
  44. <if test="query.objectID != null and query.objectID != ''">
  45. AND eo.ObjectID like '%' + #{query.objectID} +'%'
  46. </if>
  47. <if test="query.objectDesc != null and query.objectDesc != ''">
  48. AND eo.ObjectDesc like '%' + #{query.objectDesc} +'%'
  49. </if>
  50. <if test="query.resourceID != null and query.resourceID != ''">
  51. AND eo.resourceID like '%' + #{query.resourceID} +'%'
  52. </if>
  53. <if test="query.locationName != null and query.locationName != ''">
  54. AND el.LocationName like '%' + #{query.locationName} +'%'
  55. </if>
  56. <if test="query.familyDesc != null and query.familyDesc != ''">
  57. AND ef.FamilyDesc like '%' + #{query.familyDesc} +'%'
  58. </if>
  59. <if test="query.active != null and query.active != ''">
  60. AND eo.active = #{query.active}
  61. </if>
  62. </where>
  63. ) as temp
  64. </select>
  65. <!--查询设备清单按照设备的id-->
  66. <select id="getEamObjectByObjectId" parameterType="EamObjectData" resultType="EamObjectData">
  67. SELECT Site, ObjectID, ObjectDesc, LocationID, FamilyID, GroupID, SupplierID, manufacturerID, SeqNo,
  68. PurchessDate, Active, CreateDate, CreateBy, ClosedDate, ClosedBy,resourceID
  69. FROM eam_object
  70. <where>
  71. AND site = #{site} AND ObjectID = #{objectID}
  72. </where>
  73. </select>
  74. <!--插入设备清单的数据-->
  75. <insert id="insertEamObject">
  76. insert into eam_object
  77. (Site, ObjectID, ObjectDesc, LocationID, FamilyID, GroupID, SupplierID, ManufacturerID, SeqNo, PurchessDate, Active, CreateDate, CreateBy, resourceID, update_date, update_by, dept_id, asset_no, asset_remark)
  78. values(#{site}, #{objectID}, #{objectDesc}, #{locationID}, #{familyID}, #{groupID}, #{supplierID}, #{manufacturerID}, #{seqNo}, #{purchessDate}, #{active}, #{createDate}, #{createBy}, #{resourceID}, getDate(), #{updateBy}, #{deptID}, #{assetNo}, #{assetRemark})
  79. </insert>
  80. <!--修改设备清单的数据-->
  81. <update id="updateEamObject">
  82. update eam_object
  83. set ObjectDesc = #{objectDesc},
  84. LocationID = #{locationID},
  85. FamilyID = #{familyID},
  86. GroupID = #{groupID},
  87. SupplierID = #{supplierID},
  88. ManufacturerID = #{manufacturerID},
  89. SeqNo = #{seqNo},
  90. PurchessDate = #{purchessDate},
  91. Active = #{active},
  92. resourceID = #{resourceID},
  93. update_date = getDate(),
  94. update_by = #{updateBy},
  95. dept_id = #{deptID}
  96. where site = #{site}
  97. AND ObjectID = #{objectID}
  98. </update>
  99. <!--删除设备清单的信息-->
  100. <delete id="deleteEamObject">
  101. delete from eam_object
  102. where site = #{site} AND ObjectID = #{objectID}
  103. </delete>
  104. <select id="getFileData" resultType="SysOssEntity">
  105. select url,file_name,new_file_name from sys_oss where id = #{id}
  106. </select>
  107. </mapper>