RoutingInspectionMapper.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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="org.springblade.manager.mapper.RoutingInspectionMapper">
  4. <select id="page" resultType="org.springblade.manager.vo.RoutingInspectionVO">
  5. select mri.*,
  6. (select project_name from m_project_info where id = mri.project_id) as projectName,
  7. (select dict_value from blade_dict where code = 'inspect_type' and dict_key = mri.inspect_type) as inspectTypeName,
  8. (select dict_value from blade_dict where code = 'review_inspect_status' and dict_key = mri.review_inspect_status) as reviewInspectStatusName,
  9. case mri.is_rectify
  10. when 1 then '需要'
  11. when 2 then '不需要'
  12. when 3 then '已整改'
  13. end as isRectifyName
  14. from m_routing_inspection mri
  15. where mri.is_deleted = 0 and mri.project_id = #{inspection.projectId} and contract_id = #{inspection.contractId}
  16. <if test="inspection.isRectify != null and inspection.isRectify != ''">
  17. and mri.is_rectify = #{inspection.isRectify}
  18. </if>
  19. order by mri.create_time desc
  20. </select>
  21. <select id="getAllBuildId" resultType="java.lang.Long">
  22. select contract_id_sg from m_contract_relation_jlyz WHERE contract_id_jlyz = #{id}
  23. </select>
  24. <select id="page2" resultType="org.springblade.manager.vo.RoutingInspectionVO">
  25. select mri.*,
  26. (select project_name from m_project_info where id = mri.project_id) as projectName,
  27. (select dict_value from blade_dict where code = 'inspect_type' and dict_key = mri.inspect_type) as inspectTypeName,
  28. (select dict_value from blade_dict where code = 'review_inspect_status' and dict_key = mri.review_inspect_status) as reviewInspectStatusName,
  29. case mri.is_rectify
  30. when 1 then '需要'
  31. when 2 then '不需要'
  32. when 3 then '已整改'
  33. end as isRectifyName
  34. from m_routing_inspection mri
  35. where mri.is_deleted = 0 and mri.project_id = #{inspection.projectId} and contract_id in
  36. <foreach collection="ids" item="id" open="(" close=")" separator=",">
  37. #{id}
  38. </foreach>
  39. <if test="inspection.isRectify != null and inspection.isRectify != ''">
  40. and mri.is_rectify = #{inspection.isRectify}
  41. </if>
  42. order by mri.create_time desc
  43. </select>
  44. </mapper>