TaskV1ServiceDaoImplMapper.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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="taskV1ServiceDaoImpl">
  6. <!-- 保存任务信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveTaskInfo" parameterType="Map">
  8. insert into task(
  9. task_cron,task_name,state,template_id,task_id
  10. ) values (
  11. #{taskCron},#{taskName},#{state},#{templateId},#{taskId}
  12. )
  13. </insert>
  14. <!-- 查询任务信息 add by wuxw 2018-07-03 -->
  15. <select id="getTaskInfo" parameterType="Map" resultType="Map">
  16. select t.task_cron,t.task_cron taskCron,t.task_name,t.task_name taskName,t.status_cd,t.status_cd
  17. statusCd,t.state,t.template_id,t.template_id templateId,t.task_id,t.task_id taskId,tt.class_bean classBean
  18. from task t
  19. left join task_template tt on t.template_id = tt.template_id and tt.status_cd = '0'
  20. where 1 =1
  21. <if test="taskCron !=null and taskCron != ''">
  22. and t.task_cron= #{taskCron}
  23. </if>
  24. <if test="taskName !=null and taskName != ''">
  25. and t.task_name= #{taskName}
  26. </if>
  27. <if test="statusCd !=null and statusCd != ''">
  28. and t.status_cd= #{statusCd}
  29. </if>
  30. <if test="state !=null and state != ''">
  31. and t.state= #{state}
  32. </if>
  33. <if test="templateId !=null and templateId != ''">
  34. and t.template_id= #{templateId}
  35. </if>
  36. <if test="taskId !=null and taskId != ''">
  37. and t.task_id= #{taskId}
  38. </if>
  39. order by t.create_time desc
  40. <if test="page != -1 and page != null ">
  41. limit #{page}, #{row}
  42. </if>
  43. </select>
  44. <!-- 修改任务信息 add by wuxw 2018-07-03 -->
  45. <update id="updateTaskInfo" parameterType="Map">
  46. update task t set t.status_cd = #{statusCd}
  47. <if test="newBId != null and newBId != ''">
  48. ,t.b_id = #{newBId}
  49. </if>
  50. <if test="taskCron !=null and taskCron != ''">
  51. , t.task_cron= #{taskCron}
  52. </if>
  53. <if test="taskName !=null and taskName != ''">
  54. , t.task_name= #{taskName}
  55. </if>
  56. <if test="state !=null and state != ''">
  57. , t.state= #{state}
  58. </if>
  59. <if test="templateId !=null and templateId != ''">
  60. , t.template_id= #{templateId}
  61. </if>
  62. where 1=1
  63. <if test="taskId !=null and taskId != ''">
  64. and t.task_id= #{taskId}
  65. </if>
  66. </update>
  67. <!-- 查询任务数量 add by wuxw 2018-07-03 -->
  68. <select id="queryTasksCount" parameterType="Map" resultType="Map">
  69. select count(1) count
  70. from task t
  71. where 1 =1
  72. <if test="taskCron !=null and taskCron != ''">
  73. and t.task_cron= #{taskCron}
  74. </if>
  75. <if test="taskName !=null and taskName != ''">
  76. and t.task_name= #{taskName}
  77. </if>
  78. <if test="statusCd !=null and statusCd != ''">
  79. and t.status_cd= #{statusCd}
  80. </if>
  81. <if test="state !=null and state != ''">
  82. and t.state= #{state}
  83. </if>
  84. <if test="templateId !=null and templateId != ''">
  85. and t.template_id= #{templateId}
  86. </if>
  87. <if test="taskId !=null and taskId != ''">
  88. and t.task_id= #{taskId}
  89. </if>
  90. </select>
  91. </mapper>