InspectionRouteServiceDaoImplMapper.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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="inspectionRouteServiceDaoImpl">
  6. <!-- 保存巡检路线信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessInspectionRouteInfo" parameterType="Map">
  8. insert into business_inspection_route(
  9. operate,inspection_route_id,seq,remark,community_id,b_id,Route_name
  10. ) values (
  11. #{operate},#{inspectionRouteId},#{seq},#{remark},#{communityId},#{bId},#{routeName}
  12. )
  13. </insert>
  14. <!-- 查询巡检路线信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessInspectionRouteInfo" parameterType="Map" resultType="Map">
  16. select t.operate,t.inspection_route_Id,t.inspection_route_Id inspectionRouteId,t.seq,t.remark,t.community_id,t.community_id
  17. communityId,t.b_id,t.b_id bId,t.Route_name,t.Route_name routeName
  18. from business_inspection_route t
  19. where 1 =1
  20. <if test="operate !=null and operate != ''">
  21. and t.operate= #{operate}
  22. </if>
  23. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  24. and t.inspection_route_Id= #{inspectionRouteId}
  25. </if>
  26. <if test="seq !=null and seq != 0">
  27. and t.seq= #{seq}
  28. </if>
  29. <if test="remark !=null and remark != ''">
  30. and t.remark= #{remark}
  31. </if>
  32. <if test="communityId !=null and communityId != ''">
  33. and t.community_id= #{communityId}
  34. </if>
  35. <if test="bId !=null and bId != ''">
  36. and t.b_id= #{bId}
  37. </if>
  38. <if test="routeName !=null and routeName != ''">
  39. and t.Route_name= #{routeName}
  40. </if>
  41. </select>
  42. <!-- 保存巡检路线信息至 instance表中 add by wuxw 2018-07-03 -->
  43. <insert id="saveInspectionRouteInfoInstance" parameterType="Map">
  44. insert into inspection_route(
  45. inspection_route_id,seq,remark,status_cd,community_id,b_id,Route_name
  46. ) select
  47. t.inspection_route_Id,t.seq,t.remark,'0',t.community_id,t.b_id,t.Route_name from
  48. business_inspection_route t where 1=1
  49. and t.operate= 'ADD'
  50. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  51. and t.inspection_route_Id= #{inspectionRouteId}
  52. </if>
  53. <if test="seq !=null and seq != 0">
  54. and t.seq= #{seq}
  55. </if>
  56. <if test="remark !=null and remark != ''">
  57. and t.remark= #{remark}
  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. <if test="routeName !=null and routeName != ''">
  66. and t.Route_name= #{routeName}
  67. </if>
  68. </insert>
  69. <!-- 查询巡检路线信息 add by wuxw 2018-07-03 -->
  70. <select id="getInspectionRouteInfo" parameterType="Map" resultType="Map">
  71. select t.inspection_route_Id,t.inspection_route_Id inspectionRouteId,t.seq,t.remark,t.status_cd,t.status_cd
  72. statusCd,t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.Route_name,t.Route_name routeName
  73. from inspection_route t
  74. where 1 =1
  75. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  76. and t.inspection_route_Id= #{inspectionRouteId}
  77. </if>
  78. <if test="seq !=null and seq != 0">
  79. and t.seq= #{seq}
  80. </if>
  81. <if test="remark !=null and remark != ''">
  82. and t.remark= #{remark}
  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. </if>
  90. <if test="bId !=null and bId != ''">
  91. and t.b_id= #{bId}
  92. </if>
  93. <if test="routeName !=null and routeName != ''">
  94. and t.Route_name= #{routeName}
  95. </if>
  96. <if test="inspectionRouteIds !=null">
  97. and t.inspection_route_Id in
  98. <foreach collection="inspectionRouteIds" item="item" open="(" close=")" separator=",">
  99. #{item}
  100. </foreach>
  101. </if>
  102. order by t.create_time desc
  103. <if test="page != -1 and page != null ">
  104. limit #{page}, #{row}
  105. </if>
  106. </select>
  107. <!-- 修改巡检路线信息 add by wuxw 2018-07-03 -->
  108. <update id="updateInspectionRouteInfoInstance" parameterType="Map">
  109. update inspection_route t set t.status_cd = #{statusCd}
  110. <if test="newBId != null and newBId != ''">
  111. ,t.b_id = #{newBId}
  112. </if>
  113. <if test="seq !=null and seq != 0">
  114. , t.seq= #{seq}
  115. </if>
  116. <if test="remark !=null and remark != ''">
  117. , t.remark= #{remark}
  118. </if>
  119. <if test="communityId !=null and communityId != ''">
  120. , t.community_id= #{communityId}
  121. </if>
  122. <if test="routeName !=null and routeName != ''">
  123. , t.Route_name= #{routeName}
  124. </if>
  125. where 1=1
  126. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  127. and t.inspection_route_Id= #{inspectionRouteId}
  128. </if>
  129. <if test="bId !=null and bId != ''">
  130. and t.b_id= #{bId}
  131. </if>
  132. </update>
  133. <!-- 查询巡检路线数量 add by wuxw 2018-07-03 -->
  134. <select id="queryInspectionRoutesCount" parameterType="Map" resultType="Map">
  135. select count(1) count
  136. from inspection_route t
  137. where 1 =1
  138. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  139. and t.inspection_route_Id= #{inspectionRouteId}
  140. </if>
  141. <if test="seq !=null and seq != 0">
  142. and t.seq= #{seq}
  143. </if>
  144. <if test="remark !=null and remark != ''">
  145. and t.remark= #{remark}
  146. </if>
  147. <if test="statusCd !=null and statusCd != ''">
  148. and t.status_cd= #{statusCd}
  149. </if>
  150. <if test="communityId !=null and communityId != ''">
  151. and t.community_id= #{communityId}
  152. </if>
  153. <if test="bId !=null and bId != ''">
  154. and t.b_id= #{bId}
  155. </if>
  156. <if test="routeName !=null and routeName != ''">
  157. and t.Route_name= #{routeName}
  158. </if>
  159. </select>
  160. </mapper>