InspectionPlanStaffV1ServiceDaoImplMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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="inspectionPlanStaffV1ServiceDaoImpl">
  6. <!-- 保存巡检人信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveInspectionPlanStaffInfo" parameterType="Map">
  8. insert into inspection_plan_staff(
  9. ip_staff_id,staff_name,start_time,inspection_plan_id,end_time,community_id,staff_id
  10. ) values (
  11. #{ipStaffId},#{staffName},#{startTime},#{inspectionPlanId},#{endTime},#{communityId},#{staffId}
  12. )
  13. </insert>
  14. <!-- 查询巡检人信息 add by wuxw 2018-07-03 -->
  15. <select id="getInspectionPlanStaffInfo" parameterType="Map" resultType="Map">
  16. select t.ip_staff_id,t.ip_staff_id ipStaffId,t.staff_name,t.staff_name staffName,t.start_time,t.start_time
  17. startTime,t.inspection_plan_id,t.inspection_plan_id inspectionPlanId,t.end_time,t.end_time
  18. endTime,t.community_id,t.community_id communityId,t.staff_id,t.staff_id staffId
  19. from inspection_plan_staff t
  20. where 1 =1
  21. <if test="ipStaffId !=null and ipStaffId != ''">
  22. and t.ip_staff_id= #{ipStaffId}
  23. </if>
  24. <if test="staffName !=null and staffName != ''">
  25. and t.staff_name= #{staffName}
  26. </if>
  27. <if test="startTime !=null and startTime != ''">
  28. and t.start_time= #{startTime}
  29. </if>
  30. <if test="inspectionPlanId !=null and inspectionPlanId != ''">
  31. and t.inspection_plan_id= #{inspectionPlanId}
  32. </if>
  33. <if test="endTime !=null and endTime != ''">
  34. and t.end_time= #{endTime}
  35. </if>
  36. <if test="communityId !=null and communityId != ''">
  37. and t.community_id= #{communityId}
  38. </if>
  39. <if test="staffId !=null and staffId != ''">
  40. and t.staff_id= #{staffId}
  41. </if>
  42. order by t.create_time desc
  43. <if test="page != -1 and page != null ">
  44. limit #{page}, #{row}
  45. </if>
  46. </select>
  47. <!-- 修改巡检人信息 add by wuxw 2018-07-03 -->
  48. <update id="updateInspectionPlanStaffInfo" parameterType="Map">
  49. update inspection_plan_staff t set t.status_cd = #{statusCd}
  50. <if test="newBId != null and newBId != ''">
  51. ,t.b_id = #{newBId}
  52. </if>
  53. <if test="staffName !=null and staffName != ''">
  54. , t.staff_name= #{staffName}
  55. </if>
  56. <if test="startTime !=null and startTime != ''">
  57. , t.start_time= #{startTime}
  58. </if>
  59. <if test="endTime !=null and endTime != ''">
  60. , t.end_time= #{endTime}
  61. </if>
  62. <if test="staffId !=null and staffId != ''">
  63. , t.staff_id= #{staffId}
  64. </if>
  65. where 1=1
  66. <if test="ipStaffId !=null and ipStaffId != ''">
  67. and t.ip_staff_id= #{ipStaffId}
  68. </if>
  69. <if test="inspectionPlanId !=null and inspectionPlanId != ''">
  70. and t.inspection_plan_id= #{inspectionPlanId}
  71. </if>
  72. <if test="communityId !=null and communityId != ''">
  73. and t.community_id= #{communityId}
  74. </if>
  75. </update>
  76. <!-- 查询巡检人数量 add by wuxw 2018-07-03 -->
  77. <select id="queryInspectionPlanStaffsCount" parameterType="Map" resultType="Map">
  78. select count(1) count
  79. from inspection_plan_staff t
  80. where 1 =1
  81. <if test="ipStaffId !=null and ipStaffId != ''">
  82. and t.ip_staff_id= #{ipStaffId}
  83. </if>
  84. <if test="staffName !=null and staffName != ''">
  85. and t.staff_name= #{staffName}
  86. </if>
  87. <if test="startTime !=null and startTime != ''">
  88. and t.start_time= #{startTime}
  89. </if>
  90. <if test="inspectionPlanId !=null and inspectionPlanId != ''">
  91. and t.inspection_plan_id= #{inspectionPlanId}
  92. </if>
  93. <if test="endTime !=null and endTime != ''">
  94. and t.end_time= #{endTime}
  95. </if>
  96. <if test="communityId !=null and communityId != ''">
  97. and t.community_id= #{communityId}
  98. </if>
  99. <if test="staffId !=null and staffId != ''">
  100. and t.staff_id= #{staffId}
  101. </if>
  102. </select>
  103. </mapper>