DeliverQuantityConfirmMapper.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.system.mapper.DeliverQuantityConfirmMapper">
  4. <resultMap type="com.dgtly.system.domain.DeliverQuantityConfirm" id="DeliverQuantityConfirmResult">
  5. <result property="orderNumber" column="order_number" />
  6. <result property="orderItem" column="order_item" />
  7. <result property="orderCreationTime" column="order_creation_time" />
  8. <result property="belongTo" column="belong_to" />
  9. <result property="deliveryNumber" column="delivery_number" />
  10. <result property="deliverItem" column="deliver_item" />
  11. <result property="shipmentNumber" column="shipment_number" />
  12. <result property="shipToAddress" column="ship_to_address" />
  13. <result property="materialCode" column="material_code" />
  14. <result property="materialName" column="material_name" />
  15. <result property="sizeDim" column="size_dim" />
  16. <result property="deliverQty" column="deliver_qty" />
  17. <result property="deliverWt" column="deliver_wt" />
  18. <result property="confirmQuantity" column="confirm_quantity" />
  19. </resultMap>
  20. <sql id="selectDeliverQuantityConfirmVo">
  21. select id, create_by, create_time, update_by, update_time, is_delete, order_number, order_item, order_creation_time, belong_to, delivery_number, deliver_item,concat(delivery_number,deliver_item)as code, shipment_number, ship_to_address, material_code, material_name, size_dim, deliver_qty, deliver_wt, confirm_quantity from deliver_quantity_confirm
  22. </sql>
  23. <select id="selectDeliverQuantityConfirmList" parameterType="DeliverQuantityConfirm" resultMap="DeliverQuantityConfirmResult">
  24. <include refid="selectDeliverQuantityConfirmVo"/>
  25. <where>
  26. 1=1
  27. <if test="isDelete != null and isDelete != ''"> and is_delete = #{isDelete}</if>
  28. <if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
  29. <if test="orderItem != null and orderItem != ''"> and order_item = #{orderItem}</if>
  30. <if test="orderCreationTime != null and orderCreationTime != ''"> and order_creation_time = #{orderCreationTime}</if>
  31. <if test="belongTo != null and belongTo != ''"> and belong_to = #{belongTo}</if>
  32. <if test="deliveryNumber != null and deliveryNumber != ''"> and delivery_number = #{deliveryNumber}</if>
  33. <if test="deliverItem != null and deliverItem != ''"> and deliver_item = #{deliverItem}</if>
  34. <if test="shipmentNumber != null and shipmentNumber != ''"> and shipment_number = #{shipmentNumber}</if>
  35. <if test="shipToAddress != null and shipToAddress != ''"> and ship_to_address = #{shipToAddress}</if>
  36. <if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
  37. <if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
  38. <if test="sizeDim != null and sizeDim != ''"> and size_dim = #{sizeDim}</if>
  39. <if test="deliverQty != null "> and deliver_qty = #{deliverQty}</if>
  40. <if test="deliverWt != null "> and deliver_wt = #{deliverWt}</if>
  41. <if test="confirmQuantity != null "> and confirm_quantity = #{confirmQuantity}</if>
  42. and create_time between now() - interval 100 day and now()
  43. </where>
  44. </select>
  45. <select id="selectDeliverQuantityConfirmById" parameterType="Long" resultMap="DeliverQuantityConfirmResult">
  46. <include refid="selectDeliverQuantityConfirmVo"/>
  47. where id = #{id}
  48. </select>
  49. <insert id="insertDeliverQuantityConfirm" parameterType="DeliverQuantityConfirm" useGeneratedKeys="true" keyProperty="id">
  50. insert into deliver_quantity_confirm
  51. <trim prefix="(" suffix=")" suffixOverrides=",">
  52. <if test="createBy != null and createBy != ''">create_by,</if>
  53. <if test="createTime != null ">create_time,</if>
  54. <if test="updateBy != null and updateBy != ''">update_by,</if>
  55. <if test="updateTime != null ">update_time,</if>
  56. <if test="isDelete != null and isDelete != ''">is_delete,</if>
  57. <if test="orderNumber != null and orderNumber != ''">order_number,</if>
  58. <if test="orderItem != null and orderItem != ''">order_item,</if>
  59. <if test="orderCreationTime != null and orderCreationTime != ''">order_creation_time,</if>
  60. <if test="belongTo != null and belongTo != ''">belong_to,</if>
  61. <if test="deliveryNumber != null and deliveryNumber != ''">delivery_number,</if>
  62. <if test="deliverItem != null and deliverItem != ''">deliver_item,</if>
  63. <if test="shipmentNumber != null and shipmentNumber != ''">shipment_number,</if>
  64. <if test="shipToAddress != null and shipToAddress != ''">ship_to_address,</if>
  65. <if test="materialCode != null and materialCode != ''">material_code,</if>
  66. <if test="materialName != null and materialName != ''">material_name,</if>
  67. <if test="sizeDim != null and sizeDim != ''">size_dim,</if>
  68. <if test="deliverQty != null ">deliver_qty,</if>
  69. <if test="deliverWt != null ">deliver_wt,</if>
  70. <if test="confirmQuantity != null ">confirm_quantity,</if>
  71. </trim>
  72. <trim prefix="values (" suffix=")" suffixOverrides=",">
  73. <if test="createBy != null and createBy != ''">#{createBy},</if>
  74. <if test="createTime != null ">#{createTime},</if>
  75. <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
  76. <if test="updateTime != null ">#{updateTime},</if>
  77. <if test="isDelete != null and isDelete != ''">#{isDelete},</if>
  78. <if test="orderNumber != null and orderNumber != ''">#{orderNumber},</if>
  79. <if test="orderItem != null and orderItem != ''">#{orderItem},</if>
  80. <if test="orderCreationTime != null and orderCreationTime != ''">#{orderCreationTime},</if>
  81. <if test="belongTo != null and belongTo != ''">#{belongTo},</if>
  82. <if test="deliveryNumber != null and deliveryNumber != ''">#{deliveryNumber},</if>
  83. <if test="deliverItem != null and deliverItem != ''">#{deliverItem},</if>
  84. <if test="shipmentNumber != null and shipmentNumber != ''">#{shipmentNumber},</if>
  85. <if test="shipToAddress != null and shipToAddress != ''">#{shipToAddress},</if>
  86. <if test="materialCode != null and materialCode != ''">#{materialCode},</if>
  87. <if test="materialName != null and materialName != ''">#{materialName},</if>
  88. <if test="sizeDim != null and sizeDim != ''">#{sizeDim},</if>
  89. <if test="deliverQty != null ">#{deliverQty},</if>
  90. <if test="deliverWt != null ">#{deliverWt},</if>
  91. <if test="confirmQuantity != null ">#{confirmQuantity},</if>
  92. </trim>
  93. </insert>
  94. <insert id="saveDeliverNumber" parameterType="com.dgtly.system.domain.DeliverQuantityConfirm">
  95. insert into
  96. deliver_quantity_confirm(
  97. create_by,create_time,update_by,update_time,is_delete,order_number, order_item, order_creation_time, belong_to, delivery_number, deliver_item, shipment_number, ship_to_address, material_code, material_name, size_dim, deliver_qty, deliver_wt, confirm_quantity
  98. )
  99. values
  100. <foreach collection="list" item="item" separator=",">
  101. (
  102. #{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},
  103. #{item.isDelete},#{item.orderNumber},#{item.orderItem},
  104. #{item.orderCreationTime},#{item.belongTo},#{item.deliveryNumber},
  105. #{item.deliverItem},#{item.shipmentNumber},#{item.shipToAddress},#{item.materialCode},
  106. #{item.materialName},#{item.sizeDim},#{item.deliverQty},
  107. #{item.deliverWt},#{item.confirmQuantity}
  108. )
  109. </foreach>
  110. </insert>
  111. <select id="insertCus" parameterType="java.lang.String" resultType="java.lang.Integer">
  112. insert into meta_hana_not_freeze_customer(customer_code,create_time) values(#{customer}, NOW())
  113. </select>
  114. <select id="selectCus" parameterType="java.lang.String" resultType="java.lang.Integer">
  115. select count(*) from meta_hana_not_freeze_customer where customer_code = #{customer}
  116. </select>
  117. </mapper>