InspectionPlanV1ServiceDaoImplMapper.xml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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="inspectionPlanV1ServiceDaoImpl">
  6. <!-- 保存巡检计划信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveInspectionPlanInfo" parameterType="Map">
  8. insert into inspection_plan(
  9. inspection_plan_name,create_user_id,inspection_route_id,inspection_plan_period,remark,
  10. create_user_name,sign_type,start_time,inspection_plan_id,end_time,state,community_id,
  11. start_date,end_date,inspection_month,inspection_day,inspection_workday,before_time,can_reexamine
  12. ) values (
  13. #{inspectionPlanName},#{createUserId},#{inspectionRouteId},#{inspectionPlanPeriod},#{remark},
  14. #{createUserName},#{signType},#{startTime},#{inspectionPlanId},#{endTime},#{state},#{communityId},
  15. #{startDate},#{endDate},#{inspectionMonth},#{inspectionDay},#{inspectionWorkday},#{beforeTime},#{canReexamine}
  16. )
  17. </insert>
  18. <!-- 查询巡检计划信息 add by wuxw 2018-07-03 -->
  19. <select id="getInspectionPlanInfo" parameterType="Map" resultType="Map">
  20. select t.inspection_plan_name,t.inspection_plan_name inspectionPlanName,t.create_user_id,t.create_user_id
  21. createUserId,t.inspection_route_id,t.inspection_route_id inspectionRouteId
  22. ,t.can_reexamine,t.can_reexamine canReexamine,t.inspection_plan_period,t.inspection_plan_period
  23. inspectionPlanPeriod,t.remark,t.create_user_name,t.create_user_name createUserName,t.status_cd,t.status_cd
  24. statusCd,t.sign_type,t.sign_type signType,t.start_time,t.start_time
  25. startTime,t.inspection_plan_id,t.inspection_plan_id inspectionPlanId,t.end_time,t.end_time
  26. endTime,t.state,t.community_id,t.community_id communityId,
  27. DATE_FORMAT(t.start_date,'%Y-%m-%d') startDate,DATE_FORMAT(t.end_date,'%Y-%m-%d') endDate,t.inspection_month inspectionMonth,t.inspection_day inspectionDay,
  28. t.inspection_workday inspectionWorkday,t.before_time beforeTime,t.create_time createTime,
  29. d.name stateName,
  30. c.name inspectionPlanPeriodName,
  31. i.name signTypeName
  32. from inspection_plan t
  33. inner join t_dict d on t.state = d.status_cd and d.table_name = 'inspection_plan' and d.table_columns = 'state'
  34. inner join t_dict c on t.inspection_plan_period = c.status_cd and c.table_name = 'inspection_plan' and
  35. c.table_columns = 'inspection_plan_period'
  36. inner join t_dict i on t.sign_type = i.status_cd and i.table_name = 'inspection_plan' and i.table_columns =
  37. 'sign_type'
  38. where 1 =1
  39. <if test="inspectionPlanName !=null and inspectionPlanName != ''">
  40. and t.inspection_plan_name= #{inspectionPlanName}
  41. </if>
  42. <if test="createUserId !=null and createUserId != ''">
  43. and t.create_user_id= #{createUserId}
  44. </if>
  45. <if test="canReexamine !=null and canReexamine != ''">
  46. and t.can_reexamine= #{canReexamine}
  47. </if>
  48. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  49. and t.inspection_route_id= #{inspectionRouteId}
  50. </if>
  51. <if test="inspectionPlanPeriod !=null and inspectionPlanPeriod != ''">
  52. and t.inspection_plan_period= #{inspectionPlanPeriod}
  53. </if>
  54. <if test="remark !=null and remark != ''">
  55. and t.remark= #{remark}
  56. </if>
  57. <if test="createUserName !=null and createUserName != ''">
  58. and t.create_user_name= #{createUserName}
  59. </if>
  60. <if test="statusCd !=null and statusCd != ''">
  61. and t.status_cd= #{statusCd}
  62. </if>
  63. <if test="signType !=null and signType != ''">
  64. and t.sign_type= #{signType}
  65. </if>
  66. <if test="startTime !=null and startTime != ''">
  67. and t.start_time= #{startTime}
  68. </if>
  69. <if test="inspectionPlanId !=null and inspectionPlanId != ''">
  70. and t.inspection_plan_id= #{inspectionPlanId}
  71. </if>
  72. <if test="endTime !=null and endTime != ''">
  73. and t.end_time= #{endTime}
  74. </if>
  75. <if test="startDate !=null and startDate != ''">
  76. and t.start_date= #{startDate}
  77. </if>
  78. <if test="endDate !=null and endDate != ''">
  79. and t.end_date= #{endDate}
  80. </if>
  81. <if test="beforeTime !=null and beforeTime != ''">
  82. and t.before_time = #{beforeTime}
  83. </if>
  84. <if test="state !=null and state != ''">
  85. and t.state= #{state}
  86. </if>
  87. <if test="communityId !=null and communityId != ''">
  88. and t.community_id= #{communityId}
  89. </if>
  90. order by t.create_time desc
  91. <if test="page != -1 and page != null ">
  92. limit #{page}, #{row}
  93. </if>
  94. </select>
  95. <!-- 修改巡检计划信息 add by wuxw 2018-07-03 -->
  96. <update id="updateInspectionPlanInfo" parameterType="Map">
  97. update inspection_plan t set t.status_cd = #{statusCd}
  98. <if test="newBId != null and newBId != ''">
  99. ,t.b_id = #{newBId}
  100. </if>
  101. <if test="inspectionPlanName !=null and inspectionPlanName != ''">
  102. , t.inspection_plan_name= #{inspectionPlanName}
  103. </if>
  104. <if test="canReexamine !=null and canReexamine != ''">
  105. , t.can_reexamine= #{canReexamine}
  106. </if>
  107. <if test="createUserId !=null and createUserId != ''">
  108. , t.create_user_id= #{createUserId}
  109. </if>
  110. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  111. , t.inspection_route_id= #{inspectionRouteId}
  112. </if>
  113. <if test="inspectionPlanPeriod !=null and inspectionPlanPeriod != ''">
  114. , t.inspection_plan_period= #{inspectionPlanPeriod}
  115. </if>
  116. <if test="remark !=null and remark != ''">
  117. , t.remark= #{remark}
  118. </if>
  119. <if test="createUserName !=null and createUserName != ''">
  120. , t.create_user_name= #{createUserName}
  121. </if>
  122. <if test="signType !=null and signType != ''">
  123. , t.sign_type= #{signType}
  124. </if>
  125. <if test="startTime !=null and startTime != ''">
  126. , t.start_time= #{startTime}
  127. </if>
  128. <if test="endTime !=null and endTime != ''">
  129. , t.end_time= #{endTime}
  130. </if>
  131. <if test="state !=null and state != ''">
  132. , t.state= #{state}
  133. </if>
  134. <if test="startDate !=null and startDate != ''">
  135. , t.start_date= #{startDate}
  136. </if>
  137. <if test="endDate !=null and endDate != ''">
  138. , t.end_date= #{endDate}
  139. </if>
  140. <if test="inspectionMonth !=null and inspectionMonth != ''">
  141. , t.inspection_month = #{inspectionMonth}
  142. </if>
  143. <if test="inspectionDay !=null and inspectionDay != ''">
  144. , t.inspection_day= #{inspectionDay}
  145. </if>
  146. <if test="inspectionWorkday !=null and inspectionWorkday != ''">
  147. ,t.inspection_workday= #{inspectionWorkday}
  148. </if>
  149. <if test="beforeTime !=null and beforeTime != ''">
  150. , t.before_time = #{beforeTime}
  151. </if>
  152. where 1=1
  153. <if test="inspectionPlanId !=null and inspectionPlanId != ''">
  154. and t.inspection_plan_id= #{inspectionPlanId}
  155. </if>
  156. <if test="communityId !=null and communityId != ''">
  157. and t.community_id= #{communityId}
  158. </if>
  159. </update>
  160. <!-- 查询巡检计划数量 add by wuxw 2018-07-03 -->
  161. <select id="queryInspectionPlansCount" parameterType="Map" resultType="Map">
  162. select count(1) count
  163. from inspection_plan t
  164. where 1 =1
  165. <if test="inspectionPlanName !=null and inspectionPlanName != ''">
  166. and t.inspection_plan_name= #{inspectionPlanName}
  167. </if>
  168. <if test="createUserId !=null and createUserId != ''">
  169. and t.create_user_id= #{createUserId}
  170. </if>
  171. <if test="canReexamine !=null and canReexamine != ''">
  172. and t.can_reexamine= #{canReexamine}
  173. </if>
  174. <if test="inspectionRouteId !=null and inspectionRouteId != ''">
  175. and t.inspection_route_id= #{inspectionRouteId}
  176. </if>
  177. <if test="inspectionPlanPeriod !=null and inspectionPlanPeriod != ''">
  178. and t.inspection_plan_period= #{inspectionPlanPeriod}
  179. </if>
  180. <if test="remark !=null and remark != ''">
  181. and t.remark= #{remark}
  182. </if>
  183. <if test="createUserName !=null and createUserName != ''">
  184. and t.create_user_name= #{createUserName}
  185. </if>
  186. <if test="statusCd !=null and statusCd != ''">
  187. and t.status_cd= #{statusCd}
  188. </if>
  189. <if test="signType !=null and signType != ''">
  190. and t.sign_type= #{signType}
  191. </if>
  192. <if test="startTime !=null and startTime != ''">
  193. and t.start_time= #{startTime}
  194. </if>
  195. <if test="inspectionPlanId !=null and inspectionPlanId != ''">
  196. and t.inspection_plan_id= #{inspectionPlanId}
  197. </if>
  198. <if test="endTime !=null and endTime != ''">
  199. and t.end_time= #{endTime}
  200. </if>
  201. <if test="startDate !=null and startDate != ''">
  202. and t.start_date= #{startDate}
  203. </if>
  204. <if test="endDate !=null and endDate != ''">
  205. and t.end_date= #{endDate}
  206. </if>
  207. <if test="state !=null and state != ''">
  208. and t.state= #{state}
  209. </if>
  210. <if test="communityId !=null and communityId != ''">
  211. and t.community_id= #{communityId}
  212. </if>
  213. <if test="beforeTime !=null and beforeTime != ''">
  214. and t.before_time = #{beforeTime}
  215. </if>
  216. </select>
  217. </mapper>