WorkEventV1ServiceDaoImplMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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="workEventV1ServiceDaoImpl">
  6. <!-- 保存工作单事件信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveWorkEventInfo" parameterType="Map">
  8. insert into work_event(
  9. event_id,pre_staff_name,pre_staff_id,staff_name,remark,community_id,store_id,task_id,work_id,staff_id
  10. ) values (
  11. #{eventId},#{preStaffName},#{preStaffId},#{staffName},#{remark},#{communityId},#{storeId},#{taskId},#{workId},#{staffId}
  12. )
  13. </insert>
  14. <!-- 查询工作单事件信息 add by wuxw 2018-07-03 -->
  15. <select id="getWorkEventInfo" parameterType="Map" resultType="Map">
  16. select t.event_id,t.event_id eventId,t.pre_staff_name,t.pre_staff_name
  17. preStaffName,t.pre_staff_id,t.pre_staff_id preStaffId,t.staff_name,t.staff_name
  18. staffName,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id
  19. communityId,t.store_id,t.store_id storeId,t.task_id,t.task_id taskId,t.work_id,t.work_id
  20. workId,t.staff_id,t.staff_id staffId,t.create_time createTime,wt.start_time startTime,wt.end_time endTime
  21. from work_event t
  22. left join work_task wt on t.task_id = wt.task_id
  23. where 1 =1
  24. <if test="eventId !=null and eventId != ''">
  25. and t.event_id= #{eventId}
  26. </if>
  27. <if test="preStaffName !=null and preStaffName != ''">
  28. and t.pre_staff_name= #{preStaffName}
  29. </if>
  30. <if test="preStaffId !=null and preStaffId != ''">
  31. and t.pre_staff_id= #{preStaffId}
  32. </if>
  33. <if test="staffName !=null and staffName != ''">
  34. and t.staff_name= #{staffName}
  35. </if>
  36. <if test="staffNameLike !=null and staffNameLike != ''">
  37. and t.staff_name like concat('%', #{staffNameLike},'%')
  38. </if>
  39. <if test="remark !=null and remark != ''">
  40. and t.remark= #{remark}
  41. </if>
  42. <if test="statusCd !=null and statusCd != ''">
  43. and t.status_cd= #{statusCd}
  44. </if>
  45. <if test="communityId !=null and communityId != ''">
  46. and t.community_id= #{communityId}
  47. </if>
  48. <if test="storeId !=null and storeId != ''">
  49. and t.store_id= #{storeId}
  50. </if>
  51. <if test="taskId !=null and taskId != ''">
  52. and t.task_id= #{taskId}
  53. </if>
  54. <if test="workId !=null and workId != ''">
  55. and t.work_id= #{workId}
  56. </if>
  57. <if test="staffId !=null and staffId != ''">
  58. and t.staff_id= #{staffId}
  59. </if>
  60. <if test="queryStartTime !=null and queryStartTime != ''">
  61. and t.create_time &gt; #{queryStartTime}
  62. </if>
  63. <if test="queryEndTime !=null and queryEndTime != ''">
  64. and t.create_time &lt; #{queryEndTime}
  65. </if>
  66. order by t.create_time desc
  67. <if test="page != -1 and page != null ">
  68. limit #{page}, #{row}
  69. </if>
  70. </select>
  71. <!-- 修改工作单事件信息 add by wuxw 2018-07-03 -->
  72. <update id="updateWorkEventInfo" parameterType="Map">
  73. update work_event t set t.status_cd = #{statusCd}
  74. <if test="newBId != null and newBId != ''">
  75. ,t.b_id = #{newBId}
  76. </if>
  77. <if test="preStaffName !=null and preStaffName != ''">
  78. , t.pre_staff_name= #{preStaffName}
  79. </if>
  80. <if test="preStaffId !=null and preStaffId != ''">
  81. , t.pre_staff_id= #{preStaffId}
  82. </if>
  83. <if test="staffName !=null and staffName != ''">
  84. , t.staff_name= #{staffName}
  85. </if>
  86. <if test="remark !=null and remark != ''">
  87. , t.remark= #{remark}
  88. </if>
  89. <if test="taskId !=null and taskId != ''">
  90. , t.task_id= #{taskId}
  91. </if>
  92. <if test="workId !=null and workId != ''">
  93. , t.work_id= #{workId}
  94. </if>
  95. <if test="staffId !=null and staffId != ''">
  96. , t.staff_id= #{staffId}
  97. </if>
  98. where 1=1
  99. <if test="eventId !=null and eventId != ''">
  100. and t.event_id= #{eventId}
  101. </if>
  102. <if test="communityId !=null and communityId != ''">
  103. and t.community_id= #{communityId}
  104. </if>
  105. <if test="storeId !=null and storeId != ''">
  106. and t.store_id= #{storeId}
  107. </if>
  108. </update>
  109. <!-- 查询工作单事件数量 add by wuxw 2018-07-03 -->
  110. <select id="queryWorkEventsCount" parameterType="Map" resultType="Map">
  111. select count(1) count
  112. from work_event t
  113. where 1 =1
  114. <if test="eventId !=null and eventId != ''">
  115. and t.event_id= #{eventId}
  116. </if>
  117. <if test="preStaffName !=null and preStaffName != ''">
  118. and t.pre_staff_name= #{preStaffName}
  119. </if>
  120. <if test="preStaffId !=null and preStaffId != ''">
  121. and t.pre_staff_id= #{preStaffId}
  122. </if>
  123. <if test="staffName !=null and staffName != ''">
  124. and t.staff_name= #{staffName}
  125. </if>
  126. <if test="staffNameLike !=null and staffNameLike != ''">
  127. and t.staff_name like concat('%', #{staffNameLike},'%')
  128. </if>
  129. <if test="remark !=null and remark != ''">
  130. and t.remark= #{remark}
  131. </if>
  132. <if test="statusCd !=null and statusCd != ''">
  133. and t.status_cd= #{statusCd}
  134. </if>
  135. <if test="communityId !=null and communityId != ''">
  136. and t.community_id= #{communityId}
  137. </if>
  138. <if test="storeId !=null and storeId != ''">
  139. and t.store_id= #{storeId}
  140. </if>
  141. <if test="taskId !=null and taskId != ''">
  142. and t.task_id= #{taskId}
  143. </if>
  144. <if test="workId !=null and workId != ''">
  145. and t.work_id= #{workId}
  146. </if>
  147. <if test="staffId !=null and staffId != ''">
  148. and t.staff_id= #{staffId}
  149. </if>
  150. <if test="queryStartTime !=null and queryStartTime != ''">
  151. and t.create_time &gt; #{queryStartTime}
  152. </if>
  153. <if test="queryEndTime !=null and queryEndTime != ''">
  154. and t.create_time &lt; #{queryEndTime}
  155. </if>
  156. </select>
  157. </mapper>