WmTaskSupervisionMapper.xml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.qunzhixinxi.hnqz.admin.mapper.WmTaskSupervisionMapper">
  5. <resultMap id="wmTaskSupervisionMap"
  6. type="com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSupervision">
  7. <result property="supervisionId" column="sup_id"/>
  8. <result property="taskId" column="task_id"/>
  9. <result property="packageId" column="pkg_id"/>
  10. <result property="supervisionResult" column="sup_res"/>
  11. <result property="supervisionState" column="sup_state"/>
  12. <result property="modifiable" column="modifiable"/>
  13. <result property="roleId" column="role_id"/>
  14. <result property="remarks" column="remarks"/>
  15. <result property="createBy" column="create_by"/>
  16. <result property="updateBy" column="update_by"/>
  17. <result property="createTime" column="create_time"/>
  18. <result property="updateTime" column="update_time"/>
  19. </resultMap>
  20. <select id="selectByPkgIds" resultMap="wmTaskSupervisionMap">
  21. SELECT
  22. sup_id,
  23. t.id task_id,
  24. t.score_package_id pkg_id,
  25. sup.sup_res,
  26. sup.sup_state,
  27. sup.modifiable,
  28. sup.role_id,
  29. sup.remarks,
  30. sup.create_by,
  31. sup.update_by,
  32. sup.create_time,
  33. sup.update_time
  34. FROM wm_task AS t
  35. JOIN (SELECT DISTINCT h.target_id
  36. FROM sys_chain_node_check_his h
  37. WHERE h.node_id = 6
  38. AND h.check_result = 1
  39. ) c ON c.target_id = t.id
  40. LEFT JOIN wm_task_sup AS sup ON sup.task_id = t.id
  41. LEFT JOIN ops_freeze_task f2099 ON f2099.target_id = t.id
  42. <where>
  43. t.del_flag = '0'
  44. AND t.task_status = '3'
  45. AND f2099.target_id is null
  46. <if test="pkgIds != null and pkgIds.size > 0">
  47. AND t.score_package_id IN
  48. <foreach collection="pkgIds" item="pid" open="(" close=")" separator=",">#{pid}</foreach>
  49. </if>
  50. </where>
  51. </select>
  52. </mapper>