MaintainancePlanStaffV1ServiceDaoImplMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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="maintainancePlanStaffV1ServiceDaoImpl">
  6. <!-- 保存保养计划员工信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveMaintainancePlanStaffInfo" parameterType="Map">
  8. insert into maintainance_plan_staff(
  9. staff_name,plan_id,community_id,staff_id,mps_id
  10. ) values (
  11. #{staffName},#{planId},#{communityId},#{staffId},#{mpsId}
  12. )
  13. </insert>
  14. <!-- 查询保养计划员工信息 add by wuxw 2018-07-03 -->
  15. <select id="getMaintainancePlanStaffInfo" parameterType="Map" resultType="Map">
  16. select t.staff_name,t.staff_name staffName,t.plan_id,t.plan_id planId,t.community_id,t.community_id
  17. communityId,t.staff_id,t.staff_id staffId,t.mps_id,t.mps_id mpsId
  18. from maintainance_plan_staff t
  19. where 1 =1
  20. and t.status_cd = '0'
  21. <if test="staffName !=null and staffName != ''">
  22. and t.staff_name= #{staffName}
  23. </if>
  24. <if test="planId !=null and planId != ''">
  25. and t.plan_id= #{planId}
  26. </if>
  27. <if test="communityId !=null and communityId != ''">
  28. and t.community_id= #{communityId}
  29. </if>
  30. <if test="staffId !=null and staffId != ''">
  31. and t.staff_id= #{staffId}
  32. </if>
  33. <if test="mpsId !=null and mpsId != ''">
  34. and t.mps_id= #{mpsId}
  35. </if>
  36. order by t.create_time desc
  37. <if test="page != -1 and page != null ">
  38. limit #{page}, #{row}
  39. </if>
  40. </select>
  41. <!-- 修改保养计划员工信息 add by wuxw 2018-07-03 -->
  42. <update id="updateMaintainancePlanStaffInfo" parameterType="Map">
  43. update maintainance_plan_staff t set t.status_cd = #{statusCd}
  44. <if test="newBId != null and newBId != ''">
  45. ,t.b_id = #{newBId}
  46. </if>
  47. <if test="staffName !=null and staffName != ''">
  48. , t.staff_name= #{staffName}
  49. </if>
  50. <if test="staffId !=null and staffId != ''">
  51. , t.staff_id= #{staffId}
  52. </if>
  53. where 1=1
  54. <if test="mpsId !=null and mpsId != ''">
  55. and t.mps_id= #{mpsId}
  56. </if>
  57. <if test="planId !=null and planId != ''">
  58. and t.plan_id= #{planId}
  59. </if>
  60. <if test="communityId !=null and communityId != ''">
  61. and t.community_id= #{communityId}
  62. </if>
  63. </update>
  64. <!-- 查询保养计划员工数量 add by wuxw 2018-07-03 -->
  65. <select id="queryMaintainancePlanStaffsCount" parameterType="Map" resultType="Map">
  66. select count(1) count
  67. from maintainance_plan_staff t
  68. where 1 =1
  69. and t.status_cd = '0'
  70. <if test="staffName !=null and staffName != ''">
  71. and t.staff_name= #{staffName}
  72. </if>
  73. <if test="planId !=null and planId != ''">
  74. and t.plan_id= #{planId}
  75. </if>
  76. <if test="communityId !=null and communityId != ''">
  77. and t.community_id= #{communityId}
  78. </if>
  79. <if test="staffId !=null and staffId != ''">
  80. and t.staff_id= #{staffId}
  81. </if>
  82. <if test="mpsId !=null and mpsId != ''">
  83. and t.mps_id= #{mpsId}
  84. </if>
  85. </select>
  86. <select id="queryMaintainancePlanStaffsGroupCount" parameterType="Map" resultType="Map">
  87. select t.plan_id planId,count(1) staffCount
  88. from maintainance_plan_staff t
  89. where 1 =1
  90. and t.status_cd = '0'
  91. <if test="planIds !=null ">
  92. and t.plan_id in
  93. <foreach collection="planIds" item="item" open="(" close=")" separator=",">
  94. #{item}
  95. </foreach>
  96. </if>
  97. <if test="communityId !=null and communityId != ''">
  98. and t.community_id= #{communityId}
  99. </if>
  100. </select>
  101. </mapper>