InspectionRoutePointRelServiceDaoImplMapper.xml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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="inspectionRoutePointRelServiceDaoImpl">
  6. <!-- 保存巡检路线巡检点关系信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessInspectionRoutePointRelInfo" parameterType="Map">
  8. insert into business_inspection_route_point_rel(
  9. inspection_id,operate,inspection_route_id,irp_rel_id,community_id,b_id
  10. ) values (
  11. #{inspectionId},#{operate},#{inspectionRouteId},#{irpRelId},#{communityId},#{bId}
  12. )
  13. </insert>
  14. <!-- 查询巡检路线巡检点关系信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessInspectionRoutePointRelInfo" parameterType="Map" resultType="Map">
  16. select t.inspection_id,t.inspection_id inspectionId,t.operate,t.inspection_route_id,t.inspection_route_id
  17. inspectionRouteId,t.irp_rel_id,t.irp_rel_id irpRelId,t.community_id,t.community_id
  18. communityId,t.b_id,t.b_id bId
  19. from business_inspection_route_point_rel t
  20. where 1 =1
  21. <if test="inspectionId !=null and inspectionId != ''">
  22. and t.inspection_id= #{inspectionId}
  23. </if>
  24. <if test="operate !=null and operate != ''">
  25. and t.operate= #{operate}
  26. </if>
  27. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  28. and t.inspection_route_id= #{inspectionRouteId}
  29. </if>
  30. <if test="irpRelId !=null and irpRelId != ''">
  31. and t.irp_rel_id= #{irpRelId}
  32. </if>
  33. <if test="communityId !=null and communityId != ''">
  34. and t.community_id= #{communityId}
  35. </if>
  36. <if test="bId !=null and bId != ''">
  37. and t.b_id= #{bId}
  38. </if>
  39. </select>
  40. <!-- 保存巡检路线巡检点关系信息至 instance表中 add by wuxw 2018-07-03 -->
  41. <insert id="saveInspectionRoutePointRelInfoInstance" parameterType="Map">
  42. insert into inspection_route_point_rel(
  43. inspection_id,inspection_route_id,irp_rel_id,status_cd,community_id,b_id
  44. ) select t.inspection_id,t.inspection_route_id,t.irp_rel_id,'0',t.community_id,t.b_id from
  45. business_inspection_route_point_rel t where 1=1
  46. <if test="inspectionId !=null and inspectionId != ''">
  47. and t.inspection_id= #{inspectionId}
  48. </if>
  49. and t.operate= 'ADD'
  50. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  51. and t.inspection_route_id= #{inspectionRouteId}
  52. </if>
  53. <if test="irpRelId !=null and irpRelId != ''">
  54. and t.irp_rel_id= #{irpRelId}
  55. </if>
  56. <if test="communityId !=null and communityId != ''">
  57. and t.community_id= #{communityId}
  58. </if>
  59. <if test="bId !=null and bId != ''">
  60. and t.b_id= #{bId}
  61. </if>
  62. </insert>
  63. <!-- 查询巡检路线巡检点关系信息 add by wuxw 2018-07-03 -->
  64. <select id="getInspectionRoutePointRelInfo" parameterType="Map" resultType="Map">
  65. select t.inspection_id,t.inspection_id inspectionId,t.inspection_route_id,t.inspection_route_id
  66. inspectionRouteId,t.irp_rel_id,t.irp_rel_id irpRelId,t.status_cd,t.status_cd
  67. statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,
  68. ip.inspection_id inspectionId,ip.remark,
  69. ip.inspection_name inspectionName,ip.point_obj_type,ip.point_obj_id,ip.point_obj_name,
  70. ip.point_obj_type pointObjType,ip.point_obj_id pointObjId,ip.point_obj_name pointObjName
  71. from inspection_route_point_rel t,inspection_point ip
  72. where 1 =1
  73. and t.inspection_id = ip.inspection_id
  74. and ip.status_cd = '0'
  75. <if test="inspectionId !=null and inspectionId != ''">
  76. and t.inspection_id= #{inspectionId}
  77. </if>
  78. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  79. and t.inspection_route_id= #{inspectionRouteId}
  80. </if>
  81. <if test="irpRelId !=null and irpRelId != ''">
  82. and t.irp_rel_id= #{irpRelId}
  83. </if>
  84. <if test="statusCd !=null and statusCd != ''">
  85. and t.status_cd= #{statusCd}
  86. </if>
  87. <if test="communityId !=null and communityId != ''">
  88. and t.community_id= #{communityId}
  89. and ip.community_id = #{communityId}
  90. </if>
  91. <if test="bId !=null and bId != ''">
  92. and t.b_id= #{bId}
  93. </if>
  94. order by t.create_time desc
  95. <if test="page != -1 and page != null ">
  96. limit #{page}, #{row}
  97. </if>
  98. </select>
  99. <!-- 修改巡检路线巡检点关系信息 add by wuxw 2018-07-03 -->
  100. <update id="updateInspectionRoutePointRelInfoInstance" parameterType="Map">
  101. update inspection_route_point_rel t set t.status_cd = #{statusCd}
  102. <if test="newBId != null and newBId != ''">
  103. ,t.b_id = #{newBId}
  104. </if>
  105. <if test="inspectionId !=null and inspectionId != ''">
  106. , t.inspection_id= #{inspectionId}
  107. </if>
  108. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  109. , t.inspection_route_id= #{inspectionRouteId}
  110. </if>
  111. <if test="communityId !=null and communityId != ''">
  112. , t.community_id= #{communityId}
  113. </if>
  114. where 1=1
  115. <if test="irpRelId !=null and irpRelId != ''">
  116. and t.irp_rel_id= #{irpRelId}
  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="queryInspectionRoutePointRelsCount" parameterType="Map" resultType="Map">
  124. select count(1) count
  125. from inspection_route_point_rel t,inspection_point ip
  126. where 1 =1
  127. and t.inspection_id = ip.inspection_id
  128. and ip.status_cd = '0'
  129. <if test="inspectionId !=null and inspectionId != ''">
  130. and t.inspection_id= #{inspectionId}
  131. </if>
  132. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  133. and t.inspection_route_id= #{inspectionRouteId}
  134. </if>
  135. <if test="irpRelId !=null and irpRelId != ''">
  136. and t.irp_rel_id= #{irpRelId}
  137. </if>
  138. <if test="statusCd !=null and statusCd != ''">
  139. and t.status_cd= #{statusCd}
  140. </if>
  141. <if test="communityId !=null and communityId != ''">
  142. and t.community_id= #{communityId}
  143. and ip.community_id = #{communityId}
  144. </if>
  145. <if test="bId !=null and bId != ''">
  146. and t.b_id= #{bId}
  147. </if>
  148. </select>
  149. </mapper>