GoodsManageMapper.xml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.minpay.db.table.own.mapper.GoodsManageMapper">
  4. <!--商品信息管理-->
  5. <select id="selectGoodsInfo" resultType="hashmap" parameterType="java.util.Map">
  6. SELECT
  7. ODT_ID odtId,
  8. ODT_ORDERNO orderno,
  9. (ODT_PRICE_CIF * ODT_COUNT * 0.9) estimateAmount,
  10. ODT_NAME name,
  11. ODT_CATEGORY category,
  12. ODT_BRAND brand,
  13. ODT_ORIGIN_COUNTRY originCountry,
  14. ODT_NORMS norms,
  15. ODT_VALIDITY validity,
  16. ODT_PRICE_EXIT priceExit,
  17. ODT_PRICE_CIF priceCif,
  18. ODT_PRICE_SALE priceSale,
  19. ODT_COUNT countNum
  20. from tp_order_detail a, tp_order_inf b
  21. where a.ODT_ORDERNO = b.OIF_ORDERNO
  22. AND OIF_STT NOT IN ('00','01','02','03','05')
  23. <if test="goodsName != null and goodsName != ''">
  24. and a.ODT_NAME like concat('%',#{goodsName, jdbcType=VARCHAR},'%')
  25. </if>
  26. <if test="orderNum != null and orderNum != ''">
  27. and a.ODT_ORDERNO = #{orderNum, jdbcType=VARCHAR}
  28. </if>
  29. order by b.OIF_APPLY_DATE desc
  30. </select>
  31. <select id="selectProdOutCount" resultType="hashmap" parameterType="java.util.Map">
  32. SELECT
  33. a.CIF_PROD_ID,de.ODT_COUNT,a.outCount
  34. FROM tp_order_detail de
  35. LEFT JOIN (
  36. SELECT
  37. SUM(CIF_COUNT) 'outCount',CIF_PROD_ID
  38. FROM tp_outwh_flow
  39. WHERE CIF_ORDER_NO = #{orderNo, jdbcType=VARCHAR}
  40. AND CIF_TYPE ='00' GROUP BY CIF_PROD_ID) a
  41. ON a.CIF_PROD_ID = de.ODT_ID
  42. WHERE 1=1
  43. and de.ODT_ORDERNO = #{orderNo, jdbcType=VARCHAR}
  44. AND (de.ODT_COUNT != a.outCount or a.CIF_PROD_ID IS NULL)
  45. </select>
  46. </mapper>