MetaHanaSalesOrderMapper.xml 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.dgtly.order.mapper.MetaHanaSalesOrderMapper">
  4. <resultMap type="MetaHanaSalesOrder" id="MetaHanaSalesResult">
  5. <result property="docNumber" column="DOC_NUMBER" />
  6. <result property="docItem" column="DOC_ITEM" />
  7. <result property="salesOrg" column="SALES_ORG" />
  8. <result property="salesOrgName" column="SALES_ORG_NAME" />
  9. <result property="distributionChannel" column="DISTRIBUTION_CHANNEL" />
  10. <result property="customerCode" column="CUSTOMER_CODE" />
  11. <result property="customerName" column="CUSTOMER_NAME" />
  12. <result property="route" column="ROUTE" />
  13. <result property="division" column="DIVISION" />
  14. <result property="salesGroup" column="SALES_GROUP" />
  15. <result property="plant" column="PLANT" />
  16. <result property="docType" column="DOC_TYPE" />
  17. <result property="createDate" column="CREATE_DATE" />
  18. <result property="createDateItem" column="CREATE_DATE_ITEM" />
  19. <result property="deliverStatus" column="DELIVER_STATUS" />
  20. <result property="materialCode" column="MATERIAL_CODE" />
  21. <result property="materialName" column="MATERIAL_NAME" />
  22. <result property="sizeDim" column="SIZE_DIM" />
  23. <result property="creditDate" column="CREDIT_DATE" />
  24. <result property="creditStatus" column="CREDIT_STATUS" />
  25. <result property="rejectReason" column="REJECT_REASON" />
  26. <result property="noDeliverQty" column="NO_DELIVER_QTY" />
  27. <result property="noDeliverWt" column="NO_DELIVER_WT" />
  28. <result property="noDeliverAmt" column="NO_DELIVER_AMT" />
  29. <result property="deliverQty" column="DELIVER_QTY" />
  30. <result property="deliverWt" column="DELIVER_WT" />
  31. <result property="deliverAmt" column="DELIVER_AMT" />
  32. </resultMap>
  33. <sql id="selectMetaHanaSalesOrderVo">
  34. select DOC_NUMBER, DOC_ITEM, SALES_ORG, SALES_ORG_NAME, DISTRIBUTION_CHANNEL, CUSTOMER_CODE, CUSTOMER_NAME, ROUTE,
  35. DIVISION, SALES_GROUP, PLANT, DOC_TYPE, CREATE_DATE, CREATE_DATE_ITEM, DELIVER_STATUS, MATERIAL_CODE, MATERIAL_NAME, SIZE_DIM
  36. , CREDIT_DATE, CREDIT_STATUS, REJECT_REASON, NO_DELIVER_QTY, NO_DELIVER_WT, NO_DELIVER_AMT, DELIVER_QTY, DELIVER_WT, DELIVER_AMT from meta_hana_sales_order
  37. </sql>
  38. <select id="selectDistinctMetaHanaSalesOrder" parameterType="MetaHanaSalesOrder" resultMap="MetaHanaSalesResult">
  39. select distinct mhso.DOC_NUMBER, mhso.CUSTOMER_CODE, mhso.CUSTOMER_NAME,
  40. mhso.CREATE_DATE, mhso.CREDIT_DATE, mhso.CREDIT_STATUS, mhso.REJECT_REASON
  41. from meta_hana_sales_order mhso
  42. <where>
  43. <if test="docNumber != null and docNumber != ''"> and mhso.DOC_NUMBER like concat('%', #{docNumber}, '%')</if>
  44. <if test="salesOrg != null and salesOrg != ''"> and mhso.SALES_ORG =#{salesOrg}</if>
  45. <if test="salesOrgName != null and salesOrgName != ''"> and mhso.SALES_ORG_NAME like concat('%', #{salesOrgName}, '%')</if>
  46. <if test="customerCode != null and customerCode != ''"> and mhso.CUSTOMER_CODE like concat('%', #{customerCode}, '%')</if>
  47. <if test="customerName != null and customerName != ''"> and mhso.CUSTOMER_NAME like concat('%', #{customerName}, '%')</if>
  48. <if test="docType != null and docType != ''"> and mhso.DOC_TYPE = #{docType}</if>
  49. <if test="creditStatus != null and creditStatus != ''"> and mhso.CREDIT_STATUS = #{creditStatus}</if>
  50. </where>
  51. </select>
  52. <select id="selectOrderExcepTimeByList" parameterType="String" resultType="Map">
  53. select order_number ,expected_time
  54. from sales_order_base
  55. where order_number in
  56. <foreach collection="list" item="orderNumber" open="(" separator="," close=")">
  57. #{orderNumber}
  58. </foreach>
  59. </select>
  60. </mapper>