InspectionServiceDaoImplMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="inspectionServiceDaoImpl">
  6. <!-- 保存巡检点信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessInspectionInfo" parameterType="Map">
  8. insert into business_inspection_point(
  9. inspection_id,machine_id,operate,remark,inspection_name,community_id,b_id
  10. ) values (
  11. #{inspectionId},#{machineId},#{operate},#{remark},#{inspectionName},#{communityId},#{bId}
  12. )
  13. </insert>
  14. <!-- 查询巡检点信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessInspectionInfo" parameterType="Map" resultType="Map">
  16. select t.inspection_id,t.inspection_id inspectionId,t.machine_id,t.machine_id machineId,t.operate,t.remark,t.inspection_name,t.inspection_name inspectionName,t.community_id,t.community_id communityId,t.b_id,t.b_id bId
  17. from business_inspection_point t
  18. where 1 =1
  19. <if test="inspectionId !=null and inspectionId != ''">
  20. and t.inspection_id= #{inspectionId}
  21. </if>
  22. <if test="machineId !=null and machineId != ''">
  23. and t.machine_id= #{machineId}
  24. </if>
  25. <if test="operate !=null and operate != ''">
  26. and t.operate= #{operate}
  27. </if>
  28. <if test="remark !=null and remark != ''">
  29. and t.remark= #{remark}
  30. </if>
  31. <if test="inspectionName !=null and inspectionName != ''">
  32. and t.inspection_name= #{inspectionName}
  33. </if>
  34. <if test="communityId !=null and communityId != ''">
  35. and t.community_id= #{communityId}
  36. </if>
  37. <if test="bId !=null and bId != ''">
  38. and t.b_id= #{bId}
  39. </if>
  40. </select>
  41. <!-- 保存巡检点信息至 instance表中 add by wuxw 2018-07-03 -->
  42. <insert id="saveInspectionInfoInstance" parameterType="Map">
  43. insert into inspection_point(
  44. inspection_id,machine_id,remark,status_cd,inspection_name,community_id,b_id
  45. ) select t.inspection_id,t.machine_id,t.remark,'0',t.inspection_name,t.community_id,t.b_id from business_inspection_point t where 1=1
  46. <if test="inspectionId !=null and inspectionId != ''">
  47. and t.inspection_id= #{inspectionId}
  48. </if>
  49. <if test="machineId !=null and machineId != ''">
  50. and t.machine_id= #{machineId}
  51. </if>
  52. and t.operate= 'ADD'
  53. <if test="remark !=null and remark != ''">
  54. and t.remark= #{remark}
  55. </if>
  56. <if test="inspectionName !=null and inspectionName != ''">
  57. and t.inspection_name= #{inspectionName}
  58. </if>
  59. <if test="communityId !=null and communityId != ''">
  60. and t.community_id= #{communityId}
  61. </if>
  62. <if test="bId !=null and bId != ''">
  63. and t.b_id= #{bId}
  64. </if>
  65. </insert>
  66. <!-- 查询巡检点信息 add by wuxw 2018-07-03 -->
  67. <select id="getInspectionInfo" parameterType="Map" resultType="Map">
  68. select t.inspection_id,t.inspection_id inspectionId,t.machine_id,t.machine_id machineId,t.remark,t.status_cd,t.status_cd statusCd,t.inspection_name,t.inspection_name inspectionName,t.community_id,t.community_id communityId,t.b_id,t.b_id bId
  69. from inspection_point t
  70. where 1 =1
  71. <if test="inspectionId !=null and inspectionId != ''">
  72. and t.inspection_id= #{inspectionId}
  73. </if>
  74. <if test="machineId !=null and machineId != ''">
  75. and t.machine_id= #{machineId}
  76. </if>
  77. <if test="remark !=null and remark != ''">
  78. and t.remark= #{remark}
  79. </if>
  80. <if test="statusCd !=null and statusCd != ''">
  81. and t.status_cd= #{statusCd}
  82. </if>
  83. <if test="inspectionName !=null and inspectionName != ''">
  84. and t.inspection_name= #{inspectionName}
  85. </if>
  86. <if test="communityId !=null and communityId != ''">
  87. and t.community_id= #{communityId}
  88. </if>
  89. <if test="bId !=null and bId != ''">
  90. and t.b_id= #{bId}
  91. </if>
  92. order by t.create_time desc
  93. <if test="page != -1 and page != null ">
  94. limit #{page}, #{row}
  95. </if>
  96. </select>
  97. <!-- 修改巡检点信息 add by wuxw 2018-07-03 -->
  98. <update id="updateInspectionInfoInstance" parameterType="Map">
  99. update inspection_point t set t.status_cd = #{statusCd}
  100. <if test="newBId != null and newBId != ''">
  101. ,t.b_id = #{newBId}
  102. </if>
  103. <if test="machineId !=null and machineId != ''">
  104. , t.machine_id= #{machineId}
  105. </if>
  106. <if test="remark !=null and remark != ''">
  107. , t.remark= #{remark}
  108. </if>
  109. <if test="inspectionName !=null and inspectionName != ''">
  110. , t.inspection_name= #{inspectionName}
  111. </if>
  112. <if test="communityId !=null and communityId != ''">
  113. , t.community_id= #{communityId}
  114. </if>
  115. where 1=1 <if test="inspectionId !=null and inspectionId != ''">
  116. and t.inspection_id= #{inspectionId}
  117. </if>
  118. <if test="bId !=null and bId != ''">
  119. and t.b_id= #{bId}
  120. </if>
  121. </update>
  122. <!-- 查询巡检点数量 add by wuxw 2018-07-03 -->
  123. <select id="queryInspectionsCount" parameterType="Map" resultType="Map">
  124. select count(1) count
  125. from inspection_point t
  126. where 1 =1
  127. <if test="inspectionId !=null and inspectionId != ''">
  128. and t.inspection_id= #{inspectionId}
  129. </if>
  130. <if test="machineId !=null and machineId != ''">
  131. and t.machine_id= #{machineId}
  132. </if>
  133. <if test="remark !=null and remark != ''">
  134. and t.remark= #{remark}
  135. </if>
  136. <if test="statusCd !=null and statusCd != ''">
  137. and t.status_cd= #{statusCd}
  138. </if>
  139. <if test="inspectionName !=null and inspectionName != ''">
  140. and t.inspection_name= #{inspectionName}
  141. </if>
  142. <if test="communityId !=null and communityId != ''">
  143. and t.community_id= #{communityId}
  144. </if>
  145. <if test="bId !=null and bId != ''">
  146. and t.b_id= #{bId}
  147. </if>
  148. </select>
  149. </mapper>