WorkTaskItemV1ServiceDaoImplMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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="workTaskItemV1ServiceDaoImpl">
  6. <!-- 保存工作任务明细信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveWorkTaskItemInfo" parameterType="Map">
  8. insert into work_task_item(
  9. deduction_person_id,finish_time,deduction_person_name,deduction_money,content_id,store_id,work_id,deduction_reason,item_id,state,community_id,task_id
  10. ) values (
  11. #{deductionPersonId},#{finishTime},#{deductionPersonName},#{deductionMoney},#{contentId},#{storeId},#{workId},#{deductionReason},#{itemId},#{state},
  12. #{communityId},#{taskId}
  13. )
  14. </insert>
  15. <!-- 查询工作任务明细信息 add by wuxw 2018-07-03 -->
  16. <select id="getWorkTaskItemInfo" parameterType="Map" resultType="Map">
  17. select t.deduction_person_id deductionPersonId,t.finish_time finishTime,t.deduction_person_name
  18. deductionPersonName,t.deduction_money deductionMoney,t.content_id contentId,t.status_cd statusCd,t.store_id
  19. storeId,t.work_id workId,t.deduction_reason deductionReason,t.item_id itemId,t.state,t.community_id
  20. communityId,t.task_id taskId,wpc.content,we.staff_name staffName,we.remark,t.create_time createTime,
  21. wpf.path_url pathUrl
  22. from work_task_item t
  23. left join work_pool_content wpc on t.content_id = wpc.content_id and wpc.status_cd = '0'
  24. left join work_event we on t.item_id = we.item_id and we.status_cd = '0' and we.event_type = '1001'
  25. left join work_pool_file wpf on t.item_id = wpf.item_id and wpf.status_cd = '0'
  26. where 1 =1
  27. <if test="deductionPersonId !=null and deductionPersonId != ''">
  28. and t.deduction_person_id= #{deductionPersonId}
  29. </if>
  30. <if test="finishTime !=null and finishTime != ''">
  31. and t.finish_time= #{finishTime}
  32. </if>
  33. <if test="deductionPersonName !=null and deductionPersonName != ''">
  34. and t.deduction_person_name= #{deductionPersonName}
  35. </if>
  36. <if test="deductionMoney !=null and deductionMoney != ''">
  37. and t.deduction_money= #{deductionMoney}
  38. </if>
  39. <if test="contentId !=null and contentId != ''">
  40. and t.content_id= #{contentId}
  41. </if>
  42. <if test="statusCd !=null and statusCd != ''">
  43. and t.status_cd= #{statusCd}
  44. </if>
  45. <if test="storeId !=null and storeId != ''">
  46. and t.store_id= #{storeId}
  47. </if>
  48. <if test="workId !=null and workId != ''">
  49. and t.work_id= #{workId}
  50. </if>
  51. <if test="deductionReason !=null and deductionReason != ''">
  52. and t.deduction_reason= #{deductionReason}
  53. </if>
  54. <if test="itemId !=null and itemId != ''">
  55. and t.item_id= #{itemId}
  56. </if>
  57. <if test="state !=null and state != ''">
  58. and t.state= #{state}
  59. </if>
  60. <if test="communityId !=null and communityId != ''">
  61. and t.community_id= #{communityId}
  62. </if>
  63. <if test="taskId !=null and taskId != ''">
  64. and t.task_id= #{taskId}
  65. </if>
  66. order by wpc.seq_num
  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="updateWorkTaskItemInfo" parameterType="Map">
  73. update work_task_item t set t.status_cd = #{statusCd}
  74. <if test="deductionPersonId !=null and deductionPersonId != ''">
  75. , t.deduction_person_id= #{deductionPersonId}
  76. </if>
  77. <if test="finishTime !=null and finishTime != ''">
  78. , t.finish_time= #{finishTime}
  79. </if>
  80. <if test="deductionPersonName !=null and deductionPersonName != ''">
  81. , t.deduction_person_name= #{deductionPersonName}
  82. </if>
  83. <if test="deductionMoney !=null and deductionMoney != ''">
  84. , t.deduction_money= #{deductionMoney}
  85. </if>
  86. <if test="deductionReason !=null and deductionReason != ''">
  87. , t.deduction_reason= #{deductionReason}
  88. </if>
  89. <if test="state !=null and state != ''">
  90. , t.state= #{state}
  91. </if>
  92. where 1=1
  93. <if test="itemId !=null and itemId != ''">
  94. and t.item_id= #{itemId}
  95. </if>
  96. <if test="contentId !=null and contentId != ''">
  97. and t.content_id= #{contentId}
  98. </if>
  99. <if test="storeId !=null and storeId != ''">
  100. and t.store_id= #{storeId}
  101. </if>
  102. <if test="communityId !=null and communityId != ''">
  103. and t.community_id= #{communityId}
  104. </if>
  105. <if test="taskId !=null and taskId != ''">
  106. and t.task_id= #{taskId}
  107. </if>
  108. <if test="workId !=null and workId != ''">
  109. and t.work_id= #{workId}
  110. </if>
  111. </update>
  112. <!-- 查询工作任务明细数量 add by wuxw 2018-07-03 -->
  113. <select id="queryWorkTaskItemsCount" parameterType="Map" resultType="Map">
  114. select count(1) count
  115. from work_task_item t
  116. where 1 =1
  117. <if test="deductionPersonId !=null and deductionPersonId != ''">
  118. and t.deduction_person_id= #{deductionPersonId}
  119. </if>
  120. <if test="finishTime !=null and finishTime != ''">
  121. and t.finish_time= #{finishTime}
  122. </if>
  123. <if test="deductionPersonName !=null and deductionPersonName != ''">
  124. and t.deduction_person_name= #{deductionPersonName}
  125. </if>
  126. <if test="deductionMoney !=null and deductionMoney != ''">
  127. and t.deduction_money= #{deductionMoney}
  128. </if>
  129. <if test="contentId !=null and contentId != ''">
  130. and t.content_id= #{contentId}
  131. </if>
  132. <if test="statusCd !=null and statusCd != ''">
  133. and t.status_cd= #{statusCd}
  134. </if>
  135. <if test="storeId !=null and storeId != ''">
  136. and t.store_id= #{storeId}
  137. </if>
  138. <if test="workId !=null and workId != ''">
  139. and t.work_id= #{workId}
  140. </if>
  141. <if test="deductionReason !=null and deductionReason != ''">
  142. and t.deduction_reason= #{deductionReason}
  143. </if>
  144. <if test="itemId !=null and itemId != ''">
  145. and t.item_id= #{itemId}
  146. </if>
  147. <if test="state !=null and state != ''">
  148. and t.state= #{state}
  149. </if>
  150. <if test="communityId !=null and communityId != ''">
  151. and t.community_id= #{communityId}
  152. </if>
  153. <if test="taskId !=null and taskId != ''">
  154. and t.task_id= #{taskId}
  155. </if>
  156. </select>
  157. </mapper>