You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3490 lines
149 KiB

3 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
2 years ago
1 year ago
2 years ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
1 year ago
​
​
1 year ago
​
​
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
1 year ago
1 year ago
​
10 months ago
​
1 year ago
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
10 months ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
10 months ago
​
​
1 year ago
​
1 year ago
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
10 months ago
1 year ago
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
1 year ago
​
​
​
1 year ago
​
​
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
1 year ago
​
​
​
​
1 year ago
1 year ago
3 years ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
1 year ago
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
3 years ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
1 year ago
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
1 year ago
​
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
1 year ago
​
​
​
1 year ago
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
1 year ago
​
​
1 year ago
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
1 year ago
​
​
​
​
1 year ago
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
1 year ago
1 year ago
​
​
1 year ago
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
1 year ago
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
2 years ago
1 year ago
​
​
​
​
2 years ago
1 year ago
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
2 years ago
1 year ago
2 years ago
2 years ago
​
​
​
​
​
​
​
​
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
​
​
1 year ago
​
2 years ago
​
​
2 years ago
​
2 years ago
1 year ago
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
2 years ago
​
​
1 year ago
​
1 year ago
1 year ago
​
​
​
​
​
2 years ago
1 year ago
​
​
​
​
​
1 year ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
1 year ago
​
1 year ago
2 years ago
​
​
2 years ago
​
1 year ago
​
2 years ago
1 year ago
2 years ago
2 years ago
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
2 years ago
​
​
​
​
1 year ago
2 years ago
1 year ago
​
​
2 years ago
​
1 year ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
1 year ago
2 years ago
​
​
1 year ago
​
2 years ago
​
1 year ago
​
2 years ago
1 year ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
2 years ago
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
1 year ago
​
​
2 years ago
​
​
​
​
​
​
1 year ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
2 years ago
​
1 year ago
2 years ago
1 year ago
2 years ago
​
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
1 year ago
​
​
1 year ago
1 year ago
1 year ago
1 year ago
​
​
1 year ago
​
1 year ago
1 year ago
​
1 year ago
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
1 year ago
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
1 year ago
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
1 year ago
​
1 year ago
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
1 year ago
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
1 year ago
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
​
​
1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 year ago
​
3 years ago
  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.spring.modules.sampleManagement.dao.TechnicalSpecificationMapper">
  4. <resultMap id="getTechnicalSpecificationSheetData" type="PlmTechnicalSpecificationSheetData">
  5. <result column="id" property="id"/>
  6. <result column="site" property="site"/>
  7. <result column="code_no" property="codeNo"/>
  8. <result column="project_id" property="projectId"/>
  9. <result column="test_part_no" property="testPartNo"/>
  10. <result column="status" property="status"/>
  11. <result column="rev_no" property="revNo"/>
  12. <result column="work_center_no" property="workCenterNo"/>
  13. <result column="ECN_flag" property="ecnFlag"/>
  14. <result column="ECN_no" property="ecnNo"/>
  15. <result column="ori_code_no" property="oriCodeNo"/>
  16. <result column="ECN_address" property="ecnAddress"/>
  17. <result column="remark" property="remark"/>
  18. <result column="create_date" property="createDate"/>
  19. <result column="create_by" property="createBy"/>
  20. <result column="update_date" property="updateDate"/>
  21. <result column="update_by" property="updateBy"/>
  22. <result column="final_part_no" property="finalPartNo"/>
  23. <result column="partTypeDesc" property="partTypeDesc"/>
  24. <result column="partType" property="partType"/>
  25. <result column="part_name" property="partName"/>
  26. <result column="part_desc" property="partDesc"/>
  27. <result column="part_spec" property="partSpec"/>
  28. <result column="statusDesc" property="statusDesc"/>
  29. <result column="proofing_no" property="proofingNo"/>
  30. <result column="bu_no" property="buNo"/>
  31. <result column="buDesc" property="buDesc"/>
  32. <result column="engineer" property="engineer"/>
  33. <result column="technician" property="technician"/>
  34. <result column="process" property="process"/>
  35. <result column="quotationOfficer" property="quotationOfficer"/>
  36. <result column="engineerNo" property="engineerNo"/>
  37. <result column="technicianNo" property="technicianNo"/>
  38. <result column="customer_Id" property="customerId"/>
  39. <result column="picture_addess" property="pictureAddess"/>
  40. <result column="customerPictureChangeRemark" property="customerPictureChangeRemark"/>
  41. <result column="productionFileComments" property="productionFileComments"/>
  42. <result column="bom_type" property="bomType"/>
  43. <result column="eng_chg_level" property="engChgLevel"/>
  44. <result column="bom_alternative_no" property="bomAlternativeNo"/>
  45. <result column="routing_type" property="routingType"/>
  46. <result column="routing_revision" property="routingRevision"/>
  47. <result column="routing_alternative_no" property="routingAlternativeNo"/>
  48. <result column="pod" property="pod"/>
  49. <result column="mpOperator" property="mpOperator"/>
  50. <result column="mpOperatorName" property="mpOperatorName"/>
  51. <result column="cqcOperator" property="cqcOperator"/>
  52. <result column="cqcOperatorName" property="cqcOperatorName"/>
  53. <result column="faiOperator" property="faiOperator"/>
  54. <result column="faiOperatorName" property="faiOperatorName"/>
  55. <result column="peOperater" property="peOperater"/>
  56. <result column="peOperaterName" property="peOperaterName"/>
  57. <result column="csOperater" property="csOperater"/>
  58. <result column="dccOperater" property="dccOperater"/>
  59. <result column="dccOperaterName" property="dccOperaterName"/>
  60. <result column="is_reject" property="isReject"/>
  61. <result column="node_id" property="nodeId"/>
  62. <result column="node_name" property="nodeName"/>
  63. <result column="customer_part_no" property="customerPartNo"/>
  64. <result column="sp" property="sp"/>
  65. <result column="remarkPage" property="remarkPage"/>
  66. <result column="rev" property="rev"/>
  67. <result column="customer_rev" property="customerRev"/>
  68. <result column="plm_part_no" property="plmPartNo"/>
  69. <result column="project_name" property="projectName"/>
  70. </resultMap>
  71. <select id="technicalSpecificationListSearch" parameterType="PlmTechnicalSpecificationSheetData" resultType="PlmTechnicalSpecificationSheetData">
  72. SELECT a.id,
  73. a.site,
  74. a.code_no as codeNo,
  75. a.project_id as projectId,
  76. a.test_part_no as testPartNo,
  77. a.status,
  78. a.rev_no as revNo,
  79. a.work_center_no as workCenterNo,
  80. a.ECN_flag as ecnFlag,
  81. a.ECN_no as ecnNo,
  82. a.ori_code_no as oriCodeNo,
  83. a.ECN_address as ecnAddress,
  84. a.remark,
  85. a.create_date as createDate,
  86. a.create_by as createBy,
  87. a.update_date as updateDate,
  88. a.update_by as updateBy,
  89. b.final_part_no as finalPartNo,
  90. b.part_type as partTypeDesc,
  91. b.part_type as partType,
  92. b.part_name as partName,
  93. b.part_desc as partDesc,
  94. b.part_spec as partSpec,
  95. dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
  96. a.proofing_no as proofingNo,
  97. b.bu_no as buNo,
  98. dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
  99. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') as engineer,
  100. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') as technician,
  101. process,
  102. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') as quotationOfficer,
  103. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') as engineerNo,
  104. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') as technicianNo,
  105. c.customer_Id as customerId,
  106. a.picture_addess as pictureAddess,
  107. a.customerPictureChangeRemark,
  108. a.productionFileComments,
  109. a.bom_type as bomType,
  110. a.eng_chg_level as engChgLevel,
  111. a.bom_alternative_no as bomAlternativeNo,
  112. a.routing_type as routingType,
  113. a.routing_revision as routingRevision,
  114. a.routing_alternative_no as routingAlternativeNo,
  115. a.pod,
  116. a.mpOperator,
  117. dbo.get_userDisPlay(a.mpOperator) as mpOperatorName,
  118. a.cqcOperator,
  119. dbo.get_userDisPlay(a.cqcOperator) as cqcOperatorName,
  120. a.faiOperator,
  121. dbo.get_userDisPlay(a.faiOperator) as faiOperatorName,
  122. a.peOperater,
  123. dbo.get_userDisPlay(a.peOperater) as peOperaterName,
  124. a.csOperater,
  125. dbo.get_userDisPlay(a.csOperater) as csOperaterName,
  126. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'dcc') as dccOperater,
  127. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') as dccOperaterName,
  128. d.is_reject as isReject,
  129. d.node_id as nodeId,
  130. d.node_name as nodeName,
  131. pcpi.customer_part_no as customerPartNo,
  132. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  133. a.remarkPage,
  134. a.rev,
  135. a.customer_rev as customerRev,
  136. b.plm_part_no as plmPartNo,
  137. c.project_name as projectName,
  138. a.url_file
  139. FROM plm_technical_specification_sheet a
  140. left join view_Project_final_Part b
  141. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  142. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  143. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  144. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  145. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  146. left join plm_customer_part_info pcpi
  147. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  148. <if test="query.cutterNumber != null and query.cutterNumber != ''">
  149. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  150. (plateNo like #{query.cutterNumber} or
  151. cutterNumber like #{query.cutterNumber})
  152. </if>
  153. <where>
  154. <if test="query.id != null">
  155. AND a.id = #{query.id}
  156. </if>
  157. <if test="query.site != null and query.site != ''">
  158. AND a.site = #{query.site}
  159. </if>
  160. <if test="query.ecnFlag != null and query.ecnFlag != ''">
  161. AND a.ecn_flag = #{query.ecnFlag}
  162. </if>
  163. <if test="query.oriCodeNo != null and query.oriCodeNo != ''">
  164. AND a.ori_code_no like #{query.oriCodeNo}
  165. </if>
  166. <if test="query.codeNo != null and query.codeNo != ''">
  167. AND a.code_no like #{query.codeNo}
  168. </if>
  169. <if test="query.projectId != null and query.projectId != ''">
  170. AND a.project_id like #{query.projectId}
  171. </if>
  172. <if test="query.testPartNo != null and query.testPartNo != ''">
  173. AND (
  174. a.test_part_no like #{query.testPartNo} or
  175. b.final_part_no like #{query.testPartNo} or
  176. a.relevance_part_no like #{query.testPartNo} or
  177. pcpi.customer_part_no like #{query.testPartNo}
  178. )
  179. </if>
  180. <if test="query.customerDesc != null and query.customerDesc != ''">
  181. AND (
  182. (select max(ci.customer_desc) from plm_customer_information ci where ci.customer_no = c.customer_id) like #{query.customerDesc} or
  183. dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{query.customerDesc}
  184. )
  185. </if>
  186. <if test="query.statusDesc != null and query.statusDesc != ''">
  187. AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{query.statusDesc}
  188. </if>
  189. <if test="query.buNo == null || query.buNo == ''">
  190. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{query.site}, #{query.userName}))
  191. </if>
  192. <if test="query.buNo != null and query.buNo != ''">
  193. AND b.bu_no like #{query.buNo}
  194. </if>
  195. </where>
  196. order by a.ori_code_no desc, a.rev_no desc
  197. </select>
  198. <insert id="saveTechnicalSpecificationSheet">
  199. insert into plm_technical_specification_sheet
  200. (site, code_no, project_id, test_part_no, status, rev_no, ECN_flag, ECN_no, ECN_address, remarkPage,
  201. create_date, create_by, proofing_no, ori_code_no, bom_type, eng_chg_level, bom_alternative_no,
  202. routing_type, routing_revision, routing_alternative_no, stage, materialType, step_id, cqcOperator,
  203. faiOperator, peOperater, csOperater, mpOperator, rev, customer_rev, certification, document_source)
  204. values
  205. (#{site}, #{codeNo}, #{projectId}, #{testPartNo}, #{status}, #{revNo}, #{ecnFlag}, #{ecnNo}, #{ecnAddress}, #{remarkPage},
  206. GetDate(), #{createBy}, #{proofingNo}, #{oriCodeNo}, #{bomType}, #{engChgLevel,jdbcType=INTEGER}, #{bomAlternativeNo},
  207. #{routingType}, #{routingRevision,jdbcType=INTEGER}, #{routingAlternativeNo}, 'Sample', 'Label', 10, #{cqcOperator},
  208. #{faiOperator}, #{peOperater}, #{csOperater}, #{mpOperator}, #{rev}, #{customerRev}, 'RoHs,HF,GP', '新增')
  209. </insert>
  210. <update id="updateProjectPartNowBm">
  211. update plm_project_part
  212. set now_bm = #{codeNo}
  213. where site = #{site} and project_id = #{projectId} and test_part_no = #{testPartNo}
  214. </update>
  215. <insert id="saveTechnicalSpecificationTeams">
  216. insert into plm_technicalSpecification_team (site, code_no, operator_id, type)
  217. values (#{site}, #{codeNo}, #{operatorId}, #{type})
  218. </insert>
  219. <insert id="saveBatchTechnicalSpecificationTeams">
  220. insert into plm_technicalSpecification_team (site, code_no, operator_id, type)
  221. values
  222. <foreach collection="list" item="item" separator=",">
  223. (#{item.site}, #{item.codeNo}, #{item.operatorId}, #{item.type})
  224. </foreach>
  225. </insert>
  226. <update id="updateTechnicalSpecificationSheet">
  227. update plm_technical_specification_sheet
  228. set project_id = #{projectId},
  229. test_part_no = #{testPartNo},
  230. status = #{status},
  231. rev_no = #{revNo},
  232. ECN_no = #{ecnNo},
  233. ECN_flag = #{ecnFlag},
  234. ECN_address = #{ecnAddress},
  235. remarkPage = #{remarkPage},
  236. update_date = GetDate(),
  237. update_by = #{updateBy},
  238. cqcOperator = #{cqcOperator},
  239. faiOperator = #{faiOperator},
  240. peOperater = #{peOperater},
  241. csOperater = #{csOperater},
  242. mpOperator = #{mpOperator},
  243. rev = #{rev},
  244. customer_rev = #{customerRev}
  245. where id = #{id}
  246. </update>
  247. <delete id="deleteTechnicalSpecificationTeamsForBase">
  248. delete
  249. from plm_technicalSpecification_team
  250. where site = #{site}
  251. and code_no = #{codeNo}
  252. and type in ('quotationOfficer', 'engineer', 'technician', 'dcc', 'cqc', 'fai', 'cs', 'mp', 'plan', 'qualityEngineer')
  253. </delete>
  254. <delete id="deleteTechnicalSpecificationTeamsForDetail">
  255. delete
  256. from plm_technicalSpecification_team
  257. where site = #{site}
  258. and code_no = #{codeNo}
  259. and type in ('reviewEngineer', 'peEngineer', 'cqe')
  260. </delete>
  261. <select id="searchTechnicalSpecificationTeamStr" resultType="String">
  262. select operator_id
  263. from plm_technicalSpecification_team
  264. where type = #{type}
  265. and site = #{site}
  266. and code_no = #{codeNo}
  267. </select>
  268. <select id="getTechnicalCustomerInfoData" resultType="TechnicalCustomerInfoData">
  269. select a.id,
  270. b.customer_id,
  271. c.customer_desc as customerName,
  272. c.customer_description as customerDesc,
  273. b.customer_Remark,
  274. b.remark,
  275. a.picture_addess,
  276. a.customerPictureChangeRemark,
  277. a.productionFileComments
  278. from plm_technical_specification_sheet a
  279. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  280. left join plm_customer_information c on b.site = c.site and b.customer_id = c.customer_no
  281. where a.id = #{id}
  282. </select>
  283. <select id="searchBMUser" resultType="PlmOperatorData">
  284. select
  285. a.username operator_id,
  286. a.user_display operator_name,
  287. b.site,
  288. b.bu_no as buNo
  289. from sys_user a left join AccessBu b on a.username = b.username
  290. <if test="roleNo != null and roleNo != ''">
  291. inner join AccessRole r on r.username = a.username and r.role_no = #{roleNo}
  292. </if>
  293. where b.bu_no = #{buNo}
  294. <if test="roleNo != null and roleNo != ''">
  295. and r.site = #{site}
  296. </if>
  297. and b.site = #{site}
  298. order by a.username desc
  299. </select>
  300. <select id="tsdBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  301. SELECT
  302. top 1
  303. a.id,
  304. a.site,
  305. a.code_no,
  306. a.project_id,
  307. a.test_part_no,
  308. a.status,
  309. a.rev_no,
  310. a.work_center_no,
  311. a.ECN_flag,
  312. a.ECN_no,
  313. b.bu_no,
  314. a.ECN_address,
  315. a.remark,
  316. a.create_date,
  317. a.create_by,
  318. a.update_date,
  319. a.update_by,
  320. b.final_part_no,
  321. b.part_type partTypeDesc,
  322. b.part_type,
  323. b.part_name,
  324. b.part_desc,
  325. b.part_spec,
  326. dbo.plm_get_technicalBaseDesc(a.status, 'status') statusDesc,
  327. a.proofing_no,
  328. stage,
  329. dbo.plm_get_dictDataLabel('bm_process', process, a.site) process,
  330. remarkPage,
  331. c.customer_Id,
  332. a.ori_code_no,
  333. a.overPrintOperator,
  334. a.printOperator,
  335. dbo.get_userDisPlay(a.overPrintOperator) overPrintOperatorName,
  336. dbo.get_userDisPlay(a.printOperator) printOperatorName,
  337. isnull(a.step_id, 10) stepId,
  338. d.is_reject,
  339. a.pod,
  340. d.node_id,
  341. d.node_name,
  342. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'cs') csOperater,
  343. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cs') csOperaterName,
  344. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
  345. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
  346. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
  347. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
  348. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'qualityEngineer') qualityEngineerNo,
  349. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'qualityEngineer') qualityEngineer,
  350. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'mp') mpOperator,
  351. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'mp') mpOperatorName,
  352. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dcc,
  353. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
  354. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
  355. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'plan') planOperator,
  356. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'plan') planOperatorName,
  357. a.rev,
  358. a.customer_rev,
  359. relevance_part_no,
  360. a.ecn_upgrade_version,
  361. a.ecn_upgrade_flag,
  362. a.ecn_need_change_drawing,
  363. a.document_source,
  364. a.shop_order,
  365. a.copy_flag,
  366. a.simplex_duplex,
  367. a.repeat,
  368. a.hp,
  369. a.across,
  370. a.print_copy_position,
  371. a.label_size,
  372. a.label_width,
  373. a.label_length,
  374. a.vp,
  375. a.down,
  376. a.actual_number,
  377. a.goods_roll_width,
  378. a.new_cutter,
  379. a.p2c_tolerance,
  380. a.dimension_tolerance,
  381. a.slitting_tolerance,
  382. a.url_file,
  383. a.radius,
  384. a.sheet,
  385. a.partCategory
  386. FROM plm_technical_specification_sheet a
  387. left join view_Project_final_Part b on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  388. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  389. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  390. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and isnull(a.step_id, 10) = d.step_id
  391. where a.site = #{site} and a.code_no = #{codeNo}
  392. </select>
  393. <delete id="deleteTechnicalSpecificationList">
  394. delete
  395. from plm_technical_specification_sheet
  396. where id = #{id}
  397. </delete>
  398. <update id="updateBMProcess">
  399. update plm_technical_specification_sheet
  400. set process = #{process},
  401. overPrintOperator = #{overPrintOperator},
  402. printOperator = #{printOperator}
  403. where site = #{site} and code_no = #{codeNo}
  404. </update>
  405. <select id="getTestPartChangeData" resultType="PlmProjectPartData">
  406. select top 1 *
  407. from view_Project_final_Part
  408. where site = #{site}
  409. and test_part_no = #{testPartNo}
  410. </select>
  411. <select id="BMBasicInformationSearch" resultType="PlmTechnicalSpecificationSheetData">
  412. SELECT top 1 a.id,
  413. a.site,
  414. a.code_no,
  415. a.project_id,
  416. a.test_part_no,
  417. a.status,
  418. a.rev_no,
  419. a.work_center_no,
  420. a.ECN_flag,
  421. a.ECN_no,
  422. a.ECN_address,
  423. a.remark,
  424. a.create_date,
  425. a.create_by,
  426. a.update_date,
  427. a.update_by,
  428. b.final_part_no,
  429. b.part_type partTypeDesc,
  430. b.part_type,
  431. b.part_name,
  432. b.part_desc,
  433. b.part_spec,
  434. dbo.plm_get_technicalBaseDesc(a.status, 'status') statusDesc,
  435. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
  436. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
  437. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'quotationOfficer') quotationOfficer,
  438. c.customer_Id,
  439. a.proofing_no,
  440. a.ori_code_no
  441. FROM plm_technical_specification_sheet a
  442. left join view_Project_final_Part b
  443. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  444. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  445. where a.site = #{site}
  446. and a.code_no = #{codeNo}
  447. </select>
  448. <select id="getProofingDataByUserRole" resultType="PlmTechnicalSpecificationSheetData">
  449. SELECT a.site,
  450. a.proofing_no,
  451. a.project_id,
  452. a.test_part_no,
  453. dbo.plm_get_test_part_name(a.site, a.test_part_no) partName,
  454. dbo.plm_get_test_part_desc(a.site, a.test_part_no) partDesc,
  455. b.customer_id,
  456. b.final_customer_id,
  457. dbo.plm_get_customer_desc(a.site, b.customer_id) CustomerDesc,
  458. dbo.plm_get_dictDataLabel('finalCustomer', b.final_customer_id, a.site) finalCustomerDesc,
  459. b.project_name,
  460. d.bu_no
  461. from plm_proofing_information a
  462. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  463. left join part as c on a.site = c.site and a.test_part_no = c.part_no
  464. left join plm_project_part d on a.site = d.site and a.test_part_no = d.test_part_no
  465. <where>
  466. and a.site = #{site}
  467. AND a.project_id in (select project_id
  468. from AccessProject
  469. where site = #{site} and username = #{username} and searchFlag = 'Y')
  470. <if test="proofingNo != null and proofingNo != ''">
  471. AND a.proofing_no like #{proofingNo}
  472. </if>
  473. <if test="projectId != null and projectId != ''">
  474. AND a.project_id like #{projectId}
  475. </if>
  476. <if test="customerId != null and customerId != ''">
  477. AND b.customer_id like #{customerId}
  478. </if>
  479. <if test="finalCustomerId != null and finalCustomerId != ''">
  480. AND b.final_customer_id like #{finalCustomerId}
  481. </if>
  482. and c.status = 'Y'
  483. </where>
  484. </select>
  485. <update id="updateBMBasicInformation">
  486. update plm_technical_specification_sheet
  487. set status = #{status},
  488. stage = #{stage},
  489. remarkPage = #{remarkPage},
  490. rev_no = #{revNo},
  491. ECN_no = #{ecnNo},
  492. ECN_flag = #{ecnFlag},
  493. ECN_address = #{ecnAddress},
  494. cqcOperator = #{cqcOperator},
  495. update_date = GetDate(),
  496. update_by = #{updateBy},
  497. faiOperator = #{faiOperator},
  498. peOperater = #{peOperater},
  499. csOperater = #{csOperater},
  500. pod = #{pod},
  501. mpOperator = #{mpOperator},
  502. relevance_part_no = #{relevancePartNo},
  503. ecn_need_change_drawing = #{ecnNeedChangeDrawing},
  504. shop_order = #{shopOrder},
  505. copy_flag = #{copyFlag},
  506. partCategory = #{partCategory}
  507. where site = #{site} and code_no = #{codeNo}
  508. </update>
  509. <select id="searchBMcustomerInfo" resultType="PlmTechnicalSpecificationSheetData">
  510. select
  511. a.site,
  512. a.code_no,
  513. a.picture_addess,
  514. a.customerPictureChangeRemark,
  515. a.productionFileComments,
  516. b.customer_id,
  517. dbo.plm_get_customer_desc(b.site, b.customer_id) CustomerDesc,
  518. b.final_customer_id finalCustomerNo,
  519. dbo.plm_get_dictDataLabel('finalCustomer', b.final_customer_id, a.site) finalCustomerDesc,
  520. c.final_part_no as part_no,
  521. a.test_part_no,
  522. c.part_desc,
  523. c.material_number,
  524. c.part_type as part_family,
  525. b.customer_remark,
  526. a.remark,
  527. a.ori_code_no,
  528. a.materialType,
  529. a.customerRevNo,
  530. a.materialNumber,
  531. a.certification,
  532. a.otherCertification,
  533. a.customerRemark,
  534. a.projectRemark,
  535. b.project_id,
  536. pcpi.customer_part_no,
  537. a.direct_customer
  538. from plm_technical_specification_sheet a
  539. left join plm_project_info b on a.site = b.site and a.project_id = b.project_id
  540. left join view_Project_final_Part c on a.site = c.site and a.test_part_no = c.test_part_no and a.project_id = c.project_id
  541. left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and b.customer_id = pcpi.customer_no
  542. where a.site = #{site} and a.code_no = #{codeNo}
  543. </select>
  544. <update id="updateBMcustomerInfo">
  545. update plm_technical_specification_sheet
  546. set picture_Addess=#{pictureAddess},
  547. materialType=#{materialType},
  548. customerPictureChangeRemark=#{customerPictureChangeRemark},
  549. productionFileComments =#{productionFileComments},
  550. remark=#{remark},
  551. update_date=GetDate(),
  552. update_by=#{updateBy},
  553. certification=#{certification},
  554. otherCertification=#{otherCertification},
  555. customerRevNo=#{customerRevNo},
  556. materialNumber=#{materialNumber},
  557. customerRemark=#{customerRemark},
  558. projectRemark=#{projectRemark},
  559. direct_customer=#{directCustomer}
  560. where site = #{site}
  561. and code_no = #{codeNo}
  562. </update>
  563. <select id="searchBMPackageInfo" resultType="PlmBmPackageInfoData">
  564. select site,
  565. code_no,
  566. matrixStripped,
  567. appliedType,
  568. finalFormat,
  569. [rowCount],
  570. columnCount,
  571. missingAllowedFlag,
  572. rollPerQty,
  573. addingFilmFlag,
  574. packageRequest,
  575. coreType,
  576. coreDiameter,
  577. joinAllowedFlag,
  578. coreWidth,
  579. specialPositiorFlag,
  580. copyPosition,
  581. overprintingFlag,
  582. otherRequirement
  583. from plm_bm_packageInfo
  584. where site = #{site}
  585. and code_no = #{codeNo}
  586. </select>
  587. <update id="updateBMPackageInfo">
  588. update plm_bm_packageInfo
  589. set matrixStripped=#{matrixStripped},
  590. appliedType=#{appliedType},
  591. finalFormat=#{finalFormat},
  592. [rowCount]=#{rowCount,jdbcType=INTEGER},
  593. columnCount=#{columnCount,jdbcType=INTEGER},
  594. missingAllowedFlag=#{missingAllowedFlag},
  595. rollPerQty=#{rollPerQty,jdbcType=DECIMAL},
  596. addingFilmFlag=#{addingFilmFlag},
  597. packageRequest=#{packageRequest},
  598. coreType=#{coreType},
  599. coreDiameter=#{coreDiameter},
  600. joinAllowedFlag=#{joinAllowedFlag},
  601. coreWidth=#{coreWidth,jdbcType=DECIMAL},
  602. specialPositiorFlag=#{specialPositiorFlag},
  603. copyPosition=#{copyPosition},
  604. overprintingFlag=#{overprintingFlag},
  605. otherRequirement=#{otherRequirement},
  606. update_date=GetDate(),
  607. update_by=#{updateBy}
  608. where site = #{site}
  609. and code_no = #{codeNo}
  610. </update>
  611. <select id="saveBMPackageInfo">
  612. insert into plm_bm_packageInfo (site, code_no, matrixStripped, appliedType, finalFormat, [rowCount],
  613. columnCount, missingAllowedFlag, rollPerQty, addingFilmFlag,
  614. packageRequest, coreType, coreDiameter, joinAllowedFlag, coreWidth,
  615. specialPositiorFlag, copyPosition, overprintingFlag,
  616. otherRequirement, update_date, update_by)
  617. values (#{site}, #{codeNo}, #{matrixStripped}, #{appliedType}, #{finalFormat}, #{rowCount,jdbcType=INTEGER},
  618. #{columnCount,jdbcType=INTEGER},
  619. #{missingAllowedFlag}, #{rollPerQty,jdbcType=DECIMAL}, #{addingFilmFlag}, #{packageRequest},
  620. #{coreType}, #{coreDiameter}, #{joinAllowedFlag}, #{coreWidth,jdbcType=DECIMAL},
  621. #{specialPositiorFlag}, #{copyPosition}, #{overprintingFlag}, #{otherRequirement}, GetDate(),
  622. #{updateBy})
  623. </select>
  624. <select id="searchPartDataForSelect" resultType="com.spring.modules.part.vo.PartInformationVo">
  625. select top 100 a.erp_part_no, a.part_desc, a.family_id, a.spec, family_name
  626. from part a
  627. left join part_family b on a.site = b.site and a.family_id = b.family_id
  628. <where>
  629. and a.site = #{site}
  630. <if test="erpPartNo != null and erpPartNo != ''">
  631. AND a.erp_part_no like #{erpPartNo}
  632. </if>
  633. <if test="familyId != null and familyId != ''">
  634. AND a.family_id like #{familyId}
  635. </if>
  636. <if test="partDesc != null and partDesc != ''">
  637. AND a.part_desc like #{partDesc}
  638. </if>
  639. and a.erp_part_no is not null
  640. and a.erp_part_no != ''
  641. </where>
  642. </select>
  643. <insert id="saveBMBom">
  644. insert into plm_bm_bom (Site, code_no, erp_part_no, quantity, remark, create_by, create_date)
  645. values (#{site}, #{codeNo}, #{erpPartNo}, #{quantity}, #{remark}, #{username}, GetDate())
  646. </insert>
  647. <update id="updateBMBom">
  648. update plm_bm_bom
  649. set quantity=#{quantity,jdbcType=DECIMAL},
  650. remark=#{remark},
  651. update_by=#{username},
  652. update_date=GetDate()
  653. where Site = #{site}
  654. and code_no = #{codeNo}
  655. and erp_part_no = #{erpPartNo}
  656. </update>
  657. <select id="searchBMBom" resultType="PlmBmBomData">
  658. select a.Site,
  659. a.code_no,
  660. a.erp_part_no,
  661. a.quantity,
  662. a.remark,
  663. b.part_desc,
  664. b.spec,
  665. b.family_id,
  666. c.family_name
  667. from plm_bm_bom a
  668. left join part b on a.erp_part_no = b.erp_part_no and a.site = b.site
  669. left join part_family c on b.family_id = c.family_id and b.site = c.site
  670. <where>
  671. and a.site = #{site}
  672. <if test="erpPartNo != null and erpPartNo != ''">
  673. AND a.erp_part_no like #{erpPartNo}
  674. </if>
  675. <if test="codeNo != null and codeNo != ''">
  676. AND a.code_no like #{codeNo}
  677. </if>
  678. </where>
  679. </select>
  680. <delete id="deleteBMBom">
  681. delete
  682. from plm_bm_bom
  683. where code_no = #{codeNo}
  684. and site = #{site}
  685. and erp_part_no = #{erpPartNo}
  686. </delete>
  687. <select id="searchBMRoutingDetail" resultType="PlmBmRoutingData">
  688. SELECT a.Site,
  689. a.code_no,
  690. a.processDetail,
  691. a.supplyAdhesiveTape,
  692. a.routingDrawing,
  693. a.drawingRevison,
  694. a.drawingDate,
  695. a.workInfo,
  696. a.wiRevison,
  697. a.wiDate,
  698. a.routingRemark,
  699. a.routingAction,
  700. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'reviewEngineer') reviewEngineer,
  701. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'peEngineer') peEngineer,
  702. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cqe') cqe
  703. FROM plm_bm_routing a
  704. where a.site = #{site}
  705. and a.code_no = #{codeNo}
  706. </select>
  707. <insert id="saveBMRoutingDetail">
  708. insert into plm_bm_routing (Site, code_no, processDetail, supplyAdhesiveTape, routingDrawing, drawingRevison,
  709. drawingDate, workInfo, wiRevison, wiDate,
  710. routingRemark, routingAction, update_by, update_date)
  711. values (#{site}, #{codeNo}, #{processDetail}, #{supplyAdhesiveTape}, #{routingDrawing}, #{drawingRevison},
  712. #{drawingDate}, #{workInfo}, #{wiRevison}, #{wiDate},
  713. #{routingRemark}, #{routingAction}, #{username}, GetDate())
  714. </insert>
  715. <update id="updateBMRoutingDetail">
  716. update plm_bm_routing
  717. set processDetail=#{processDetail},
  718. supplyAdhesiveTape=#{supplyAdhesiveTape},
  719. routingDrawing=#{routingDrawing},
  720. drawingRevison=#{drawingRevison},
  721. drawingDate=#{drawingDate},
  722. workInfo=#{workInfo},
  723. wiRevison=#{wiRevison},
  724. wiDate=#{wiDate},
  725. routingRemark=#{routingRemark},
  726. routingAction=#{routingAction},
  727. update_by=#{username},
  728. update_date=GetDate()
  729. where site = #{site}
  730. and code_no = #{codeNo}
  731. </update>
  732. <select id="checkPlmBmPropertiesValueHeaderData" resultType="PlmBmPropertiesValueHeaderData">
  733. select
  734. Site,
  735. bu_no,
  736. PartNo,
  737. CodeNo,
  738. SubCodeSeqNo,
  739. SubCodeDesc,
  740. RecordType,
  741. operation_no
  742. from plm_bm_propertiesValueHeader
  743. where PartNo = #{codeNo} and site = #{site} and CodeNo = #{type} and bu_no = #{buNo} and operation_no = #{operationNo}
  744. </select>
  745. <insert id="savePlmBmPropertiesValueHeaderData">
  746. insert into plm_bm_propertiesValueHeader(Site, bu_no, PartNo, CodeNo, SubCodeSeqNo, SubCodeDesc, RecordType, operation_no)
  747. select
  748. #{site},
  749. #{buNo},
  750. #{codeNo},
  751. #{type},
  752. 1,
  753. code_desc,
  754. 'BM',
  755. #{operationNo}
  756. from plm_bm_model_header
  757. where site = #{site}
  758. and bu_no = #{buNo}
  759. and function_type = 'BM'
  760. and code_no = #{type}
  761. </insert>
  762. <insert id="savePlmBmPropertiesValueData">
  763. insert into plm_bm_propertiesValue(Site, bu_no, PartNo, CodeNo, SubCodeSeqNo, SubCodeDesc, ItemNo,
  764. PropertiesItemNo, TextValue, NumValue, RecordType, order_id, operation_no)
  765. select #{site},
  766. #{buNo},
  767. #{codeNo},
  768. #{type},
  769. ROW_NUMBER() OVER (ORDER BY b.code_desc) AS SubCodeSeqNo,
  770. b.code_desc,
  771. a.seq_no,
  772. a.properties_item_no,
  773. c.DefaultValue,
  774. null,
  775. 'BM',
  776. a.order_id,
  777. #{operationNo}
  778. from plm_bm_model_header b
  779. left join plm_properties_model_detail a on a.site = #{site} and a.function_type = 'BM' and a.code_no = b.properties_code_no
  780. left join plm_properties_item c on a.properties_item_no = c.ItemNo and a.site = c.site and a.function_type = c.ItemType
  781. where b.site = #{site}
  782. and b.bu_no = #{buNo}
  783. and b.function_type = 'BM'
  784. and b.code_no = #{type}
  785. and a.code_no is not null
  786. </insert>
  787. <select id="searchBMPropertiesValue" resultType="PlmBmPropertiesValueData">
  788. select
  789. a.Site,
  790. a.bu_no,
  791. a.PartNo,
  792. a.CodeNo,
  793. a.SubCodeSeqNo,
  794. a.SubCodeDesc,
  795. a.ItemNo,
  796. a.PropertiesItemNo,
  797. a.TextValue,
  798. a.NumValue,
  799. a.RecordType,
  800. a.order_id,
  801. b.itemDesc,
  802. b.ValueType_DB,
  803. b.ValueChooseFlag,
  804. a.operation_no
  805. from plm_bm_propertiesValue a
  806. left join plm_properties_item b on a.PropertiesItemNo = b.ItemNo and a.site = b.site and a.RecordType = b.ItemType
  807. where a.site = #{site}
  808. and a.bu_no = #{buNo}
  809. and a.RecordType = 'BM'
  810. and a.CodeNo = #{type}
  811. and a.PartNo = #{codeNo}
  812. and a.operation_no = #{operationNo}
  813. order by a.order_id
  814. </select>
  815. <select id="getAvailableValueList" resultType="PlmPropertiesItemAvailableData">
  816. select ItemNo, ValueNo, AvailableValue
  817. from plm_properties_item_available
  818. where itemNo = #{propertiesItemNo}
  819. and site = #{site}
  820. and ItemType = 'BM'
  821. </select>
  822. <update id="updateBMPropertiesValue">
  823. update plm_bm_propertiesValue
  824. set NumValue = #{numValue,jdbcType=DOUBLE},
  825. TextValue = #{textValue}
  826. where site = #{site}
  827. and bu_no = #{buNo}
  828. and PartNo = #{partNo}
  829. and RecordType = #{recordType}
  830. and SubCodeSeqNo = #{subCodeSeqNo}
  831. and CodeNo = #{codeNo}
  832. and ItemNo = #{itemNo}
  833. and operation_no = #{operationNo}
  834. </update>
  835. <select id="getBMPageBase" resultType="PlmBmPageBaseData">
  836. select bu_no, code_no
  837. from plm_bm_model_header
  838. where bu_no = #{buNo}
  839. and site = #{site}
  840. and active = 'Y'
  841. </select>
  842. <select id="searchBMRoute" resultType="com.spring.modules.part.vo.RoutingComponentVo">
  843. SELECT a.site,
  844. a.part_no,
  845. a.routing_type,
  846. a.routing_revision,
  847. a.alternative_no,
  848. a.operation_id,
  849. a.operation_no,
  850. a.operation_name,
  851. a.efficiency_factor,
  852. a.mach_run_factor,
  853. a.mach_setup_time,
  854. a.run_time_code,
  855. a.labor_run_factor,
  856. a.labor_setup_time,
  857. a.crew_size,
  858. a.setup_crew_size,
  859. a.outside_op_item,
  860. a.machine_no,
  861. a.work_center_no,
  862. dbo.get_workCenter_desc(a.site, a.work_center_no) as workCenterDesc,
  863. a.labor_class_no,
  864. a.setup_labor_class_no,
  865. a.overlap,
  866. a.note_text as componentNoteText,
  867. b.itemType
  868. FROM plm_routing_component a
  869. left join WorkCenter_BMType b on a.site = b.site and a.work_center_no = b.workCenterNo
  870. where a.site = #{site}
  871. and a.part_no = #{partNo}
  872. and a.routing_type = #{routingType}
  873. and a.routing_revision = #{routingRevision,jdbcType=INTEGER}
  874. and a.alternative_no = #{alternativeNo}
  875. order by a.operation_no
  876. </select>
  877. <insert id="saveBMRoute">
  878. insert into plm_bm_routing_detail (site, code_no, item_no, OperationDesc, remark, create_date, create_by)
  879. values (#{site}, #{codeNo}, #{itemNo}, #{operationDesc}, #{remark}, GetDate(), #{username})
  880. </insert>
  881. <update id="updateBMRoute">
  882. update plm_bm_routing_detail
  883. set item_no=#{itemNo}
  884. , OperationDesc=#{operationDesc}
  885. , remark=#{remark}
  886. , update_date=GetDate()
  887. , update_by=#{username}
  888. where id = #{id}
  889. </update>
  890. <delete id="deleteBMRoute">
  891. delete
  892. from plm_bm_routing_detail
  893. where id = #{id}
  894. </delete>
  895. <select id="searchBMTPInfoDetail" resultType="PlmBmTpInfoDetailData">
  896. select site,
  897. code_no,
  898. colourMatch,
  899. environment,
  900. eordValue,
  901. customerFile,
  902. laberSize,
  903. crossNumber,
  904. hp,
  905. rowNumber,
  906. vp,
  907. remark
  908. from plm_bm_tpInfoDetail
  909. where site = #{site}
  910. and code_no = #{codeNo}
  911. </select>
  912. <insert id="saveBMTPInfoDetail">
  913. insert into plm_bm_tpInfoDetail (site, code_no, colourMatch, environment, eordValue, customerFile, laberSize,
  914. crossNumber, hp, rowNumber, vp, remark, update_date, update_by)
  915. values (#{site}, #{codeNo}, #{colourMatch}, #{environment}, #{eordValue}, #{customerFile}, #{laberSize},
  916. #{crossNumber}, #{hp}, #{rowNumber}, #{vp}, #{remark}, GetDate(), #{updateBy})
  917. </insert>
  918. <update id="updateBMTPInfoDetail">
  919. update plm_bm_tpInfoDetail
  920. set colourMatch=#{colourMatch},
  921. environment=#{environment},
  922. eordValue=#{eordValue},
  923. customerFile=#{customerFile},
  924. laberSize=#{laberSize},
  925. crossNumber=#{crossNumber},
  926. hp=#{hp},
  927. rowNumber=#{rowNumber},
  928. vp=#{vp},
  929. remark=#{remark},
  930. update_date=GetDate(),
  931. update_by=#{updateBy}
  932. where site = #{site}
  933. and code_no = #{codeNo}
  934. </update>
  935. <select id="searchBMTPInfoColor" resultType="PlmBmTpInfoColorData">
  936. select site,
  937. code_no,
  938. [order],
  939. color,
  940. inkType,
  941. colorRet,
  942. colorMatch,
  943. remark,
  944. filmNo,
  945. stencilNo,
  946. update_by,
  947. update_date,
  948. id
  949. from plm_bm_tpInfoColor
  950. where site = #{site}
  951. and code_no = #{codeNo}
  952. order by [order]
  953. </select>
  954. <insert id="saveBMTPInfoColor">
  955. insert into plm_bm_tpInfoColor (site, code_no, [order], color, inkType, colorRet, colorMatch, remark, filmNo,
  956. stencilNo, update_by, update_date)
  957. values (#{site}, #{codeNo}, #{order}, #{color}, #{inkType}, #{colorRet}, #{colorMatch}, #{remark}, #{filmNo},
  958. #{stencilNo}, #{updateBy}, GetDate())
  959. </insert>
  960. <update id="updateBMTPInfoColor">
  961. update plm_bm_tpInfoColor
  962. set [order]=#{order},
  963. color=#{color},
  964. inkType=#{inkType},
  965. colorRet=#{colorRet},
  966. colorMatch=#{colorMatch},
  967. remark=#{remark},
  968. filmNo=#{filmNo},
  969. stencilNo=#{stencilNo},
  970. update_date=GetDate(),
  971. update_by=#{updateBy}
  972. where id = #{id}
  973. </update>
  974. <delete id="deleteBMTPInfoColor">
  975. delete
  976. from plm_bm_tpInfoColor
  977. where id = #{id}
  978. </delete>
  979. <select id="checkPlmBmTpInfoColorOrder" resultType="PlmBmTpInfoColorData">
  980. select site
  981. from plm_bm_tpInfoColor
  982. where site = #{site}
  983. and code_no = #{codeNo}
  984. and [order] = #{order}
  985. </select>
  986. <select id="searchBMTPInfoCut" resultType="PlmBmTpInfoCutData">
  987. select site,
  988. code_no,
  989. [order],
  990. cuttingMachine,
  991. cuttingType,
  992. cutterTooling,
  993. cutterLayout,
  994. cutterCost,
  995. p2c,
  996. c2c,
  997. cutterNo,
  998. update_date,
  999. update_by,
  1000. id
  1001. from plm_bm_tpInfoCut
  1002. where site = #{site}
  1003. and code_no = #{codeNo}
  1004. order by [order]
  1005. </select>
  1006. <insert id="saveBMTPInfoCut">
  1007. insert into plm_bm_tpInfoCut (site, code_no, [order], cuttingMachine, cuttingType, cutterTooling, cutterLayout,
  1008. cutterCost, p2c, c2c, cutterNo, update_date,
  1009. update_by)
  1010. values (#{site}, #{codeNo}, #{order}, #{cuttingMachine}, #{cuttingType}, #{cutterTooling}, #{cutterLayout},
  1011. #{cutterCost}, #{p2c}, #{c2c}, #{cutterNo}, GetDate(), #{updateBy})
  1012. </insert>
  1013. <update id="updateBMTPInfoCut">
  1014. update plm_bm_tpInfoCut
  1015. set [order]=#{order},
  1016. cuttingMachine=#{cuttingMachine},
  1017. cuttingType=#{cuttingType},
  1018. cutterTooling=#{cutterTooling},
  1019. cutterLayout=#{cutterLayout},
  1020. cutterCost=#{cutterCost},
  1021. p2c=#{p2c},
  1022. c2c=#{c2c},
  1023. cutterNo=#{cutterNo},
  1024. update_date=GetDate(),
  1025. update_by=#{updateBy}
  1026. where id = #{id}
  1027. </update>
  1028. <select id="checkPlmBmTpInfoCutOrder" resultType="PlmBmTpInfoCutData">
  1029. select site
  1030. from plm_bm_tpInfoCut
  1031. where site = #{site}
  1032. and code_no = #{codeNo}
  1033. and [order] = #{order}
  1034. </select>
  1035. <delete id="deleteBMTPInfoCut">
  1036. delete
  1037. from plm_bm_tpInfoCut
  1038. where id = #{id}
  1039. </delete>
  1040. <select id="searchBMPrepressDetail" resultType="PlmBmPrepressData">
  1041. select
  1042. Site,
  1043. code_no,
  1044. plateNo,
  1045. cutterNumber,
  1046. cutterLayout,
  1047. [action],
  1048. remark,
  1049. feedback,
  1050. update_by,
  1051. update_date,
  1052. operation_no
  1053. from plm_bm_prepress
  1054. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1055. </select>
  1056. <insert id="saveBMPrepressDetail">
  1057. insert into plm_bm_prepress (Site, code_no, plateNo, cutterNumber, cutterLayout, [action], remark, feedback, update_by, update_date, operation_no)
  1058. values (#{site}, #{codeNo}, #{plateNo}, #{cutterNumber}, #{cutterLayout}, #{action}, #{remark}, #{feedback}, #{updateBy}, GetDate(), #{operationNo})
  1059. </insert>
  1060. <update id="updateBMPrepressDetail">
  1061. update plm_bm_prepress
  1062. set plateNo = #{plateNo},
  1063. cutterNumber = #{cutterNumber},
  1064. cutterLayout = #{cutterLayout},
  1065. [action] = #{action},
  1066. remark = #{remark},
  1067. feedback = #{feedback},
  1068. update_by = #{updateBy},
  1069. update_date = GetDate()
  1070. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1071. </update>
  1072. <select id="searchBMPrepressColor" resultType="PlmBmPrepressColorData">
  1073. select site,
  1074. code_no,
  1075. [order],
  1076. meshModel,
  1077. meshSize,
  1078. angle,
  1079. coatingType,
  1080. filmNo,
  1081. stencilNo,
  1082. color,
  1083. update_by,
  1084. update_date
  1085. from plm_bm_PrepressColor
  1086. where site = #{site}
  1087. and code_no = #{codeNo}
  1088. order by [order]
  1089. </select>
  1090. <insert id="saveBMPrepressColor">
  1091. insert into plm_bm_PrepressColor (site, code_no, [order], meshModel, meshSize, angle, coatingType, filmNo,
  1092. stencilNo, color, update_by, update_date)
  1093. values (#{site}, #{codeNo}, #{order}, #{meshModel}, #{meshSize}, #{angle}, #{coatingType}, #{filmNo},
  1094. #{stencilNo}, #{color}, #{updateBy}, GetDate())
  1095. </insert>
  1096. <update id="updateBMPrepressColor">
  1097. update plm_bm_PrepressColor
  1098. set [order]=#{order},
  1099. color=#{color},
  1100. meshModel=#{meshModel},
  1101. meshSize=#{meshSize},
  1102. angle=#{angle},
  1103. coatingType=#{coatingType},
  1104. filmNo=#{filmNo},
  1105. stencilNo=#{stencilNo},
  1106. update_date=GetDate(),
  1107. update_by=#{updateBy}
  1108. where id = #{id}
  1109. </update>
  1110. <delete id="deleteBMPrepressColor">
  1111. delete
  1112. from plm_bm_PrepressColor
  1113. where id = #{id}
  1114. </delete>
  1115. <select id="checkPlmBmPrepressColorOrder" resultType="PlmBmPrepressColorData">
  1116. select site
  1117. from plm_bm_PrepressColor
  1118. where site = #{site}
  1119. and code_no = #{codeNo}
  1120. and [order] = #{order}
  1121. </select>
  1122. <select id="searchBMPrintOtherDetail" resultType="PlmBmPrintOtherData">
  1123. select
  1124. site,
  1125. code_no,
  1126. remark,
  1127. [action],
  1128. update_date,
  1129. update_by,
  1130. id,
  1131. operation_no
  1132. from plm_bm_PrintOther
  1133. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1134. </select>
  1135. <insert id="saveBMPrintOtherDetail">
  1136. insert into plm_bm_PrintOther (site, code_no, remark, [action], update_date, update_by, operation_no)
  1137. values (#{site}, #{codeNo}, #{remark}, #{action}, GetDate(), #{updateBy}, #{operationNo})
  1138. </insert>
  1139. <update id="updateBMPrintOtherDetail">
  1140. update plm_bm_PrintOther
  1141. set remark = #{remark},
  1142. [action] = #{action}
  1143. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1144. </update>
  1145. <select id="searchBMPrintOtherColor" resultType="PlmBmPrintOtherColorData">
  1146. select site,
  1147. code_no,
  1148. [order],
  1149. seqNo,
  1150. ink,
  1151. [type],
  1152. otherRef,
  1153. update_date,
  1154. update_by,
  1155. operation_no
  1156. from plm_bm_PrintOtherColor
  1157. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1158. order by [order], seqNo
  1159. </select>
  1160. <insert id="saveBMPrintOtherColor">
  1161. insert into plm_bm_PrintOtherColor (site, code_no, [order], seqNo, ink, [type], otherRef, update_by,
  1162. update_date)
  1163. values (#{site}, #{codeNo}, #{order}, #{seqNo}, #{ink}, #{type}, #{otherRef}, #{updateBy}, GetDate())
  1164. </insert>
  1165. <update id="updateBMPrintOtherColor">
  1166. update plm_bm_PrintOtherColor
  1167. set [order] = #{order},
  1168. seqNo = #{seqNo},
  1169. ink = #{ink},
  1170. [type] = #{type},
  1171. otherRef = #{otherRef},
  1172. update_date = GetDate(),
  1173. update_by = #{updateBy}
  1174. where id = #{id}
  1175. </update>
  1176. <delete id="deleteBMPrintOtherColor">
  1177. delete
  1178. from plm_bm_PrintOtherColor
  1179. where id = #{id}
  1180. </delete>
  1181. <select id="checkPlmBmPrintOtherColorOrder" resultType="PlmBmPrintOtherColorData">
  1182. select site
  1183. from plm_bm_PrintOtherColor
  1184. where site = #{site} and code_no = #{codeNo} and operation_no and [order] = #{order} and seqNo = #{seqNo}
  1185. </select>
  1186. <update id="updateBMModal">
  1187. update plm_bm_model_header
  1188. set properties_code_no=#{propertiesCodeNo},
  1189. active=#{active}
  1190. where site = #{site}
  1191. and bu_no = #{buNo}
  1192. and code_no = #{codeNo}
  1193. </update>
  1194. <select id="checkBMModelHeader" resultType="PlmBmModelHeaderData">
  1195. select properties_code_no
  1196. from plm_bm_model_header
  1197. where site = #{site}
  1198. and bu_no = #{buNo}
  1199. and code_no = #{type}
  1200. </select>
  1201. <select id="searchBMPropertiesHeaderForBM" resultType="PlmBmModelHeaderData">
  1202. select properties_code_no
  1203. from plm_bm_model_header
  1204. where site = #{site}
  1205. and bu_no = #{buNo}
  1206. and code_no = #{type}
  1207. </select>
  1208. <!-- Ink Mixing 油墨房-->
  1209. <select id="searchBMInkMixingDetail" resultType="PlmBmInkMixingData">
  1210. select
  1211. site,
  1212. code_no,
  1213. colourMatch,
  1214. visuallySetting,
  1215. indicate,
  1216. customerFile,
  1217. remarks,
  1218. [action],
  1219. update_date,
  1220. update_by,
  1221. operation_no
  1222. from plm_bm_InkMixing
  1223. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1224. </select>
  1225. <insert id="saveBMInkMixingDetail">
  1226. insert into plm_bm_InkMixing (site, code_no, colourMatch, visuallySetting, indicate, customerFile, remarks,
  1227. [action], update_date, update_by, operation_no)
  1228. values (#{site}, #{codeNo}, #{colourMatch}, #{visuallySetting}, #{indicate}, #{customerFile}, #{remarks},
  1229. #{action}, GetDate(), #{updateBy}, #{operationNo})
  1230. </insert>
  1231. <update id="updateBMInkMixingDetail">
  1232. update plm_bm_InkMixing
  1233. set colourMatch = #{colourMatch},
  1234. visuallySetting = #{visuallySetting},
  1235. indicate = #{indicate},
  1236. customerFile = #{customerFile},
  1237. [action] = #{action},
  1238. remarks = #{remarks},
  1239. update_date = GetDate(),
  1240. update_by = #{updateBy}
  1241. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1242. </update>
  1243. <select id="searchBMInkMixingColor" resultType="PlmBmInkMixingColorData">
  1244. select
  1245. site,
  1246. code_no,
  1247. [order],
  1248. color,
  1249. [type],
  1250. supplier,
  1251. inkUsage,
  1252. mixTime,
  1253. standbyTime,
  1254. Viscosity,
  1255. RecycleTimes,
  1256. update_by,
  1257. update_date,
  1258. id,
  1259. operation_no
  1260. from plm_bm_InkMixingColor
  1261. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1262. order by [order]
  1263. </select>
  1264. <insert id="saveBMInkMixingColor">
  1265. insert into plm_bm_InkMixingColor (site, code_no, [order], color, [type], supplier, inkUsage, mixTime,
  1266. standbyTime, Viscosity, RecycleTimes, update_by, update_date, operation_no)
  1267. values (#{site}, #{codeNo}, #{order}, #{color}, #{type}, #{supplier}, #{inkUsage}, #{mixTime}, #{standbyTime},
  1268. #{viscosity}, #{recycleTimes}, #{updateBy}, GetDate(), #{operationNo})
  1269. </insert>
  1270. <update id="updateBMInkMixingColor">
  1271. update plm_bm_InkMixingColor
  1272. set [order] = #{order},
  1273. color = #{color},
  1274. [type] = #{type},
  1275. supplier = #{supplier},
  1276. inkUsage = #{inkUsage},
  1277. mixTime = #{mixTime},
  1278. standbyTime = #{standbyTime},
  1279. Viscosity = #{viscosity},
  1280. RecycleTimes = #{recycleTimes},
  1281. update_date = GetDate(),
  1282. update_by = #{updateBy}
  1283. where id = #{id}
  1284. </update>
  1285. <delete id="deleteBMInkMixingColor">
  1286. delete
  1287. from plm_bm_InkMixingColor
  1288. where id = #{id}
  1289. </delete>
  1290. <select id="checkPlmBmInkMixingColorOrder" resultType="PlmBmInkMixingColorData">
  1291. select site
  1292. from plm_bm_InkMixingColor
  1293. where site = #{site} and code_no = #{codeNo} and [order] = #{order} and operation_no = #{operationNo}
  1294. </select>
  1295. <!-- Ink Formulation 油墨配方-->
  1296. <select id="searchBMInkFormulationDetail" resultType="PlmBmInkFormulationData">
  1297. select
  1298. Site,
  1299. code_no,
  1300. remarks,
  1301. label_size,
  1302. qpa,
  1303. [action],
  1304. [cross],
  1305. row,
  1306. hp,
  1307. vp,
  1308. update_date,
  1309. update_by,
  1310. operation_no
  1311. from plm_bm_InkFormulation
  1312. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1313. </select>
  1314. <insert id="saveBMInkFormulationDetail">
  1315. insert into plm_bm_InkFormulation (Site, code_no, remarks, label_size, qpa, [action], [cross], row, hp, vp,
  1316. update_date, update_by, operation_no)
  1317. values (#{site}, #{codeNo}, #{remarks}, #{labelSize}, #{qpa}, #{action}, #{cross}, #{row}, #{hp}, #{vp},
  1318. GetDate(), #{updateBy}, #{operationNo})
  1319. </insert>
  1320. <update id="updateBMInkFormulationDetail">
  1321. update plm_bm_InkFormulation
  1322. set remarks=#{remarks}
  1323. , label_size=#{labelSize}
  1324. , qpa=#{qpa}
  1325. , [action]=#{action}
  1326. , [cross]=#{cross}
  1327. , row=#{row}
  1328. , [hp]=#{hp}
  1329. , vp=#{vp}
  1330. , update_date=GetDate()
  1331. , update_by=#{updateBy}
  1332. where site = #{site}
  1333. and code_no = #{codeNo}
  1334. and operation_no = #{operationNo}
  1335. </update>
  1336. <select id="searchBMInkFormulationColor" resultType="PlmBmInkFormulationColorData">
  1337. select
  1338. site,
  1339. code_no,
  1340. [order],
  1341. hardness,
  1342. tartness,
  1343. printingSide,
  1344. energy,
  1345. dry_speed,
  1346. dry_time,
  1347. dry_temp,
  1348. dry_time2,
  1349. update_date,
  1350. update_by,
  1351. id,
  1352. operation_no
  1353. from plm_bm_InkFormulationColor
  1354. where site = #{site}
  1355. and code_no = #{codeNo}
  1356. and operation_no = #{operationNo}
  1357. order by [order]
  1358. </select>
  1359. <insert id="saveBMInkFormulationColor">
  1360. insert into plm_bm_InkFormulationColor (site, code_no, [order], hardness, tartness, printingSide, energy,
  1361. dry_speed, dry_time, dry_temp, dry_time2, update_date, update_by, operation_no)
  1362. values (#{site}, #{codeNo}, #{order}, #{hardness}, #{tartness}, #{printingSide}, #{energy}, #{drySpeed},
  1363. #{dryTime}, #{dryTemp}, #{dryTime2}, GetDate(), #{updateBy}, #{operationNo})
  1364. </insert>
  1365. <update id="updateBMInkFormulationColor">
  1366. update plm_bm_InkFormulationColor
  1367. set [order]=#{order},
  1368. hardness=#{hardness},
  1369. [tartness]=#{tartness},
  1370. printingSide=#{printingSide},
  1371. energy=#{energy},
  1372. dry_speed=#{drySpeed},
  1373. dry_time=#{dryTime},
  1374. dry_temp=#{dryTemp},
  1375. dry_time2=#{dryTime2},
  1376. update_date=GetDate(),
  1377. update_by=#{updateBy}
  1378. where id = #{id}
  1379. </update>
  1380. <delete id="deleteBMInkFormulationColor">
  1381. delete
  1382. from plm_bm_InkFormulationColor
  1383. where id = #{id}
  1384. </delete>
  1385. <select id="checkPlmBmInkFormulationColorOrder" resultType="PlmBmInkFormulationColorData">
  1386. select site
  1387. from plm_bm_InkFormulationColor
  1388. where site = #{site}
  1389. and code_no = #{codeNo}
  1390. and [order] = #{order}
  1391. and operation_no = #{operationNo}
  1392. </select>
  1393. <!-- Lamination 覆膜 -->
  1394. <select id="searchBMLaminationDetail" resultType="PlmBmLaminationData">
  1395. select
  1396. site,
  1397. code_no,
  1398. [action],
  1399. update_date,
  1400. update_by,
  1401. remark,
  1402. operation_no
  1403. from plm_bm_Lamination
  1404. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1405. </select>
  1406. <insert id="saveBMLaminationDetail">
  1407. insert into plm_bm_Lamination (site, code_no, [action], update_date, update_by, remark, operation_no)
  1408. values (#{site}, #{codeNo}, #{action}, GetDate(), #{updateBy}, #{remark}, #{operationNo})
  1409. </insert>
  1410. <update id="updateBMLaminationDetail">
  1411. update plm_bm_Lamination
  1412. set remark=#{remark},
  1413. [action]=#{action},
  1414. update_date=GetDate(),
  1415. update_by=#{updateBy}
  1416. where site = #{site}
  1417. and code_no = #{codeNo}
  1418. and operation_no = #{operationNo}
  1419. </update>
  1420. <select id="searchBMLaminationCut" resultType="PlmBmLaminationCutData">
  1421. select site,
  1422. code_no,
  1423. [order],
  1424. station,
  1425. processStep,
  1426. machine,
  1427. laminationType,
  1428. rm_partNo,
  1429. rm_partNo2,
  1430. film_partNo,
  1431. lamination_side,
  1432. remarks,
  1433. update_date,
  1434. update_by,
  1435. id,
  1436. operation_no
  1437. from plm_bm_LaminationCut
  1438. where site = #{site}
  1439. and code_no = #{codeNo}
  1440. and operation_no = #{operationNo}
  1441. order by [order]
  1442. </select>
  1443. <insert id="saveBMLaminationCut">
  1444. insert into plm_bm_LaminationCut (site, code_no, [order], station, processStep, machine, laminationType,
  1445. rm_partNo, rm_partNo2, film_partNo, lamination_side, remarks,
  1446. update_date, update_by, operation_no)
  1447. values (#{site}, #{codeNo}, #{order}, #{station}, #{processStep}, #{machine}, #{laminationType}, #{rmPartNo},
  1448. #{rmPartNo2}, #{filmPartNo}, #{laminationSide}, #{remarks},
  1449. GetDate(), #{updateBy}, #{operationNo})
  1450. </insert>
  1451. <update id="updateBMLaminationCut">
  1452. update plm_bm_LaminationCut
  1453. set [order]=#{order},
  1454. station=#{station},
  1455. [processStep]=#{processStep},
  1456. machine=#{machine},
  1457. laminationType=#{laminationType},
  1458. rm_partNo=#{rmPartNo},
  1459. rm_partNo2=#{rmPartNo2},
  1460. film_partNo=#{filmPartNo},
  1461. lamination_side=#{laminationSide},
  1462. remarks=#{remarks},
  1463. update_date=GetDate(),
  1464. update_by=#{updateBy}
  1465. where id = #{id}
  1466. </update>
  1467. <delete id="deleteBMLaminationCut">
  1468. delete
  1469. from plm_bm_LaminationCut
  1470. where id = #{id}
  1471. </delete>
  1472. <select id="checkPlmBmLaminationCutOrder" resultType="PlmBmLaminationCutData">
  1473. select site
  1474. from plm_bm_LaminationCut
  1475. where site = #{site}
  1476. and code_no = #{codeNo}
  1477. and [order] = #{order}
  1478. and operation_no = #{operationNo}
  1479. </select>
  1480. <!-- Cnc -->
  1481. <select id="searchBMCncDetail" resultType="PlmBmCncData">
  1482. select
  1483. site,
  1484. code_no,
  1485. [action],
  1486. update_date,
  1487. update_by,
  1488. operation_no
  1489. from plm_bm_Cnc
  1490. where site = #{site}
  1491. and code_no = #{codeNo}
  1492. and operation_no = #{operationNo}
  1493. </select>
  1494. <insert id="saveBMCncDetail">
  1495. insert into plm_bm_Cnc (site, code_no, [action], update_date, update_by, operation_no)
  1496. values (#{site}, #{codeNo}, #{action}, GetDate(), #{updateBy}, #{operationNo})
  1497. </insert>
  1498. <update id="updateBMCncDetail">
  1499. update plm_bm_Cnc
  1500. set [action]=#{action},
  1501. update_date=GetDate(),
  1502. update_by=#{updateBy}
  1503. where site = #{site}
  1504. and code_no = #{codeNo}
  1505. and operation_no = #{operationNo}
  1506. </update>
  1507. <select id="searchBMCncCut" resultType="PlmBmCncCutData">
  1508. select site,
  1509. code_no,
  1510. [order],
  1511. cutting_machine,
  1512. program_name,
  1513. cutting_speed,
  1514. spec,
  1515. p2c,
  1516. c2c,
  1517. remarks,
  1518. update_date,
  1519. update_by,
  1520. id,
  1521. operation_no
  1522. from plm_bm_CncCut
  1523. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1524. order by [order]
  1525. </select>
  1526. <insert id="saveBMCncCut">
  1527. insert into plm_bm_CncCut (site, code_no, [order], cutting_machine, program_name, cutting_speed, spec, p2c, c2c,
  1528. remarks, update_date, update_by, operation_no)
  1529. values (#{site}, #{codeNo}, #{order}, #{cuttingMachine}, #{programName}, #{cuttingSpeed}, #{spec}, #{p2c},
  1530. #{c2c}, #{remarks}, GetDate(), #{updateBy}, #{operationNo})
  1531. </insert>
  1532. <update id="updateBMCncCut">
  1533. update plm_bm_CncCut
  1534. set [order]=#{order},
  1535. cutting_machine=#{cuttingMachine},
  1536. [program_name]=#{programName},
  1537. cutting_speed=#{cuttingSpeed},
  1538. spec=#{spec},
  1539. p2c=#{p2c},
  1540. c2c=#{c2c},
  1541. remarks=#{remarks},
  1542. update_date=GetDate(),
  1543. update_by=#{updateBy}
  1544. where id = #{id}
  1545. </update>
  1546. <delete id="deleteBMCncCut">
  1547. delete
  1548. from plm_bm_CncCut
  1549. where id = #{id}
  1550. </delete>
  1551. <select id="checkPlmBmCncCutOrder" resultType="PlmBmCncCutData">
  1552. select site
  1553. from plm_bm_CncCut
  1554. where site = #{site}
  1555. and code_no = #{codeNo}
  1556. and [order] = #{order}
  1557. and operation_no = #{operationNo}
  1558. </select>
  1559. <!-- Cut -->
  1560. <select id="searchBMCutDetail" resultType="PlmBmCutData">
  1561. select site, code_no, [action], remarks, update_date, update_by, operation_no
  1562. from plm_bm_Cut
  1563. where site = #{site}
  1564. and code_no = #{codeNo}
  1565. and operation_no = #{operationNo}
  1566. </select>
  1567. <insert id="saveBMCutDetail">
  1568. insert into plm_bm_Cut (site, code_no, [action], update_date, update_by, remarks, operation_no)
  1569. values (#{site}, #{codeNo}, #{action}, GetDate(), #{updateBy}, #{remarks}, #{operationNo})
  1570. </insert>
  1571. <update id="updateBMCutDetail">
  1572. update plm_bm_Cut
  1573. set [action]=#{action},
  1574. remarks=#{remarks},
  1575. update_date=GetDate(),
  1576. update_by=#{updateBy}
  1577. where site = #{site}
  1578. and code_no = #{codeNo}
  1579. and operation_no = #{operationNo}
  1580. </update>
  1581. <select id="searchBMCutCut" resultType="PlmBmCutCutData">
  1582. select site,
  1583. code_no,
  1584. [order],
  1585. cutting_machine,
  1586. cutting_type,
  1587. cutting_tooling,
  1588. cutter_no,
  1589. cutter_layout,
  1590. cutter_cost,
  1591. program_name,
  1592. program_path,
  1593. p2c,
  1594. c2c,
  1595. update_by,
  1596. update_date,
  1597. id,
  1598. operation_no
  1599. from plm_bm_CutCut
  1600. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1601. order by [order]
  1602. </select>
  1603. <insert id="saveBMCutCut">
  1604. insert into plm_bm_CutCut (site, code_no, [order], cutting_machine, cutting_type, cutting_tooling, cutter_no,
  1605. cutter_layout, cutter_cost, program_name,
  1606. program_path, p2c, c2c, update_by, update_date, operation_no)
  1607. values (#{site}, #{codeNo}, #{order}, #{cuttingMachine}, #{cuttingType}, #{cuttingTooling}, #{cutterNo},
  1608. #{cutterLayout}, #{cutterCost}, #{programName},
  1609. #{programPath}, #{p2c}, #{c2c}, #{updateBy}, GetDate(), #{operationNo})
  1610. </insert>
  1611. <update id="updateBMCutCut">
  1612. update plm_bm_CutCut
  1613. set [order] = #{order},
  1614. cutting_machine = #{cuttingMachine},
  1615. [cutting_type] = #{cuttingType},
  1616. cutting_tooling = #{cuttingTooling},
  1617. cutter_no = #{cutterNo},
  1618. cutter_layout = #{cutterLayout},
  1619. cutter_cost = #{cutterCost},
  1620. program_name = #{programName},
  1621. p2c = #{p2c},
  1622. c2c = #{c2c},
  1623. program_path = #{programPath},
  1624. update_date = GetDate(),
  1625. update_by = #{updateBy}
  1626. where id = #{id}
  1627. </update>
  1628. <delete id="deleteBMCutCut">
  1629. delete
  1630. from plm_bm_CutCut
  1631. where id = #{id}
  1632. </delete>
  1633. <select id="checkPlmBmCutCutOrder" resultType="PlmBmCutCutData">
  1634. select site
  1635. from plm_bm_CutCut
  1636. where site = #{site}
  1637. and code_no = #{codeNo}
  1638. and [order] = #{order}
  1639. and operation_no = #{operationNo}
  1640. </select>
  1641. <!-- printing 印刷-->
  1642. <select id="searchBMPrintingDetail" resultType="PlmBmPrintingData">
  1643. select site,
  1644. code_no,
  1645. colour_match,
  1646. conditions,
  1647. colour_indicat,
  1648. customer_file,
  1649. glossiness_requirement,
  1650. comments,
  1651. repeat,
  1652. vp,
  1653. label_size,
  1654. down,
  1655. plate_distortion_rate,
  1656. actual_number,
  1657. print_position,
  1658. goods_roll_width,
  1659. update_date,
  1660. update_by,
  1661. printLayout
  1662. from plm_bm_Printing
  1663. where site = #{site}
  1664. and code_no = #{codeNo}
  1665. </select>
  1666. <insert id="saveBMPrintingDetail">
  1667. insert into plm_bm_Printing (site, code_no, colour_match, conditions, colour_indicat, customer_file,
  1668. glossiness_requirement, comments, repeat, vp, label_size,
  1669. down, plate_distortion_rate, actual_number, print_position, goods_roll_width,
  1670. update_date, update_by, printLayout)
  1671. values (#{site}, #{codeNo}, #{colourMatch}, #{conditions}, #{colourIndicat}, #{customerFile},
  1672. #{glossinessRequirement}, #{comments},
  1673. #{repeat}, #{vp}, #{labelSize}, #{down}, #{plateDistortionRate}, #{actualNumber}, #{printPosition},
  1674. #{goodsRollWidth},
  1675. GetDate(), #{updateBy}, #{printLayout})
  1676. </insert>
  1677. <update id="updateBMPrintingDetail">
  1678. update plm_bm_Printing
  1679. set printLayout=#{printLayout},
  1680. colour_match=#{colourMatch},
  1681. conditions=#{conditions},
  1682. colour_indicat=#{colourIndicat},
  1683. customer_file=#{customerFile},
  1684. glossiness_requirement=#{glossinessRequirement},
  1685. comments=#{comments},
  1686. repeat=#{repeat},
  1687. vp=#{vp},
  1688. label_size=#{labelSize},
  1689. down=#{down},
  1690. plate_distortion_rate=#{plateDistortionRate},
  1691. actual_number=#{actualNumber},
  1692. print_position=#{printPosition},
  1693. goods_roll_width=#{goodsRollWidth},
  1694. update_date=GetDate(),
  1695. update_by=#{updateBy}
  1696. where site = #{site}
  1697. and code_no = #{codeNo}
  1698. </update>
  1699. <select id="searchBMPrintingColor" resultType="PlmBmPrintingColorData">
  1700. select
  1701. site,
  1702. code_no,
  1703. [order],
  1704. ink_type,
  1705. color_reference,
  1706. color_match,
  1707. bcm,
  1708. speed,
  1709. dry,
  1710. gallus,
  1711. mark_andy,
  1712. lp,
  1713. Hexiang,
  1714. update_date,
  1715. update_by,
  1716. id,
  1717. resource_no,
  1718. operation_no
  1719. from plm_bm_PrintingColor
  1720. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1721. order by [order]
  1722. </select>
  1723. <insert id="saveBMPrintingColor">
  1724. insert into plm_bm_PrintingColor
  1725. (site, code_no, [order], ink_type, color_reference, color_match, bcm, speed,
  1726. dry, gallus, mark_andy, lp, Hexiang, update_by, update_date, resource_no, operation_no)
  1727. values
  1728. (#{site}, #{codeNo}, #{order}, #{inkType}, #{colorReference}, #{colorMatch}, #{bcm}, #{speed},
  1729. #{dry}, #{gallus}, #{markAndy}, #{lp}, #{hexiang}, #{updateBy}, GetDate(), #{resourceNo}, #{operationNo})
  1730. </insert>
  1731. <insert id="saveBMPrintingColors">
  1732. insert into plm_bm_PrintingColor
  1733. (site, code_no, [order], ink_type, color_reference, color_match, bcm, speed,
  1734. dry, gallus, mark_andy, lp, Hexiang, update_by, update_date, resource_no, operation_no)
  1735. values
  1736. <foreach collection="list" item="item" index="index" separator=",">
  1737. (#{item.site}, #{item.codeNo}, #{item.order}, #{item.inkType}, #{item.colorReference}, #{item.colorMatch}, #{item.bcm}, #{item.speed},
  1738. #{item.dry}, #{item.gallus}, #{item.markAndy}, #{item.lp}, #{item.hexiang}, #{item.updateBy}, GetDate(), #{item.resourceNo}, #{item.operationNo})
  1739. </foreach>
  1740. </insert>
  1741. <update id="updateBMPrintingColor">
  1742. update plm_bm_PrintingColor
  1743. set [order] = #{order},
  1744. ink_type = #{inkType},
  1745. [color_reference] = #{colorReference},
  1746. color_match = #{colorMatch},
  1747. bcm = #{bcm},
  1748. speed = #{speed},
  1749. dry = #{dry},
  1750. gallus = #{gallus},
  1751. mark_andy = #{markAndy},
  1752. lp = #{lp},
  1753. Hexiang = #{hexiang},
  1754. update_date = GetDate(),
  1755. update_by = #{updateBy},
  1756. resource_no = #{resourceNo}
  1757. where id = #{id}
  1758. </update>
  1759. <delete id="deleteBMPrintingColor">
  1760. delete from plm_bm_PrintingColor
  1761. where id = #{id}
  1762. </delete>
  1763. <delete id="deleteBMPrintingColorByCodeNo">
  1764. delete from plm_bm_PrintingColor
  1765. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  1766. </delete>
  1767. <select id="checkPlmBmPrintingColorOrder" resultType="PlmBmPrintingColorData">
  1768. select site
  1769. from plm_bm_PrintingColor
  1770. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo} and [order] = #{order}
  1771. </select>
  1772. <select id="getBomNowRevNo" resultType="com.spring.modules.part.entity.BomHeaderEntity">
  1773. select top 1 eng_chg_level, bom_type, site, part_no
  1774. from plm_bom_header
  1775. where site = #{site}
  1776. and part_no = #{partNo}
  1777. and GetDate() > eff_phase_in_date
  1778. and isnull(eff_phase_out_date, DATEADD(d, 1, GETDATE())) > GetDate()
  1779. </select>
  1780. <select id="getTopOneBomAlternativeNo" resultType="com.spring.modules.part.entity.BomDetailEntity">
  1781. select top 1 site, part_no, alternative_no, alternative_description, bom_type, eng_chg_level
  1782. from plm_bom_detail
  1783. where site = #{site}
  1784. and part_no = #{partNo}
  1785. and bom_type = #{bomType}
  1786. and eng_chg_level = #{engChgLevel}
  1787. </select>
  1788. <select id="getRouteNowRevNo" resultType="com.spring.modules.part.entity.RoutingHeaderEntity">
  1789. select top 1 site, part_no, routing_revision, routing_type
  1790. from plm_routing_header
  1791. where site = #{site}
  1792. and part_no = #{partNo}
  1793. and GetDate() > phase_in_date
  1794. and isnull(phase_out_date, DATEADD(d, 1, GETDATE())) > GetDate()
  1795. </select>
  1796. <select id="getTopOneRouteAlternativeNo" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  1797. select top 1 site, part_no, routing_revision, routing_type, alternative_no, alternative_description
  1798. from plm_routing_detail
  1799. where site = #{site}
  1800. and part_no = #{partNo}
  1801. and routing_type = #{routingType}
  1802. and routing_revision = #{routingRevision}
  1803. </select>
  1804. <select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity">
  1805. select
  1806. a.site,
  1807. a.bom_type,
  1808. a.eng_chg_level,
  1809. a.bom_alternative_no alternativeNo,
  1810. b.final_part_no partNo,
  1811. a.url_file
  1812. from plm_technical_specification_sheet a
  1813. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  1814. left join plm_bom_detail c on a.site = c.site and b.final_part_no = c.part_no and a.eng_chg_level = c.eng_chg_level and a.bom_alternative_no = c.alternative_no and a.bom_type = c.bom_type
  1815. where a.site = #{site}
  1816. and a.code_no = #{codeNo}
  1817. and a.project_id = b.project_id
  1818. and c.status = 'Buildable'
  1819. </select>
  1820. <select id="getBMRouteDetail" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
  1821. select
  1822. a.site,
  1823. a.routing_type,
  1824. a.routing_revision,
  1825. a.routing_alternative_no alternativeNo,
  1826. b.final_part_no partNo
  1827. from plm_technical_specification_sheet a
  1828. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  1829. left join plm_routing_detail c on a.site = c.site and b.final_part_no = c.part_no AND a.routing_revision = c.routing_revision and a.routing_alternative_no = c.alternative_no and a.routing_type = c.routing_type
  1830. where a.site = #{site}
  1831. and a.code_no = #{codeNo}
  1832. and a.project_id = b.project_id
  1833. and c.status = 'Buildable'
  1834. </select>
  1835. <select id="searchBMBomDetail" resultType="com.spring.modules.part.vo.BomDetailVo">
  1836. select a.site,
  1837. a.part_no,
  1838. b.alternative_no,
  1839. b.alternative_description,
  1840. a.bom_type,
  1841. a.eng_chg_level,
  1842. b.min_lot_qty,
  1843. b.default_flag,
  1844. a.note_text,
  1845. a.create_date,
  1846. a.create_by,
  1847. a.update_date,
  1848. a.update_by,
  1849. b.status,
  1850. a.official_flag,
  1851. a.eff_phase_in_date,
  1852. a.eff_phase_out_date
  1853. from plm_bom_header a
  1854. left join plm_bom_detail b
  1855. on a.site = b.site and a.part_no = b.part_NO and a.bom_type = b.bom_type AND
  1856. A.eng_chg_level = B.eng_chg_level
  1857. where a.part_no = #{partNo}
  1858. and a.site = #{site}
  1859. and a.bom_type != 'Repair'
  1860. and b.status = 'Buildable'
  1861. </select>
  1862. <update id="updateBMBomRev">
  1863. update plm_technical_specification_sheet
  1864. set bom_type=#{bomType},
  1865. eng_chg_level=#{engChgLevel,jdbcType=INTEGER},
  1866. bom_alternative_no=#{bomAlternativeNo}
  1867. where site = #{site}
  1868. and code_no = #{codeNo}
  1869. </update>
  1870. <update id="updateBMProcessBom">
  1871. update plm_technical_specification_sheet
  1872. set url_file = #{urlFile}
  1873. where site = #{site} and code_no = #{codeNo}
  1874. </update>
  1875. <update id="updateBMRouteRev">
  1876. update plm_technical_specification_sheet
  1877. set routing_type=#{routingType},
  1878. routing_revision=#{routingRevision,jdbcType=INTEGER},
  1879. routing_alternative_no=#{routingAlternativeNo}
  1880. where site = #{site}
  1881. and code_no = #{codeNo}
  1882. </update>
  1883. <select id="searchRouteDetail" resultType="com.spring.modules.part.vo.RoutingDetailVo">
  1884. select a.site,
  1885. a.part_no,
  1886. a.routing_revision,
  1887. a.routing_type,
  1888. b.alternative_no,
  1889. b.alternative_description,
  1890. b.status,
  1891. a.official_flag,
  1892. a.phase_in_date,
  1893. a.phase_out_date
  1894. from plm_routing_header a
  1895. left join plm_routing_detail b
  1896. on a.site = b.site and a.part_no = b.part_NO and a.routing_type = b.routing_type AND
  1897. A.routing_revision = B.routing_revision
  1898. where a.site = #{site}
  1899. and a.part_no = #{partNo}
  1900. and a.routing_type != 'Repair'
  1901. and b.status = 'Buildable'
  1902. </select>
  1903. <select id="searchBMRemarkPage" resultType="PlmTechnicalSpecificationSheetData">
  1904. select site, remarkPage, code_no
  1905. from plm_technical_specification_sheet
  1906. where site = #{site}
  1907. and code_no = #{codeNo}
  1908. </select>
  1909. <update id="updateBMRemarkPage">
  1910. update plm_technical_specification_sheet
  1911. set remarkPage=#{remarkPage}
  1912. where site = #{site}
  1913. and code_no = #{codeNo}
  1914. </update>
  1915. <select id="searchPartLastQuotationNo" resultType="com.spring.modules.quotation.entity.QuotationHeader">
  1916. select top 1 a.site, a.quotation_no
  1917. from quotation_header a
  1918. left join quotation_detail b on a.quotation_header_id = b.quotation_header_id
  1919. where b.site = #{site}
  1920. and b.product_no = #{productNo}
  1921. order by a.create_time desc
  1922. </select>
  1923. <select id="getSysProxyAddress" resultType="SysProxyAddress">
  1924. select physicalAddress, proxyAddress, remark
  1925. from sys_proxy_address
  1926. </select>
  1927. <select id="searchBMprintFlexoColor" resultType="PlmBmPrintFlexoColorData">
  1928. select
  1929. a.id,
  1930. a.site,
  1931. a.codeNo,
  1932. a.printSide,
  1933. [order],
  1934. a.colorReference,
  1935. a.inkCode,
  1936. p.part_desc as inkDesc,
  1937. a.colorMatch,
  1938. a.lpi,
  1939. a.bcm,
  1940. a.openFlag,
  1941. a.gallus,
  1942. a.markAndy,
  1943. a.hexiang,
  1944. a.temperature,
  1945. a.pressure,
  1946. a.updateDate,
  1947. a.updateBy,
  1948. a.resource_no,
  1949. a.speed,
  1950. a.show_order,
  1951. a.operation_no,
  1952. a.remark
  1953. from plm_bm_printFlexoColor as a
  1954. left join part as p on a.site = p.site and a.inkCode = p.part_no
  1955. where a.site = #{site} and a.codeNo = #{codeNo} and a.operation_no = #{operationNo}
  1956. order by a.show_order
  1957. </select>
  1958. <select id="checkBMprintFlexoColorOrder" resultType="PlmBmPrintFlexoColorData">
  1959. select id, site, codeNo, printSide, [order], operation_no
  1960. from plm_bm_printFlexoColor
  1961. where site = #{site}
  1962. and codeNo = #{codeNo}
  1963. and printSide = #{printSide}
  1964. and [order] = #{order}
  1965. and operation_no = #{operationNo}
  1966. </select>
  1967. <insert id="saveBMprintFlexoColor">
  1968. insert into plm_bm_printFlexoColor
  1969. (site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
  1970. bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate, updateBy, remark, resource_no, speed, show_order, operation_no)
  1971. values
  1972. (#{site}, #{codeNo}, #{printSide}, #{order}, #{colorReference}, #{inkCode}, #{colorMatch}, #{lpi},
  1973. #{bcm}, #{openFlag}, #{gallus}, #{markAndy}, #{hexiang}, #{temperature}, #{pressure}, GetDate(), #{updateBy}, #{remark}, #{resourceNo}, #{speed}, #{showOrder}, #{operationNo})
  1974. </insert>
  1975. <insert id="saveBMPrintFlexoColors">
  1976. insert into plm_bm_printFlexoColor
  1977. (site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
  1978. bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate,
  1979. updateBy, remark, resource_no, speed, show_order, operation_no)
  1980. values
  1981. <foreach collection="list" item="item" index="index" separator=",">
  1982. (#{item.site}, #{item.codeNo}, #{item.printSide}, #{item.order}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch}, #{item.lpi},
  1983. #{item.bcm}, #{item.openFlag}, #{item.gallus}, #{item.markAndy}, #{item.hexiang}, #{item.temperature}, #{item.pressure}, GetDate(),
  1984. #{item.updateBy}, #{item.remark}, #{item.resourceNo}, #{item.speed}, #{item.showOrder}, #{item.operationNo})
  1985. </foreach>
  1986. </insert>
  1987. <update id="updateBMprintFlexoColor">
  1988. update plm_bm_printFlexoColor
  1989. set printSide = #{printSide},
  1990. [order] = #{order,jdbcType=INTEGER},
  1991. show_order = #{showOrder},
  1992. colorReference = #{colorReference},
  1993. inkCode = #{inkCode},
  1994. colorMatch = #{colorMatch},
  1995. lpi = #{lpi},
  1996. bcm = #{bcm},
  1997. openFlag = #{openFlag},
  1998. gallus = #{gallus},
  1999. markAndy = #{markAndy},
  2000. hexiang = #{hexiang},
  2001. temperature = #{temperature},
  2002. pressure = #{pressure},
  2003. updateDate = GetDate(),
  2004. updateBy = #{updateBy},
  2005. remark = #{remark},
  2006. resource_no = #{resourceNo},
  2007. speed = #{speed}
  2008. where id = #{id}
  2009. </update>
  2010. <delete id="deleteBMprintFlexoColor">
  2011. delete from plm_bm_printFlexoColor
  2012. where id = #{id}
  2013. </delete>
  2014. <delete id="deleteBMPrintFlexoColorByCodeNo">
  2015. delete from plm_bm_printFlexoColor
  2016. where site = #{site} and codeNo = #{codeNo} and operation_no = #{operationNo}
  2017. </delete>
  2018. <select id="searchBMprintIndigoColor" resultType="PlmBmPrintIndigoColorData">
  2019. select
  2020. a.id,
  2021. a.code_no,
  2022. a.site,
  2023. [order],
  2024. a.printSide,
  2025. a.colorReference,
  2026. a.inkCode,
  2027. p.part_desc as inkDesc,
  2028. a.colorMatch,
  2029. a.printMotion,
  2030. a.opticalDensity,
  2031. a.lut,
  2032. a.lpi,
  2033. a.screenAngle,
  2034. a.printHits,
  2035. a.blanketTemperture,
  2036. a.remark,
  2037. a.updateBy,
  2038. a.updateDate,
  2039. a.show_order,
  2040. a.operation_no
  2041. from plm_bm_printIndigoColor as a
  2042. left join part as p on a.site = p.site and a.inkCode = p.part_no
  2043. where a.site = #{site} and a.code_no = #{codeNo} and a.operation_no = #{operationNo}
  2044. order by a.show_order
  2045. </select>
  2046. <select id="checkBMprintIndigoColorOrder" resultType="PlmBmPrintIndigoColorData">
  2047. select id, site, code_no, printSide, [order]
  2048. from plm_bm_printIndigoColor
  2049. where site = #{site}
  2050. and code_no = #{codeNo}
  2051. and printSide = #{printSide}
  2052. and [order] = #{order}
  2053. </select>
  2054. <insert id="saveBMprintIndigoColor">
  2055. insert into plm_bm_printIndigoColor
  2056. (site, code_no, [order], printSide, colorReference, inkCode, colorMatch,
  2057. printMotion, opticalDensity, lut, lpi, screenAngle, printHits, blanketTemperture,
  2058. remark, updateBy, updateDate, show_order, operation_no)
  2059. values
  2060. (#{site}, #{codeNo}, #{order}, #{printSide}, #{colorReference}, #{inkCode}, #{colorMatch},
  2061. #{printMotion}, #{opticalDensity}, #{lut}, #{lpi}, #{screenAngle}, #{printHits}, #{blanketTemperture},
  2062. #{remark}, #{updateBy}, GetDate(), #{showOrder}, #{operationNo})
  2063. </insert>
  2064. <insert id="saveBMPrintIndigoColors">
  2065. insert into plm_bm_printIndigoColor
  2066. (site, code_no, [order], printSide, colorReference, inkCode, colorMatch,
  2067. printMotion, opticalDensity, lut, lpi, screenAngle, printHits, blanketTemperture,
  2068. remark, updateBy, updateDate, show_order, operation_no)
  2069. values
  2070. <foreach collection="list" item="item" index="index" separator=",">
  2071. (#{item.site}, #{item.codeNo}, #{item.order}, #{item.printSide}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch},
  2072. #{item.printMotion}, #{item.opticalDensity}, #{item.lut}, #{item.lpi}, #{item.screenAngle}, #{item.printHits}, #{item.blanketTemperture},
  2073. #{item.remark}, #{item.updateBy}, GetDate(), #{item.showOrder}, #{item.operationNo})
  2074. </foreach>
  2075. </insert>
  2076. <update id="updateBMprintIndigoColor">
  2077. update plm_bm_printIndigoColor
  2078. set printSide=#{printSide},
  2079. [order]=#{order,jdbcType=INTEGER},
  2080. show_order= #{showOrder},
  2081. colorReference=#{colorReference},
  2082. inkCode=#{inkCode},
  2083. colorMatch=#{colorMatch},
  2084. printMotion=#{printMotion},
  2085. opticalDensity=#{opticalDensity},
  2086. lut=#{lut},
  2087. lpi=#{lpi},
  2088. screenAngle=#{screenAngle},
  2089. printHits=#{printHits},
  2090. blanketTemperture=#{blanketTemperture},
  2091. remark=#{remark},
  2092. updateDate=GetDate(),
  2093. updateBy=#{updateBy}
  2094. where id = #{id}
  2095. </update>
  2096. <delete id="deleteBMprintIndigoColor">
  2097. delete
  2098. from plm_bm_printIndigoColor
  2099. where id = #{id}
  2100. </delete>
  2101. <delete id="deleteBMPrintIndigoColorByCodeNo">
  2102. delete from plm_bm_printIndigoColor
  2103. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  2104. </delete>
  2105. <select id="selectTechnicalSpecification" resultType="PlmTechnicalSpecificationSheet">
  2106. SELECT
  2107. id,
  2108. site,
  2109. code_no,
  2110. proofing_no,
  2111. project_id,
  2112. test_part_no,
  2113. status,
  2114. rev_no,
  2115. work_center_no,
  2116. ECN_flag,
  2117. ECN_no,
  2118. ECN_address,
  2119. remark,
  2120. create_date,
  2121. create_by,
  2122. update_date,
  2123. update_by,
  2124. picture_addess,
  2125. customerPictureChangeRemark,
  2126. productionFileComments,
  2127. ori_code_no,
  2128. bom_type,
  2129. eng_chg_level,
  2130. bom_alternative_no,
  2131. routing_type,
  2132. routing_revision,
  2133. routing_alternative_no,
  2134. remarkPage,
  2135. process,
  2136. stage,
  2137. materialType,
  2138. cqcOperator,
  2139. faiOperator,
  2140. overPrintOperator,
  2141. printOperator,
  2142. peOperater,
  2143. csOperater,
  2144. step_id,
  2145. reject_flag,
  2146. reject_step_id,
  2147. mpOperator,
  2148. pod,
  2149. relevance_part_no,
  2150. ecn_upgrade_version,
  2151. ecn_need_change_drawing,
  2152. ecn_upgrade_flag,
  2153. url_file,
  2154. copy_flag,
  2155. shop_order
  2156. FROM plm_technical_specification_sheet a
  2157. where a.site = #{site}
  2158. and a.code_no = #{codeNo}
  2159. </select>
  2160. <select id="getTechnicalSpecificationBuNo" resultType="java.lang.String">
  2161. select top 1 b.bu_no
  2162. from plm_technical_specification_sheet a
  2163. left join view_Project_final_Part b on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  2164. where a.site = #{site}
  2165. and a.code_no = #{codeNo}
  2166. and b.bu_no is not null
  2167. and b.bu_no &lt;&gt; ''
  2168. </select>
  2169. <update id="updateStatus" parameterType="PlmTechnicalSpecificationSheetData">
  2170. update plm_technical_specification_sheet
  2171. set status = #{status},
  2172. update_date = getDate(),
  2173. update_by = #{updateBy}
  2174. where site = #{site} and code_no = #{codeNo}
  2175. </update>
  2176. <update id="lockIssueStatus">
  2177. update plm_technical_specification_sheet
  2178. set status = #{toStatus},
  2179. update_date = getDate(),
  2180. update_by = #{updateBy}
  2181. where site = #{site}
  2182. and code_no = #{codeNo}
  2183. and status = #{fromStatus}
  2184. </update>
  2185. <select id="selectTechnicalSpecificationTeam" parameterType="string" resultType="PlmTechnicalSpecificationTeamData">
  2186. SELECT a.site,
  2187. a.code_no,
  2188. a.operator_id,
  2189. a.type,
  2190. b.domain_control_account
  2191. FROM plm_technicalSpecification_team as a
  2192. left join sys_user as b on a.operator_id = b.username
  2193. where a.site = #{site} and a.code_no = #{codeNo}
  2194. </select>
  2195. <select id="getBMStatusDesc" resultType="PlmTechnicalSpecificationSheetData">
  2196. SELECT id,
  2197. site,
  2198. code_no,
  2199. dbo.plm_get_technicalBaseDesc(a.status, 'status') statusDesc
  2200. FROM plm_technical_specification_sheet a
  2201. where a.site = #{site}
  2202. and a.code_no = #{codeNo}
  2203. </select>
  2204. <select id="getFinalPartData" resultType="PlmProjectPartData">
  2205. Select
  2206. a.Final_Part_No,
  2207. a.Test_part_no,
  2208. a.Active,
  2209. a.Part_desc,
  2210. a.project_id,
  2211. c.project_name,
  2212. pcpi.customer_part_no,
  2213. a.bu_no,
  2214. c.customer_id,
  2215. cus.customer_desc
  2216. from view_Project_final_Part as a
  2217. left join plm_project_info as c on a.site = c.site and a.project_id = c.project_id
  2218. left join plm_customer_part_info as pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  2219. left join plm_technical_specification_sheet d on a.site = d.site and a.test_part_no = d.test_part_no
  2220. left join plm_customer_information as cus on c.site = cus.site and c.customer_id = cus.customer_no
  2221. <where>
  2222. and d.test_part_no is null
  2223. and a.site = #{query.site}
  2224. <if test="query.projectId != null and query.projectId != ''">
  2225. AND a.project_id like #{query.projectId}
  2226. </if>
  2227. <if test="query.projectName != null and query.projectName != ''">
  2228. AND c.project_name like #{query.projectName}
  2229. </if>
  2230. <if test="query.customerId != null and query.customerId != ''">
  2231. AND c.customer_id like #{query.customerId}
  2232. </if>
  2233. <if test="query.customerDesc != null and query.customerDesc != ''">
  2234. AND cus.customer_desc like #{query.customerDesc}
  2235. </if>
  2236. <if test="query.finalPartNo != null and query.finalPartNo != ''">
  2237. AND a.Final_Part_No like #{query.finalPartNo}
  2238. </if>
  2239. <if test="query.customerPartNo != null and query.customerPartNo != ''">
  2240. AND pcpi.customer_part_no like #{query.customerPartNo}
  2241. </if>
  2242. <if test="query.testPartNo != null and query.testPartNo != ''">
  2243. AND a.Test_part_no like #{query.testPartNo}
  2244. </if>
  2245. <if test="query.partDesc != null and query.partDesc != ''">
  2246. AND a.Part_desc like #{query.partDesc}
  2247. </if>
  2248. and a.RealFlag = 'Y'
  2249. </where>
  2250. </select>
  2251. <select id="getOADetailForBM" resultType="PlmTechnicalSpecificationSheetData">
  2252. select
  2253. top 1
  2254. d.is_reject,
  2255. d.node_id,
  2256. d.node_name,
  2257. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  2258. a.url_file
  2259. from plm_technical_specification_sheet a
  2260. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  2261. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  2262. where a.site = #{site} and a.code_no = #{codeNo}
  2263. </select>
  2264. <select id="searchCopyPart" resultType="PlmProjectPartData">
  2265. Select
  2266. a.Final_Part_No,
  2267. a.Test_part_no,
  2268. a.Active,
  2269. a.Part_desc,
  2270. a.project_id,
  2271. pcpi.customer_part_no,
  2272. a.bu_no
  2273. from plm_project_info c
  2274. left join view_Project_Part a on a.site = c.site and a.project_id = c.project_id
  2275. left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  2276. left join part p on a.Final_Part_No = p.part_no
  2277. left join plm_technical_specification_sheet ps on a.site = ps.site and a.Test_part_no = ps.Test_part_no
  2278. <where>
  2279. a.site = #{query.site}
  2280. <if test = "query.buNo != null and query.buNo != ''">
  2281. AND a.bu_no = #{query.buNo}
  2282. </if>
  2283. <if test = "query.finalPartNo != null and query.finalPartNo != ''">
  2284. AND a.Final_Part_No LIKE #{query.finalPartNo}
  2285. </if>
  2286. <if test = "query.testPartNo != null and query.testPartNo != ''">
  2287. AND a.Test_Part_No LIKE #{query.testPartNo}
  2288. </if>
  2289. <if test = "query.projectId != null and query.projectId != ''">
  2290. AND a.project_id LIKE #{query.projectId}
  2291. </if>
  2292. <if test = "query.customerPartNo != null and query.customerPartNo != ''">
  2293. AND pcpi.customer_part_no LIKE #{query.customerPartNo}
  2294. </if>
  2295. and a.realFlag = 'Y'
  2296. and ps.Test_part_no is null
  2297. and dbo.Get_PartHasRealBOMRoute(a.site, a.Final_Part_No) = 'Y'
  2298. </where>
  2299. <!-- a.project_id = #{projectId}-->
  2300. <!-- and a.site = #{site}-->
  2301. <!-- and a.Test_part_no != #{testPartNo}-->
  2302. <!-- and a.realFlag = 'Y'-->
  2303. <!-- and ps.Test_part_no is null-->
  2304. <!-- and dbo.Get_PartHasRealBOMRoute(a.site, a.Final_Part_No) = 'Y'-->
  2305. </select>
  2306. <select id="queryCustomerPartNo" resultType="java.lang.String">
  2307. select top 1 pcpi.customer_part_no
  2308. from plm_customer_part_info pcpi
  2309. where pcpi.site = #{site}
  2310. and pcpi.customer_no = #{customerId}
  2311. and pcpi.part_no = #{partNo}
  2312. </select>
  2313. <insert id="saveCustomerPartNo">
  2314. insert into plm_customer_part_info
  2315. (site, customer_no, part_no, customer_part_no, create_date, create_by)
  2316. values
  2317. (#{site}, #{customerId}, #{partNo}, #{customerPartNo}, getdate(), #{username})
  2318. </insert>
  2319. <update id="updateCustomerPartNo">
  2320. update plm_customer_part_info
  2321. set customer_part_no = #{customerPartNo},
  2322. update_by = #{username},
  2323. update_date = getdate()
  2324. where site = #{site} and customer_no = #{customerId} and part_no = #{partNo}
  2325. </update>
  2326. <select id="technicalSpecificationList" resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2327. SELECT
  2328. a.id,
  2329. a.site,
  2330. a.code_no as codeNo,
  2331. a.project_id as projectId,
  2332. a.test_part_no as testPartNo,
  2333. a.status,
  2334. a.rev_no as revNo,
  2335. a.work_center_no as workCenterNo,
  2336. a.ECN_flag as ecnFlag,
  2337. a.ECN_no as ecnNo,
  2338. a.ori_code_no as oriCodeNo,
  2339. a.ECN_address as ecnAddress,
  2340. a.remark,
  2341. a.create_date as createDate,
  2342. a.create_by as createBy,
  2343. a.update_date as updateDate,
  2344. a.update_by as updateBy,
  2345. b.final_part_no as finalPartNo,
  2346. b.part_type as partTypeDesc,
  2347. b.part_type as partType,
  2348. b.part_name as partName,
  2349. b.part_desc as partDesc,
  2350. b.part_spec as partSpec,
  2351. dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
  2352. a.proofing_no as proofingNo,
  2353. b.bu_no as buNo,
  2354. dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
  2355. process,
  2356. c.customer_Id as customerId,
  2357. a.picture_addess as pictureAddess,
  2358. a.customerPictureChangeRemark,
  2359. a.productionFileComments,
  2360. a.bom_type as bomType,
  2361. a.eng_chg_level as engChgLevel,
  2362. a.bom_alternative_no as bomAlternativeNo,
  2363. a.routing_type as routingType,
  2364. a.routing_revision as routingRevision,
  2365. a.routing_alternative_no as routingAlternativeNo,
  2366. a.pod,
  2367. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'cs') csOperater,
  2368. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cs') csOperaterName,
  2369. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
  2370. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
  2371. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
  2372. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
  2373. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'qualityEngineer') qualityEngineerNo,
  2374. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'qualityEngineer') qualityEngineer,
  2375. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'mp') mpOperator,
  2376. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'mp') mpOperatorName,
  2377. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dccOperaterName,
  2378. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
  2379. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
  2380. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'plan') planOperator,
  2381. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'plan') planOperatorName,
  2382. d.is_reject as isReject,
  2383. d.node_id as nodeId,
  2384. d.node_name as nodeName,
  2385. pcpi.customer_part_no as customerPartNo,
  2386. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  2387. a.remarkPage,
  2388. a.rev,
  2389. a.customer_rev as customerRev,
  2390. b.plm_part_no as plmPartNo,
  2391. c.project_name as projectName,
  2392. a.document_source as documentSource,
  2393. a.url_file,
  2394. a.stage,
  2395. a.label_length,
  2396. a.label_width,
  2397. a.radius,
  2398. cust.customer_no as customerNo,
  2399. cust.customer_desc as customerDesc
  2400. FROM plm_technical_specification_sheet a
  2401. left join view_Project_final_Part b on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  2402. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  2403. left join (
  2404. select customer_no, max(customer_desc) as customer_desc
  2405. from plm_customer_information
  2406. group by customer_no
  2407. ) cust on cust.customer_no = c.customer_id
  2408. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  2409. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  2410. left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  2411. <if test="cutterNumber != null and cutterNumber != ''">
  2412. INNER JOIN (
  2413. SELECT SITE,code_no
  2414. FROM plm_bm_prepress
  2415. WHERE plateNo LIKE #{cutterNumber}
  2416. UNION ALL
  2417. SELECT SITE,code_no
  2418. FROM plm_bm_prepress_tool
  2419. WHERE tool_id LIKE #{cutterNumber}
  2420. OR tool_desc LIKE #{cutterNumber}
  2421. ) AS pbp_bpt ON pbp_bpt.Site = a.site AND pbp_bpt.code_no = a.code_no
  2422. </if>
  2423. <where>
  2424. <if test="id != null">
  2425. AND a.id = #{id}
  2426. </if>
  2427. <if test="site != null and site != ''">
  2428. AND a.site = #{site}
  2429. </if>
  2430. <if test="ecnFlag != null and ecnFlag != ''">
  2431. AND a.ecn_flag = #{ecnFlag}
  2432. </if>
  2433. <if test="oriCodeNo != null and oriCodeNo != ''">
  2434. AND a.ori_code_no like #{oriCodeNo}
  2435. </if>
  2436. <if test="codeNo != null and codeNo != ''">
  2437. AND a.code_no like #{codeNo}
  2438. </if>
  2439. <if test="projectId != null and projectId != ''">
  2440. AND a.project_id like #{projectId}
  2441. </if>
  2442. <if test="testPartNo != null and testPartNo != ''">
  2443. AND (
  2444. a.test_part_no like '%'+#{testPartNo}+'%' or
  2445. b.final_part_no like '%'+#{testPartNo}+'%' or
  2446. a.relevance_part_no like '%'+#{testPartNo}+'%' or
  2447. pcpi.customer_part_no like '%'+#{testPartNo}+'%' or
  2448. b.part_desc like '%'+#{testPartNo}+'%'
  2449. )
  2450. </if>
  2451. <if test="customerDesc != null and customerDesc != ''">
  2452. AND (
  2453. (select max(ci.customer_desc) from plm_customer_information ci where ci.customer_no = c.customer_id) like #{customerDesc})
  2454. </if>
  2455. <if test="excludeStatusClause != null and excludeStatusClause != ''">
  2456. and ${excludeStatusClause}
  2457. </if>
  2458. <if test="(excludeStatusClause == null or excludeStatusClause == '') and (statusDesc == null or statusDesc == '')">
  2459. and a.status != 'death'
  2460. </if>
  2461. <if test="statusDesc != null and statusDesc != ''">
  2462. <!-- AND dbo.plm_get_technicalBaseDesc(a.status, 'status') like #{statusDesc}-->
  2463. and a.status = #{statusDesc}
  2464. </if>
  2465. <if test="buNo == null || buNo == ''">
  2466. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
  2467. </if>
  2468. <if test="buNo != null and buNo != ''">
  2469. AND b.bu_no like #{buNo}
  2470. </if>
  2471. <if test="nodeId != null and nodeId != ''">
  2472. AND d.node_id = #{nodeId}
  2473. </if>
  2474. <if test="sp != null and sp != ''">
  2475. AND dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) like #{sp}
  2476. </if>
  2477. <if test="documentSource != null and documentSource != ''">
  2478. AND a.document_source = #{documentSource}
  2479. </if>
  2480. </where>
  2481. order by a.ori_code_no desc, a.rev_no desc
  2482. </select>
  2483. <select id="queryTechnicalSpecificationCount" resultType="long">
  2484. SELECT count(1)
  2485. FROM plm_technical_specification_sheet a
  2486. left join view_Project_final_Part b on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  2487. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  2488. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  2489. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  2490. left join plm_customer_part_info pcpi on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  2491. <if test="cutterNumber != null and cutterNumber != ''">
  2492. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  2493. (plateNo like #{cutterNumber} or
  2494. cutterNumber like #{cutterNumber})
  2495. </if>
  2496. <where>
  2497. <if test="id != null">
  2498. AND a.id = #{id}
  2499. </if>
  2500. <if test="site != null and site != ''">
  2501. AND a.site = #{site}
  2502. </if>
  2503. <if test="ecnFlag != null and ecnFlag != ''">
  2504. AND a.ecn_flag = #{ecnFlag}
  2505. </if>
  2506. <if test="oriCodeNo != null and oriCodeNo != ''">
  2507. AND a.ori_code_no like #{oriCodeNo}
  2508. </if>
  2509. <if test="codeNo != null and codeNo != ''">
  2510. AND a.code_no like #{codeNo}
  2511. </if>
  2512. <if test="projectId != null and projectId != ''">
  2513. AND a.project_id like #{projectId}
  2514. </if>
  2515. <if test="testPartNo != null and testPartNo != ''">
  2516. AND (
  2517. a.test_part_no like '%'+#{testPartNo}+'%' or
  2518. b.final_part_no like '%'+#{testPartNo}+'%' or
  2519. a.relevance_part_no like '%'+#{testPartNo}+'%' or
  2520. pcpi.customer_part_no like '%'+#{testPartNo}+'%'
  2521. )
  2522. </if>
  2523. <if test="customerDesc != null and customerDesc != ''">
  2524. AND (
  2525. (select max(ci.customer_desc) from plm_customer_information ci where ci.customer_no = c.customer_id) like #{customerDesc} or
  2526. dbo.plm_get_dictDataLabel('finalCustomer', c.final_customer_id, c.site) like #{customerDesc}
  2527. )
  2528. </if>
  2529. <if test="excludeStatusClause != null and excludeStatusClause != ''">
  2530. and ${excludeStatusClause}
  2531. </if>
  2532. <if test="(excludeStatusClause == null or excludeStatusClause == '') and (statusDesc == null or statusDesc == '')">
  2533. and a.status != 'death'
  2534. </if>
  2535. <if test="statusDesc != null and statusDesc != ''">
  2536. AND a.status like #{statusDesc}
  2537. </if>
  2538. <if test="buNo == null || buNo == ''">
  2539. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{site}, #{userName}))
  2540. </if>
  2541. <if test="buNo != null and buNo != ''">
  2542. AND b.bu_no like #{buNo}
  2543. </if>
  2544. <if test="nodeId != null and nodeId != ''">
  2545. AND d.node_id = #{nodeId}
  2546. </if>
  2547. <if test="sp != null and sp != ''">
  2548. AND dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) like #{sp}
  2549. </if>
  2550. <if test="documentSource != null and documentSource != ''">
  2551. AND a.document_source = #{documentSource}
  2552. </if>
  2553. </where>
  2554. </select>
  2555. <select id="queryTechnicalSpecificationList" resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2556. EXEC dbo.getTechnicalSpecificationPageWithSql #{sql}, #{page}, #{limit}
  2557. </select>
  2558. <select id="queryChangeLog" resultType="com.spring.modules.change.vo.ChangeRequestVo">
  2559. WITH CurrentSpec AS (
  2560. SELECT a.site,
  2561. a.code_no,
  2562. a.test_part_no
  2563. FROM plm_technical_specification_sheet a
  2564. WHERE a.site = #{site}
  2565. AND a.code_no = #{codeNo}
  2566. ),
  2567. PartKeys AS (
  2568. SELECT test_part_no AS part_key
  2569. FROM CurrentSpec
  2570. WHERE test_part_no IS NOT NULL
  2571. AND LTRIM(RTRIM(test_part_no)) <![CDATA[<>]]> ''
  2572. ),
  2573. TargetCode AS (
  2574. SELECT s.code_no
  2575. FROM plm_technical_specification_sheet s
  2576. INNER JOIN CurrentSpec c ON s.site = c.site
  2577. WHERE (
  2578. EXISTS (SELECT 1 FROM PartKeys)
  2579. AND s.test_part_no IN (SELECT part_key FROM PartKeys)
  2580. )
  2581. OR (
  2582. NOT EXISTS (SELECT 1 FROM PartKeys)
  2583. AND s.code_no = c.code_no
  2584. )
  2585. )
  2586. SELECT DISTINCT a.site,
  2587. a.bu_no,
  2588. a.change_no,
  2589. a.applicant_id,
  2590. dbo.get_userDisPlay(a.applicant_id) AS applicantName,
  2591. b.department_no AS applicationDepartmentId,
  2592. dbo.get_department_name(a.site, b.department_no) AS applicationDepartmentName,
  2593. a.apply_date,
  2594. a.ecn_type,
  2595. a.change_impact,
  2596. a.change_impact_desc,
  2597. a.ecn_stage,
  2598. a.change_type,
  2599. a.tp_engineer_id,
  2600. dbo.get_userDisPlay(a.tp_engineer_id) AS tpEngineerName,
  2601. a.change_phase_in_date,
  2602. a.df_is_product,
  2603. a.printing,
  2604. a.manufacturing_cost_is_change,
  2605. a.change_request_desc,
  2606. a.is_re_quote,
  2607. a.ul_certification_requirements,
  2608. a.ul_continue_to_meet_demand,
  2609. a.gp_certification_requirements,
  2610. a.gp_continue_to_meet_demand,
  2611. a.create_date,
  2612. a.create_by,
  2613. a.update_date,
  2614. a.update_by,
  2615. a.industrial_engineer_id,
  2616. dbo.get_userDisPlay(a.industrial_engineer_id) AS industrialEngineerName,
  2617. a.change_status,
  2618. a.cqc_operator_id,
  2619. dbo.get_userDisPlay(a.cqc_operator_id) AS cqcOperatorName,
  2620. a.fai_operator_id,
  2621. dbo.get_userDisPlay(a.fai_operator_id) AS faiOperatorName,
  2622. a.step_id,
  2623. a.reject_flag,
  2624. a.reject_step_id
  2625. FROM plm_change_request a
  2626. LEFT JOIN sys_user b
  2627. ON a.site = b.site AND a.applicant_id = b.username
  2628. INNER JOIN plm_change_request_detail pcrd
  2629. ON a.site = pcrd.site AND a.change_no = pcrd.change_no
  2630. WHERE a.site = #{site}
  2631. AND a.show_in_query_flag = 'Y'
  2632. AND (
  2633. pcrd.code_no IN (SELECT code_no FROM TargetCode)
  2634. OR EXISTS (
  2635. SELECT 1
  2636. FROM PartKeys k
  2637. WHERE k.part_key = pcrd.part_no
  2638. OR k.part_key = pcrd.new_part_no
  2639. )
  2640. )
  2641. ORDER BY a.apply_date DESC, a.change_no DESC
  2642. </select>
  2643. <!-- <select id="queryChangeLog" resultType="com.spring.modules.change.vo.ChangeRequestVo">-->
  2644. <!-- SELECT a.site,-->
  2645. <!-- a.bu_no,-->
  2646. <!-- a.change_no,-->
  2647. <!-- a.applicant_id,-->
  2648. <!-- dbo.get_userDisPlay(a.applicant_id) as applicantName,-->
  2649. <!-- b.department_no as applicationDepartmentId,-->
  2650. <!-- dbo.get_department_name(a.site, b.department_no) as applicationDepartmentName,-->
  2651. <!-- a.apply_date,-->
  2652. <!-- a.ecn_type,-->
  2653. <!-- a.change_impact,-->
  2654. <!-- a.change_impact_desc,-->
  2655. <!-- a.ecn_stage,-->
  2656. <!-- a.change_type,-->
  2657. <!-- a.tp_engineer_id,-->
  2658. <!-- dbo.get_userDisPlay(a.tp_engineer_id) as tpEngineerName,-->
  2659. <!-- a.change_phase_in_date,-->
  2660. <!-- a.df_is_product,-->
  2661. <!-- a.printing,-->
  2662. <!-- a.manufacturing_cost_is_change,-->
  2663. <!-- a.change_request_desc,-->
  2664. <!-- a.is_re_quote,-->
  2665. <!-- a.ul_certification_requirements,-->
  2666. <!-- a.ul_continue_to_meet_demand,-->
  2667. <!-- a.gp_certification_requirements,-->
  2668. <!-- a.gp_continue_to_meet_demand,-->
  2669. <!-- a.create_date,-->
  2670. <!-- a.create_by,-->
  2671. <!-- a.update_date,-->
  2672. <!-- a.update_by,-->
  2673. <!-- a.industrial_engineer_id,-->
  2674. <!-- dbo.get_userDisPlay(a.industrial_engineer_id) as industrialEngineerName,-->
  2675. <!-- a.change_status,-->
  2676. <!-- a.cqc_operator_id,-->
  2677. <!-- dbo.get_userDisPlay(a.cqc_operator_id) as cqcOperatorName,-->
  2678. <!-- a.fai_operator_id,-->
  2679. <!-- dbo.get_userDisPlay(a.fai_operator_id) as faiOperatorName,-->
  2680. <!-- a.step_id,-->
  2681. <!-- a.reject_flag,-->
  2682. <!-- a.reject_step_id-->
  2683. <!-- FROM plm_change_request a-->
  2684. <!-- LEFT JOIN sys_user as b on a.site = b.site and a.applicant_id = b.username-->
  2685. <!-- left join plm_change_request_detail pcrd on a.site = pcrd.site and a.change_no = pcrd.change_no-->
  2686. <!-- where a.site = #{site}-->
  2687. <!-- and a.show_in_query_flag = 'Y'-->
  2688. <!-- and pcrd.code_no IN-->
  2689. <!-- (SELECT code_no FROM plm_technical_specification_sheet WHERE site = #{site} AND ori_code_no = #{codeNo})-->
  2690. <!-- </select>-->
  2691. <update id="updateBMStepId" parameterType="PlmTechnicalSpecificationSheetData">
  2692. update plm_technical_specification_sheet
  2693. set step_id = #{stepId}
  2694. where site = #{site} and code_no = #{codeNo}
  2695. </update>
  2696. <update id="bmStatusToCg" parameterType="PlmTechnicalSpecificationSheetData">
  2697. update plm_technical_specification_sheet
  2698. set step_id = #{stepId},
  2699. status = #{status},
  2700. update_date = getDate(),
  2701. update_by = #{updateBy},
  2702. ECN_flag = 'N',
  2703. stage = 'Sample'
  2704. where site = #{site} and code_no = #{codeNo}
  2705. </update>
  2706. <update id="updateBMIsRemark" parameterType="PlmTechnicalSpecificationSheetData">
  2707. update plm_process_form
  2708. set is_remark = 1
  2709. where site = #{site} and document_no = #{codeNo} and document_type = 'BM' and is_remark = 0
  2710. </update>
  2711. <update id="updateBMProcessInfo" parameterType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2712. UPDATE plm_technical_specification_sheet
  2713. SET simplex_duplex = #{simplexDuplex},
  2714. repeat = #{repeat},
  2715. hp = #{hp},
  2716. across = #{across},
  2717. print_copy_position = #{printCopyPosition},
  2718. label_size = #{labelSize},
  2719. vp = #{vp},
  2720. down = #{down},
  2721. actual_number = #{actualNumber},
  2722. goods_roll_width = #{goodsRollWidth},
  2723. new_cutter = #{newCutter},
  2724. p2c_tolerance = #{p2cTolerance},
  2725. dimension_tolerance = #{dimensionTolerance},
  2726. slitting_tolerance = #{slittingTolerance},
  2727. label_length = #{labelLength},
  2728. label_width = #{labelWidth},
  2729. radius = #{radius},
  2730. sheet = #{sheet}
  2731. where site = #{site} and code_no = #{codeNo}
  2732. </update>
  2733. <select id="nodeList" resultType="com.spring.modules.sampleManagement.entity.NodeVo" parameterType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2734. SELECT
  2735. d.node_id AS nodeId,
  2736. d.node_name AS nodeName
  2737. FROM
  2738. plm_request_header AS prh
  2739. LEFT JOIN plm_request_node AS d ON prh.site = d.site and prh.classification_no = d.classification_no
  2740. AND prh.workflow_id = d.workflow_id AND prh.menu_id = #{menuId}
  2741. WHERE
  2742. d.site = #{site}
  2743. order by seq_no
  2744. </select>
  2745. <select id="queryTechnicalSpecificationCountByAnyField" resultType="java.lang.Long">
  2746. SELECT count(1)
  2747. FROM plm_technical_specification_sheet a
  2748. left join view_Project_final_Part b
  2749. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  2750. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  2751. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  2752. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  2753. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  2754. left join plm_customer_part_info pcpi
  2755. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  2756. left join (
  2757. select customer_no, max(customer_desc) as customer_desc
  2758. from plm_customer_information
  2759. group by customer_no
  2760. ) pci on pci.customer_no = pcpi.customer_no
  2761. <if test="cutterNumber != null and cutterNumber != ''">
  2762. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  2763. (plateNo like #{cutterNumber} or
  2764. cutterNumber like #{cutterNumber})
  2765. </if>
  2766. <if test="whereClause != null and whereClause != ''">
  2767. WHERE ${whereClause}
  2768. </if>
  2769. </select>
  2770. <select id="technicalSpecificationListByAnyField"
  2771. resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2772. SELECT
  2773. a.id,
  2774. a.site,
  2775. a.code_no as codeNo,
  2776. a.project_id as projectId,
  2777. a.test_part_no as testPartNo,
  2778. a.status,
  2779. a.rev_no as revNo,
  2780. a.work_center_no as workCenterNo,
  2781. a.ECN_flag as ecnFlag,
  2782. a.ECN_no as ecnNo,
  2783. a.ori_code_no as oriCodeNo,
  2784. a.ECN_address as ecnAddress,
  2785. a.remark,
  2786. a.create_date as createDate,
  2787. a.create_by as createBy,
  2788. a.update_date as updateDate,
  2789. a.update_by as updateBy,
  2790. b.final_part_no as finalPartNo,
  2791. b.part_type as partTypeDesc,
  2792. b.part_type as partType,
  2793. b.part_name as partName,
  2794. b.part_desc as partDesc,
  2795. b.part_spec as partSpec,
  2796. dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
  2797. a.proofing_no as proofingNo,
  2798. b.bu_no as buNo,
  2799. dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
  2800. process,
  2801. c.customer_Id as customerId,
  2802. a.picture_addess as pictureAddess,
  2803. a.customerPictureChangeRemark,
  2804. a.productionFileComments,
  2805. a.bom_type as bomType,
  2806. a.eng_chg_level as engChgLevel,
  2807. a.bom_alternative_no as bomAlternativeNo,
  2808. a.routing_type as routingType,
  2809. a.routing_revision as routingRevision,
  2810. a.routing_alternative_no as routingAlternativeNo,
  2811. a.pod,
  2812. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'cs') csOperater,
  2813. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'cs') csOperaterName,
  2814. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'engineer') engineerNo,
  2815. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'engineer') engineer,
  2816. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'technician') technicianNo,
  2817. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'technician') technician,
  2818. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'qualityEngineer') qualityEngineerNo,
  2819. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'qualityEngineer') qualityEngineer,
  2820. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'mp') mpOperator,
  2821. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'mp') mpOperatorName,
  2822. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'dcc') dccOperaterName,
  2823. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'cqc') cqcOperatorName,
  2824. dbo.get_technicalSpecificationTeamNames(a.site, a.code_no, 'fai') faiOperatorName,
  2825. dbo.get_technicalSpecificationTeamNo(a.site, a.code_no, 'plan') planOperator,
  2826. dbo.get_technicalSpecificationTeamName(a.site, a.code_no, 'plan') planOperatorName,
  2827. d.is_reject as isReject,
  2828. d.node_id as nodeId,
  2829. d.node_name as nodeName,
  2830. pcpi.customer_part_no as customerPartNo,
  2831. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  2832. a.remarkPage,
  2833. a.rev,
  2834. a.customer_rev as customerRev,
  2835. b.plm_part_no as plmPartNo,
  2836. c.project_name as projectName,
  2837. a.document_source as documentSource,
  2838. a.url_file,
  2839. a.stage,
  2840. a.label_length,
  2841. a.label_width,
  2842. a.radius,
  2843. cust.customer_no as customerNo,
  2844. cust.customer_desc as customerDesc
  2845. FROM plm_technical_specification_sheet a
  2846. left join view_Project_final_Part b
  2847. on a.site = b.site and a.project_id = b.project_id and a.test_part_no = b.test_part_no
  2848. left join plm_project_info c on a.site = c.site and a.project_id = c.project_id
  2849. left join (
  2850. select customer_no, max(customer_desc) as customer_desc
  2851. from plm_customer_information
  2852. group by customer_no
  2853. ) cust on cust.customer_no = c.customer_id
  2854. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  2855. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and
  2856. prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  2857. left join plm_customer_part_info pcpi
  2858. on a.site = pcpi.site and a.test_part_no = pcpi.part_no and c.customer_id = pcpi.customer_no
  2859. left join (
  2860. select customer_no, max(customer_desc) as customer_desc
  2861. from plm_customer_information
  2862. group by customer_no
  2863. ) pci on pci.customer_no = pcpi.customer_no
  2864. <if test="cutterNumber != null and cutterNumber != ''">
  2865. inner join plm_bm_prepress pbp on pbp.Site = a.site and pbp.code_no = a.code_no and
  2866. (pbp.plateNo like #{cutterNumber} or
  2867. pbp.cutterNumber like #{cutterNumber})
  2868. </if>
  2869. <if test="whereClause != null and whereClause != ''">
  2870. WHERE ${whereClause}
  2871. </if>
  2872. <if test="orderClause != null and orderClause != ''">
  2873. ORDER BY ${orderClause}
  2874. </if>
  2875. <if test="orderClause == null or orderClause == ''">
  2876. ORDER BY a.ori_code_no desc, a.rev_no desc
  2877. </if>
  2878. </select>
  2879. <select id="urlFileSearch" resultType="com.spring.modules.sys.entity.DictData">
  2880. select sdd.dict_label as dictLabel,
  2881. sdd.dict_value as dictValue
  2882. from sys_dict_type as sdt
  2883. left join sys_dict_data as sdd on sdt.dict_type = sdd.dict_type and sdt.site = sdd.site
  2884. where sdd.site = #{query.site}
  2885. and sdd.dict_type = #{query.dictType}
  2886. and sdt.status = 'Y'
  2887. and sdd.status = 'Y'
  2888. <if test="query.dictLabel != null and query.dictLabel != ''">
  2889. and sdd.dict_label like #{query.dictLabel}
  2890. </if>
  2891. </select>
  2892. <select id="TechnicalSpecificationCount" resultType="java.lang.Long"
  2893. parameterType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2894. EXEC dbo.getTechnicalSpecificationPageWithSqlCount #{sql}
  2895. </select>
  2896. <select id="technicalSpecificationListSearchInPane" resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  2897. SELECT
  2898. A.project_id,
  2899. a.id,
  2900. a.site,
  2901. a.code_no as codeNo,
  2902. a.test_part_no as testPartNo,
  2903. a.status,
  2904. a.rev_no as revNo,
  2905. a.ECN_flag as ecnFlag,
  2906. a.ECN_no as ecnNo,
  2907. a.ori_code_no as oriCodeNo,
  2908. a.remark,
  2909. a.create_date as createDate,
  2910. a.create_by as createBy,
  2911. a.update_date as updateDate,
  2912. a.update_by as updateBy,
  2913. b.final_part_no as finalPartNo,
  2914. b.part_type as partTypeDesc,
  2915. b.part_type as partType,
  2916. b.part_name as partName,
  2917. b.part_desc as partDesc,
  2918. b.part_spec as partSpec,
  2919. dbo.plm_get_technicalBaseDesc(a.status, 'status') as statusDesc,
  2920. a.proofing_no as proofingNo,
  2921. b.bu_no as buNo,
  2922. dbo.plm_get_bu_desc(a.site, b.bu_no) as buDesc,
  2923. dbo.get_plm_Approval_username(a.site, prh.workflow_id, d.node_id, a.code_no) as sp,
  2924. a.remarkPage,
  2925. a.rev,
  2926. b.plm_part_no as plmPartNo,
  2927. a.document_source as documentSource,
  2928. a.url_file
  2929. FROM plm_technical_specification_sheet a
  2930. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  2931. left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '103002'
  2932. left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and a.step_id = d.step_id
  2933. <where>
  2934. <if test="query.site != null and query.site != ''">
  2935. AND a.site = #{query.site}
  2936. </if>
  2937. <if test="query.site != null and query.site != '' and query.userName != null and query.userName != ''">
  2938. AND b.bu_no in (select bu_No from dbo.Get_Now_BU_chooseAble(#{query.site}, #{query.userName}))
  2939. </if>
  2940. <if test="query.projectId != null and query.projectId != ''">
  2941. and b.project_id = #{query.projectId}
  2942. </if>
  2943. <if test="query.projectId == null">
  2944. and a.id IS NULL
  2945. </if>
  2946. </where>
  2947. order by a.ori_code_no desc, a.rev_no desc
  2948. </select>
  2949. <update id="updateBMInfo">
  2950. update plm_technical_specification_sheet
  2951. set status = #{status},
  2952. step_id = #{stepId},
  2953. stage = #{stage},
  2954. update_date = getDate(),
  2955. update_by = #{updateBy}
  2956. where site = #{site} and code_no = #{codeNo}
  2957. </update>
  2958. <select id="searchBMPrepressToolList" resultType="com.spring.modules.sampleManagement.entity.PlmBmPrepressTool">
  2959. select
  2960. site,
  2961. code_no,
  2962. item_no,
  2963. seq_no,
  2964. tool_id,
  2965. tool_desc,
  2966. number_across,
  2967. number_down,
  2968. create_date,
  2969. create_by,
  2970. update_date,
  2971. update_by,
  2972. operation_no,
  2973. remark
  2974. from plm_bm_prepress_tool
  2975. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  2976. order by seq_no
  2977. </select>
  2978. <select id="checkPlmBmPrepressToolItemNo" resultType="com.spring.modules.sampleManagement.entity.PlmBmPrepressTool">
  2979. select
  2980. site,
  2981. code_no,
  2982. operation_no,
  2983. item_no,
  2984. seq_no,
  2985. remark
  2986. from plm_bm_prepress_tool
  2987. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  2988. order by item_no desc
  2989. </select>
  2990. <insert id="saveBMPrepressTool">
  2991. insert into plm_bm_prepress_tool
  2992. (site, code_no, item_no, seq_no, tool_id, tool_desc, number_across, number_down, create_date, create_by, operation_no, remark)
  2993. values
  2994. (#{site}, #{codeNo}, #{itemNo}, #{seqNo}, #{toolId}, #{toolDesc}, #{numberAcross}, #{numberDown}, getDate(), #{createBy}, #{operationNo}, #{remark})
  2995. </insert>
  2996. <update id="updateBMPrepressTool">
  2997. update plm_bm_prepress_tool
  2998. set seq_no = #{seqNo},
  2999. tool_id = #{toolId},
  3000. tool_desc = #{toolDesc},
  3001. number_across = #{numberAcross},
  3002. number_down = #{numberDown},
  3003. update_date = getDate(),
  3004. update_by = #{updateBy},
  3005. remark = #{remark}
  3006. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo} and item_no = #{itemNo}
  3007. </update>
  3008. <delete id="deleteBMPrepressTool">
  3009. delete from plm_bm_prepress_tool
  3010. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo} and item_no = #{itemNo}
  3011. </delete>
  3012. <select id="getBMToolByRoutingAlt" resultType="com.spring.modules.sampleManagement.entity.PlmBmPrepressTool">
  3013. select
  3014. rt.site,
  3015. #{codeNo} as codeNo,
  3016. rt.tool_id,
  3017. th.tool_description as toolDesc,
  3018. rt.remark
  3019. from routing_tool as rt
  3020. left join tool_header as th on rt.site = th.site and rt.tool_id = th.tool_id
  3021. where rt.site = #{site} and rt.part_no = #{partNo} and rt.routing_revision = #{routingRevision} and rt.routing_type = #{routingType} and rt.alternative_no = #{alternativeNo}
  3022. </select>
  3023. <insert id="saveBMToolBatch">
  3024. insert into plm_bm_prepress_tool
  3025. (site, code_no, item_no, seq_no, tool_id, tool_desc, number_across, number_down, create_date, create_by, operation_no, remark) VALUES
  3026. <foreach collection="list" item="item" index="index" separator=",">
  3027. (#{item.site}, #{item.codeNo}, #{item.itemNo}, #{item.seqNo}, #{item.toolId}, #{item.toolDesc}, #{item.numberAcross}, #{item.numberDown}, getDate(), #{item.createBy}, #{item.operationNo}, #{item.remark})
  3028. </foreach>
  3029. </insert>
  3030. <select id="selectDictData" resultType="com.spring.modules.sys.entity.DictData">
  3031. SELECT
  3032. dict_label,
  3033. dict_value,
  3034. is_default
  3035. FROM sys_dict_data
  3036. <where>
  3037. site = #{site}
  3038. and dict_type = #{dictType}
  3039. and status = 'Y'
  3040. <if test="isDefault != null and isDefault != ''">
  3041. and is_default = #{isDefault}
  3042. </if>
  3043. </where>
  3044. </select>
  3045. <select id="getToolPropertiesValue" resultType="com.spring.modules.base.data.PartSubPropertiesValueData">
  3046. select
  3047. TextValue,
  3048. NumValue
  3049. from PartSubPropertiesValue
  3050. where site = #{site} and PartNo = #{toolId} and RecordType = #{recordType} and PropertiesItemNo = #{dictValue}
  3051. </select>
  3052. <delete id="deleteBMPrepressToolByCodeNo">
  3053. delete from plm_bm_prepress_tool
  3054. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  3055. </delete>
  3056. <select id="getTechnicalSpecificationByPart" resultType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  3057. SELECT
  3058. a.project_id,
  3059. a.id,
  3060. a.site,
  3061. a.code_no as codeNo,
  3062. a.test_part_no,
  3063. b.final_part_no
  3064. FROM plm_technical_specification_sheet a
  3065. left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
  3066. where a.site = #{site}
  3067. <if test = "buNo != null and buNo != ''">
  3068. AND b.bu_no = #{buNo}
  3069. </if>
  3070. <if test="testPartNo != null and testPartNo != ''">
  3071. and b.test_part_no = #{testPartNo}
  3072. </if>
  3073. <if test="finalPartNo != null and finalPartNo != ''">
  3074. and b.final_part_no = #{finalPartNo}
  3075. </if>
  3076. <if test="projectId != null and projectId != ''">
  3077. and a.project_id = #{projectId}
  3078. </if>
  3079. </select>
  3080. <delete id="deleteBmBom">
  3081. delete from plm_bm_bom
  3082. where site = #{site} and code_no = #{codeNo}
  3083. </delete>
  3084. <insert id="saveBmBom">
  3085. insert into plm_bm_bom
  3086. (site, code_no, part_no, eng_chg_level, bom_type, alternative_no, component_part, component_part_desc, print_unit, print_unit_name, qty_per_assembly,
  3087. component_scrap, shrinkage_factor, issue_type, line_item_no, line_sequence, operation_no, issue_to_loc, issue_to_loc_name, note_text, Levels,
  3088. planning_method, comp_eng_chg_level, comp_bom_type, comp_alternative_no, sort_seq_no, create_date, create_by)
  3089. values
  3090. (#{site}, #{codeNo}, #{partNo}, #{engChgLevel}, #{bomType}, #{alternativeNo}, #{componentPart}, #{componentPartDesc}, #{printUnit}, #{printUnitName}, #{qtyPerAssembly},
  3091. #{componentScrap}, #{shrinkageFactor}, #{issueType}, #{lineItemNo}, #{lineSequence}, #{operationNo}, #{issueToLoc}, #{issueToLocName}, #{noteText}, #{levels},
  3092. #{planningMethod}, #{compEngChgLevel}, #{compBomType}, #{compAlternativeNo}, #{sortSeqNo}, getDate(), #{createBy})
  3093. </insert>
  3094. <delete id="deleteBmRouting">
  3095. delete from plm_bm_routing
  3096. where site = #{site} and code_no = #{codeNo}
  3097. </delete>
  3098. <insert id="saveBmRouting">
  3099. insert into plm_bm_routing
  3100. (site, code_no, part_no, routing_revision, routing_type, alternative_no, operation_no, efficiency_factor, mach_run_factor, mach_setup_time,
  3101. run_time_code, labor_run_factor, labor_setup_time, crew_size, setup_crew_size, outside_op_item, machine_no, work_center_no, labor_class_no,
  3102. setup_labor_class_no, overlap, note_text, create_date, create_by, operation_name)
  3103. select
  3104. site, #{codeNo}, part_no, routing_revision, routing_type, alternative_no, operation_no, efficiency_factor, mach_run_factor, mach_setup_time,
  3105. run_time_code, labor_run_factor, labor_setup_time, crew_size, setup_crew_size, outside_op_item, machine_no, work_center_no, labor_class_no,
  3106. setup_labor_class_no, overlap, note_text, getDate(), #{createBy}, operation_name
  3107. from plm_routing_component
  3108. where site = #{site} and part_no = #{partNo} and routing_revision = #{routingRevision} and routing_type = #{routingType} and alternative_no = #{alternativeNo}
  3109. order by operation_no
  3110. </insert>
  3111. <select id="selectBmRouting" resultType="com.spring.modules.part.vo.RoutingComponentVo">
  3112. SELECT
  3113. a.site,
  3114. a.code_no,
  3115. a.part_no,
  3116. a.routing_revision,
  3117. a.routing_type,
  3118. a.alternative_no,
  3119. a.operation_no,
  3120. a.operation_name,
  3121. a.efficiency_factor,
  3122. a.mach_run_factor,
  3123. a.mach_setup_time,
  3124. a.run_time_code,
  3125. a.labor_run_factor,
  3126. a.labor_setup_time,
  3127. a.crew_size,
  3128. a.setup_crew_size,
  3129. a.outside_op_item,
  3130. a.machine_no,
  3131. a.work_center_no,
  3132. dbo.get_workCenter_desc(a.site, a.work_center_no) as workCenterDesc,
  3133. a.labor_class_no,
  3134. a.setup_labor_class_no,
  3135. a.overlap,
  3136. a.note_text as componentNoteText,
  3137. b.itemType
  3138. FROM plm_bm_routing as a
  3139. left join WorkCenter_BMType b on a.site = b.site and a.work_center_no = b.workCenterNo
  3140. WHERE a.site = #{site} AND a.code_no = #{codeNo}
  3141. order by a.operation_no
  3142. </select>
  3143. <update id="updateBMBasicInfoEntry">
  3144. update plm_technical_specification_sheet
  3145. set remarkPage = #{remarkPage},
  3146. relevance_part_no = #{relevancePartNo},
  3147. update_date = GetDate(),
  3148. update_by = #{updateBy}
  3149. where site = #{site} and code_no = #{codeNo}
  3150. </update>
  3151. <select id="searchBMSilkScreenColor" resultType="com.spring.modules.sampleManagement.data.PlmBmSilkScreenColorData">
  3152. select
  3153. a.id,
  3154. a.site,
  3155. a.codeNo,
  3156. a.printSide,
  3157. [order],
  3158. a.colorReference,
  3159. a.inkCode,
  3160. p.part_desc as inkDesc,
  3161. a.colorMatch,
  3162. a.lpi,
  3163. a.bcm,
  3164. a.openFlag,
  3165. a.gallus,
  3166. a.markAndy,
  3167. a.hexiang,
  3168. a.temperature,
  3169. a.pressure,
  3170. a.updateDate,
  3171. a.updateBy,
  3172. a.resource_no,
  3173. a.speed,
  3174. a.show_order,
  3175. a.operation_no,
  3176. a.remark
  3177. from plm_bm_silkScreenColor as a
  3178. left join part as p on a.site = p.site and a.inkCode = p.part_no
  3179. where a.site = #{site} and a.codeNo = #{codeNo} and a.operation_no = #{operationNo}
  3180. order by a.show_order
  3181. </select>
  3182. <insert id="saveBMSilkScreenColor">
  3183. insert into plm_bm_silkScreenColor
  3184. (site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
  3185. bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate, updateBy, remark, resource_no, speed, show_order, operation_no)
  3186. values
  3187. (#{site}, #{codeNo}, #{printSide}, #{order}, #{colorReference}, #{inkCode}, #{colorMatch}, #{lpi},
  3188. #{bcm}, #{openFlag}, #{gallus}, #{markAndy}, #{hexiang}, #{temperature}, #{pressure}, GetDate(), #{updateBy}, #{remark}, #{resourceNo}, #{speed}, #{showOrder}, #{operationNo})
  3189. </insert>
  3190. <update id="updateBMSilkScreenColor">
  3191. update plm_bm_silkScreenColor
  3192. set printSide = #{printSide},
  3193. [order] = #{order,jdbcType=INTEGER},
  3194. show_order = #{showOrder},
  3195. colorReference = #{colorReference},
  3196. inkCode = #{inkCode},
  3197. colorMatch = #{colorMatch},
  3198. lpi = #{lpi},
  3199. bcm = #{bcm},
  3200. openFlag = #{openFlag},
  3201. gallus = #{gallus},
  3202. markAndy = #{markAndy},
  3203. hexiang = #{hexiang},
  3204. temperature = #{temperature},
  3205. pressure = #{pressure},
  3206. updateDate = GetDate(),
  3207. updateBy = #{updateBy},
  3208. remark = #{remark},
  3209. resource_no = #{resourceNo},
  3210. speed = #{speed}
  3211. where id = #{id}
  3212. </update>
  3213. <delete id="deleteBMSilkScreenColor">
  3214. delete from plm_bm_silkScreenColor
  3215. where id = #{id}
  3216. </delete>
  3217. <delete id="deleteBMSilkScreenColorByCodeNo">
  3218. delete from plm_bm_silkScreenColor
  3219. where site = #{site} and codeNo = #{codeNo} and operation_no = #{operationNo}
  3220. </delete>
  3221. <insert id="saveBMSilkScreenColors">
  3222. insert into plm_bm_silkScreenColor
  3223. (site, codeNo, printSide, [order], colorReference, inkCode, colorMatch, lpi,
  3224. bcm, openFlag, gallus, markAndy, hexiang, temperature, pressure, updateDate,
  3225. updateBy, remark, resource_no, speed, show_order, operation_no)
  3226. values
  3227. <foreach collection="list" item="item" index="index" separator=",">
  3228. (#{item.site}, #{item.codeNo}, #{item.printSide}, #{item.order}, #{item.colorReference}, #{item.inkCode}, #{item.colorMatch}, #{item.lpi},
  3229. #{item.bcm}, #{item.openFlag}, #{item.gallus}, #{item.markAndy}, #{item.hexiang}, #{item.temperature}, #{item.pressure}, GetDate(),
  3230. #{item.updateBy}, #{item.remark}, #{item.resourceNo}, #{item.speed}, #{item.showOrder}, #{item.operationNo})
  3231. </foreach>
  3232. </insert>
  3233. <update id="updateProcessForm"
  3234. parameterType="com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData">
  3235. UPDATE a
  3236. SET a.update_by = #{updateBy},
  3237. a.update_date = GETDATE(),
  3238. node_conclusion = #{nodeConclusion},
  3239. is_remark = 2
  3240. FROM plm_process_form a
  3241. LEFT JOIN plm_technical_specification_sheet b ON a.site = b.site
  3242. AND a.document_no = b.code_no
  3243. AND a.step_id = b.step_id
  3244. WHERE
  3245. a.site = b.site
  3246. AND a.document_no = b.code_no
  3247. AND a.step_id = b.step_id
  3248. AND a.site = #{site}
  3249. AND a.document_no = #{codeNo}
  3250. AND a.is_remark = 0
  3251. </update>
  3252. <update id="updateBMPrepressDetailPlateNo">
  3253. update plm_bm_prepress
  3254. set plateNo = #{plateNo},
  3255. update_by = #{updateBy},
  3256. update_date = GetDate()
  3257. where site = #{site} and code_no = #{codeNo} and operation_no = #{operationNo}
  3258. </update>
  3259. <select id="getRoutingGuideLineByLineDesc" resultType="com.spring.modules.part.vo.WorkGuidelineVo">
  3260. SELECT
  3261. id,
  3262. site,
  3263. part_no,
  3264. routing_revision,
  3265. routing_type,
  3266. alternative_no,
  3267. operation_id,
  3268. guideline_seq,
  3269. guideline_desc,
  3270. guideline_text,
  3271. guideline_type
  3272. FROM plm_routing_work_guide
  3273. where site = #{site} and part_no = #{partNo} and routing_revision = #{routingRevision} and routing_type = #{routingType}
  3274. and alternative_no = #{alternativeNo} and operation_id = #{operationId} and guideline_desc = #{dictLabel}
  3275. </select>
  3276. </mapper>