InspectionTaskDetailV1ServiceDaoImplMapper.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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="inspectionTaskDetailV1ServiceDaoImpl">
  6. <!-- 保存巡检明细信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveInspectionTaskDetailInfo" parameterType="Map">
  8. insert into inspection_task_detail(
  9. send_flag,point_end_time,latitude,inspection_time,sort_number,description,act_user_name,task_detail_id,inspection_id,
  10. inspection_state,point_start_time,inspection_name,state,community_id,act_user_id,task_id,longitude
  11. ) values (
  12. #{sendFlag},#{pointEndTime},#{latitude},#{inspectionTime},#{sortNumber},#{description},#{actUserName},#{taskDetailId},
  13. #{inspectionId},#{inspectionState},#{pointStartTime},#{inspectionName},#{state},#{communityId},#{actUserId},#{taskId},#{longitude}
  14. )
  15. </insert>
  16. <!-- 查询巡检明细信息 add by wuxw 2018-07-03 -->
  17. <select id="getInspectionTaskDetailInfo" parameterType="Map" resultType="Map">
  18. select t.send_flag sendFlag,t.point_end_time pointEndTime,t.latitude,t.inspection_time inspectionTime,t.sort_number,t.sort_number
  19. sortNumber,t.description,t.status_cd statusCd,t.act_user_name actUserName,t.task_detail_id taskDetailId,t.inspection_id
  20. inspectionId,t.inspection_state inspectionState,t.point_start_time pointStartTime,t.inspection_name inspectionName,t.state,
  21. t.community_id communityId,t.act_user_id actUserId,t.task_id taskId,t.longitude,ip.lng,ip.lat
  22. from inspection_task_detail t
  23. left join inspection_point ip on t.inspection_id = ip.inspection_id and ip.status_cd = '0'
  24. where 1 =1
  25. <if test="sendFlag !=null and sendFlag != ''">
  26. and t.send_flag= #{sendFlag}
  27. </if>
  28. <if test="pointEndTime !=null and pointEndTime != ''">
  29. and t.point_end_time= #{pointEndTime}
  30. </if>
  31. <if test="latitude !=null and latitude != ''">
  32. and t.latitude= #{latitude}
  33. </if>
  34. <if test="inspectionTime !=null and inspectionTime != ''">
  35. and t.inspection_time= #{inspectionTime}
  36. </if>
  37. <if test="sortNumber !=null and sortNumber != ''">
  38. and t.sort_number= #{sortNumber}
  39. </if>
  40. <if test="description !=null and description != ''">
  41. and t.description= #{description}
  42. </if>
  43. <if test="statusCd !=null and statusCd != ''">
  44. and t.status_cd= #{statusCd}
  45. </if>
  46. <if test="actUserName !=null and actUserName != ''">
  47. and t.act_user_name= #{actUserName}
  48. </if>
  49. <if test="taskDetailId !=null and taskDetailId != ''">
  50. and t.task_detail_id= #{taskDetailId}
  51. </if>
  52. <if test="inspectionId !=null and inspectionId != ''">
  53. and t.inspection_id= #{inspectionId}
  54. </if>
  55. <if test="inspectionState !=null and inspectionState != ''">
  56. and t.inspection_state= #{inspectionState}
  57. </if>
  58. <if test="pointStartTime !=null and pointStartTime != ''">
  59. and t.point_start_time= #{pointStartTime}
  60. </if>
  61. <if test="inspectionName !=null and inspectionName != ''">
  62. and t.inspection_name= #{inspectionName}
  63. </if>
  64. <if test="state !=null and state != ''">
  65. and t.state= #{state}
  66. </if>
  67. <if test="communityId !=null and communityId != ''">
  68. and t.community_id= #{communityId}
  69. </if>
  70. <if test="actUserId !=null and actUserId != ''">
  71. and t.act_user_id= #{actUserId}
  72. </if>
  73. <if test="taskId !=null and taskId != ''">
  74. and t.task_id= #{taskId}
  75. </if>
  76. <if test="longitude !=null and longitude != ''">
  77. and t.longitude= #{longitude}
  78. </if>
  79. order by t.create_time desc
  80. <if test="page != -1 and page != null ">
  81. limit #{page}, #{row}
  82. </if>
  83. </select>
  84. <!-- 修改巡检明细信息 add by wuxw 2018-07-03 -->
  85. <update id="updateInspectionTaskDetailInfo" parameterType="Map">
  86. update inspection_task_detail t set t.status_cd = #{statusCd}
  87. <if test="newBId != null and newBId != ''">
  88. ,t.b_id = #{newBId}
  89. </if>
  90. <if test="sendFlag !=null and sendFlag != ''">
  91. , t.send_flag= #{sendFlag}
  92. </if>
  93. <if test="pointEndTime !=null and pointEndTime != ''">
  94. , t.point_end_time= #{pointEndTime}
  95. </if>
  96. <if test="latitude !=null and latitude != ''">
  97. , t.latitude= #{latitude}
  98. </if>
  99. <if test="inspectionTime !=null and inspectionTime != ''">
  100. , t.inspection_time= #{inspectionTime}
  101. </if>
  102. <if test="sortNumber !=null and sortNumber != ''">
  103. , t.sort_number= #{sortNumber}
  104. </if>
  105. <if test="description !=null and description != ''">
  106. , t.description= #{description}
  107. </if>
  108. <if test="actUserName !=null and actUserName != ''">
  109. , t.act_user_name= #{actUserName}
  110. </if>
  111. <if test="inspectionId !=null and inspectionId != ''">
  112. , t.inspection_id= #{inspectionId}
  113. </if>
  114. <if test="inspectionState !=null and inspectionState != ''">
  115. , t.inspection_state= #{inspectionState}
  116. </if>
  117. <if test="pointStartTime !=null and pointStartTime != ''">
  118. , t.point_start_time= #{pointStartTime}
  119. </if>
  120. <if test="inspectionName !=null and inspectionName != ''">
  121. , t.inspection_name= #{inspectionName}
  122. </if>
  123. <if test="state !=null and state != ''">
  124. , t.state= #{state}
  125. </if>
  126. <if test="actUserId !=null and actUserId != ''">
  127. , t.act_user_id= #{actUserId}
  128. </if>
  129. <if test="taskId !=null and taskId != ''">
  130. , t.task_id= #{taskId}
  131. </if>
  132. <if test="longitude !=null and longitude != ''">
  133. , t.longitude= #{longitude}
  134. </if>
  135. where 1=1
  136. <if test="taskDetailId !=null and taskDetailId != ''">
  137. and t.task_detail_id= #{taskDetailId}
  138. </if>
  139. <if test="communityId !=null and communityId != ''">
  140. and t.community_id= #{communityId}
  141. </if>
  142. </update>
  143. <!-- 查询巡检明细数量 add by wuxw 2018-07-03 -->
  144. <select id="queryInspectionTaskDetailsCount" parameterType="Map" resultType="Map">
  145. select count(1) count
  146. from inspection_task_detail t
  147. where 1 =1
  148. <if test="sendFlag !=null and sendFlag != ''">
  149. and t.send_flag= #{sendFlag}
  150. </if>
  151. <if test="pointEndTime !=null and pointEndTime != ''">
  152. and t.point_end_time= #{pointEndTime}
  153. </if>
  154. <if test="latitude !=null and latitude != ''">
  155. and t.latitude= #{latitude}
  156. </if>
  157. <if test="inspectionTime !=null and inspectionTime != ''">
  158. and t.inspection_time= #{inspectionTime}
  159. </if>
  160. <if test="sortNumber !=null and sortNumber != ''">
  161. and t.sort_number= #{sortNumber}
  162. </if>
  163. <if test="description !=null and description != ''">
  164. and t.description= #{description}
  165. </if>
  166. <if test="statusCd !=null and statusCd != ''">
  167. and t.status_cd= #{statusCd}
  168. </if>
  169. <if test="actUserName !=null and actUserName != ''">
  170. and t.act_user_name= #{actUserName}
  171. </if>
  172. <if test="taskDetailId !=null and taskDetailId != ''">
  173. and t.task_detail_id= #{taskDetailId}
  174. </if>
  175. <if test="inspectionId !=null and inspectionId != ''">
  176. and t.inspection_id= #{inspectionId}
  177. </if>
  178. <if test="inspectionState !=null and inspectionState != ''">
  179. and t.inspection_state= #{inspectionState}
  180. </if>
  181. <if test="pointStartTime !=null and pointStartTime != ''">
  182. and t.point_start_time= #{pointStartTime}
  183. </if>
  184. <if test="inspectionName !=null and inspectionName != ''">
  185. and t.inspection_name= #{inspectionName}
  186. </if>
  187. <if test="state !=null and state != ''">
  188. and t.state= #{state}
  189. </if>
  190. <if test="communityId !=null and communityId != ''">
  191. and t.community_id= #{communityId}
  192. </if>
  193. <if test="actUserId !=null and actUserId != ''">
  194. and t.act_user_id= #{actUserId}
  195. </if>
  196. <if test="taskId !=null and taskId != ''">
  197. and t.task_id= #{taskId}
  198. </if>
  199. <if test="longitude !=null and longitude != ''">
  200. and t.longitude= #{longitude}
  201. </if>
  202. </select>
  203. </mapper>