TaskMapper.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.wtkj.mapper.TaskMapper">
  4. <select id="selectByExecute" resultType="com.wtkj.entity.Task">
  5. select * from blade_task where is_deleted = 0
  6. <if test="param1 != null">
  7. and org_dept_id = #{param1}
  8. </if>
  9. <if test="param2 != null">
  10. and execute_user like concat(concat('%',#{param2}),'%')
  11. </if>
  12. </select>
  13. <select id="todayTo" resultType="com.wtkj.entity.Task">
  14. select * from blade_task where is_deleted = 0 and execute_user like concat(concat('%',#{param1}),'%')
  15. and
  16. DATE_FORMAT(end_time,'%Y-%m-%d') = DATE_FORMAT(#{param2},'%Y-%m-%d') and task_status != 4 and task_status != 5
  17. order by create_time
  18. </select>
  19. <select id="todayExpire" resultType="com.wtkj.entity.Task">
  20. select * from blade_task where is_deleted = 0 and execute_user like concat(concat('%',#{param1}),'%')
  21. and
  22. DATE_FORMAT(#{param2},'%Y-%m-%d') > DATE_FORMAT(end_time,'%Y-%m-%d') and task_status != 4 and task_status != 5
  23. order by create_time
  24. </select>
  25. <select id="getTodoAndExpireByUserId" resultType="com.wtkj.entity.Task">
  26. select * from blade_task where is_deleted = 0 and execute_user like concat(concat('%',#{param1}),'%')
  27. and
  28. DATE_FORMAT(#{param2},'%Y-%m-%d') >= DATE_FORMAT(end_time,'%Y-%m-%d') and task_status != 4 and task_status != 5
  29. order by create_time
  30. </select>
  31. <select id="getByDeptAndDate" resultType="com.wtkj.entity.Task">
  32. select * from blade_task where is_deleted = 0
  33. <if test="param1 != null">
  34. and org_dept_id = #{param1}
  35. </if>
  36. <if test="param2 != null">
  37. and execute_dept = #{param2}
  38. </if>
  39. <if test="param3 != null">
  40. and execute_user like concat(concat('%',#{param3}),'%')
  41. </if>
  42. <if test="param4 != null">
  43. and DATE_FORMAT(#{param4},'%Y-%m-%d') >= DATE_FORMAT(end_time,'%Y-%m-%d') and task_status != 4 and
  44. task_status != 5
  45. </if>
  46. order by create_time
  47. </select>
  48. <select id="getByExecuteDept" resultType="com.wtkj.entity.Task">
  49. select * from blade_task where is_deleted = 0 and execute_dept = #{param}
  50. order by create_time
  51. </select>
  52. <select id="selectByCompetentUnit" resultType="com.wtkj.entity.Task">
  53. select * from blade_task where is_deleted = 0 and competent_unit = #{param}
  54. order by create_time
  55. </select>
  56. <select id="getTodayTodoByOrgDeptId" resultType="com.wtkj.entity.Task">
  57. select * from blade_task where is_deleted = 0 and org_dept_id = #{param1} and
  58. DATE_FORMAT(#{param2},'%Y-%m-%d') = DATE_FORMAT(end_time,'%Y-%m-%d') and task_status != 4 and task_status != 5
  59. order by create_time
  60. </select>
  61. <select id="getTodoByYear" resultType="com.wtkj.entity.Task">
  62. select * from blade_task where is_deleted = 0 and year = #{param2} and task_status != 4 and task_status != 5 and
  63. task_status != 6 and
  64. project_id in
  65. <foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
  66. #{item}
  67. </foreach>
  68. </select>
  69. <select id="selectLeftByDateAndStage" resultType="com.wtkj.entity.Task">
  70. select * from blade_task where is_deleted = 0 and stage_id = #{param1} and
  71. DATE_FORMAT(#{param2},'%Y-%m-%d') = DATE_FORMAT(end_time,'%Y-%m-%d') and task_status != 4 and task_status != 5
  72. </select>
  73. <select id="selectByDateAndStageAndStatus" resultType="com.wtkj.entity.Task">
  74. select * from blade_task where is_deleted = 0 and stage_id = #{param1} and
  75. DATE_FORMAT(#{param2},'%Y-%m-%d') = DATE_FORMAT(end_time,'%Y-%m-%d') and task_status = #{param3}
  76. </select>
  77. <select id="selectCurrentDateCompleteByStageAndDate" resultType="com.wtkj.entity.Task">
  78. select * from blade_task where is_deleted = 0 and stage_id = #{param1} and
  79. DATE_FORMAT(#{param2},'%Y-%m-%d') = DATE_FORMAT(confirm_time,'%Y-%m-%d')
  80. <if test="param3 != null">
  81. and task_status = #{param3}
  82. </if>
  83. </select>
  84. <select id="getTodayToExpire" resultType="com.wtkj.entity.Task">
  85. select * from blade_task where is_deleted = 0 and
  86. DATE_FORMAT(#{param},'%Y-%m-%d') > DATE_FORMAT(end_time,'%Y-%m-%d') and task_status != 4 and task_status != 5
  87. and task_status != 6
  88. </select>
  89. <select id="selectByTaskStatus" resultType="com.wtkj.entity.Task">
  90. select * from blade_task where is_deleted = 0 and task_status = #{param}
  91. </select>
  92. <select id="getByProjectId" resultType="com.wtkj.entity.Task">
  93. select * from blade_task where is_deleted = 0 and project_id = #{param}
  94. </select>
  95. </mapper>