TaskAttrServiceDaoImplMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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="taskAttrServiceDaoImpl">
  6. <!-- 保存定时任务属性信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessTaskAttrInfo" parameterType="Map">
  8. insert into business_task_attr(
  9. attr_id,operate,spec_cd,b_id,value,task_id
  10. ) values (
  11. #{attrId},#{operate},#{specCd},#{bId},#{value},#{taskId}
  12. )
  13. </insert>
  14. <!-- 查询定时任务属性信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessTaskAttrInfo" parameterType="Map" resultType="Map">
  16. select t.attr_id,t.attr_id attrId,t.operate,t.create_time,t.create_time createTime,t.spec_cd,t.spec_cd
  17. specCd,t.b_id,t.b_id bId,t.value,t.task_id,t.task_id taskId
  18. from business_task_attr t
  19. where 1 =1
  20. <if test="attrId !=null and attrId != ''">
  21. and t.attr_id= #{attrId}
  22. </if>
  23. <if test="operate !=null and operate != ''">
  24. and t.operate= #{operate}
  25. </if>
  26. <if test="createTime !=null">
  27. and t.create_time= #{createTime}
  28. </if>
  29. <if test="specCd !=null and specCd != ''">
  30. and t.spec_cd= #{specCd}
  31. </if>
  32. <if test="bId !=null and bId != ''">
  33. and t.b_id= #{bId}
  34. </if>
  35. <if test="value !=null and value != ''">
  36. and t.value= #{value}
  37. </if>
  38. <if test="taskId !=null and taskId != ''">
  39. and t.task_id= #{taskId}
  40. </if>
  41. </select>
  42. <!-- 保存定时任务属性信息至 instance表中 add by wuxw 2018-07-03 -->
  43. <insert id="saveTaskAttrInfoInstance" parameterType="Map">
  44. insert into task_attr(
  45. attr_id,create_time,spec_cd,status_cd,b_id,value,task_id
  46. ) select t.attr_id,t.create_time,t.spec_cd,'0',t.b_id,t.value,t.task_id from business_task_attr t where 1=1
  47. <if test="attrId !=null and attrId != ''">
  48. and t.attr_id= #{attrId}
  49. </if>
  50. and t.operate= 'ADD'
  51. <if test="createTime !=null ">
  52. and t.create_time= #{createTime}
  53. </if>
  54. <if test="specCd !=null and specCd != ''">
  55. and t.spec_cd= #{specCd}
  56. </if>
  57. <if test="bId !=null and bId != ''">
  58. and t.b_id= #{bId}
  59. </if>
  60. <if test="value !=null and value != ''">
  61. and t.value= #{value}
  62. </if>
  63. <if test="taskId !=null and taskId != ''">
  64. and t.task_id= #{taskId}
  65. </if>
  66. </insert>
  67. <!-- 查询定时任务属性信息 add by wuxw 2018-07-03 -->
  68. <select id="getTaskAttrInfo" parameterType="Map" resultType="Map">
  69. select t.attr_id,t.attr_id attrId,t.create_time,t.create_time createTime,t.spec_cd,t.spec_cd
  70. specCd,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.value,t.task_id,t.task_id taskId
  71. from task_attr t
  72. where 1 =1
  73. <if test="attrId !=null and attrId != ''">
  74. and t.attr_id= #{attrId}
  75. </if>
  76. <if test="createTime !=null">
  77. and t.create_time= #{createTime}
  78. </if>
  79. <if test="specCd !=null and specCd != ''">
  80. and t.spec_cd= #{specCd}
  81. </if>
  82. <if test="statusCd !=null and statusCd != ''">
  83. and t.status_cd= #{statusCd}
  84. </if>
  85. <if test="bId !=null and bId != ''">
  86. and t.b_id= #{bId}
  87. </if>
  88. <if test="value !=null and value != ''">
  89. and t.value= #{value}
  90. </if>
  91. <if test="taskId !=null and taskId != ''">
  92. and t.task_id= #{taskId}
  93. </if>
  94. order by t.create_time desc
  95. <if test="page != -1 and page != null ">
  96. limit #{page}, #{row}
  97. </if>
  98. </select>
  99. <!-- 修改定时任务属性信息 add by wuxw 2018-07-03 -->
  100. <update id="updateTaskAttrInfoInstance" parameterType="Map">
  101. update task_attr t set t.status_cd = #{statusCd}
  102. <if test="newBId != null and newBId != ''">
  103. ,t.b_id = #{newBId}
  104. </if>
  105. <if test="specCd !=null and specCd != ''">
  106. , t.spec_cd= #{specCd}
  107. </if>
  108. <if test="value !=null and value != ''">
  109. , t.value= #{value}
  110. </if>
  111. <if test="taskId !=null and taskId != ''">
  112. , t.task_id= #{taskId}
  113. </if>
  114. where 1=1
  115. <if test="attrId !=null and attrId != ''">
  116. and t.attr_id= #{attrId}
  117. </if>
  118. <if test="bId !=null and bId != ''">
  119. and t.b_id= #{bId}
  120. </if>
  121. </update>
  122. <!-- 查询定时任务属性数量 add by wuxw 2018-07-03 -->
  123. <select id="queryTaskAttrsCount" parameterType="Map" resultType="Map">
  124. select count(1) count
  125. from task_attr t
  126. where 1 =1
  127. <if test="attrId !=null and attrId != ''">
  128. and t.attr_id= #{attrId}
  129. </if>
  130. <if test="createTime !=null">
  131. and t.create_time= #{createTime}
  132. </if>
  133. <if test="specCd !=null and specCd != ''">
  134. and t.spec_cd= #{specCd}
  135. </if>
  136. <if test="statusCd !=null and statusCd != ''">
  137. and t.status_cd= #{statusCd}
  138. </if>
  139. <if test="bId !=null and bId != ''">
  140. and t.b_id= #{bId}
  141. </if>
  142. <if test="value !=null and value != ''">
  143. and t.value= #{value}
  144. </if>
  145. <if test="taskId !=null and taskId != ''">
  146. and t.task_id= #{taskId}
  147. </if>
  148. </select>
  149. </mapper>