TopOrderAcceptanceMapper.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhongzheng.modules.top.order.mapper.TopOrderAcceptanceMapper">
  6. <select id="queryAcceptanceList" parameterType="com.zhongzheng.modules.top.order.bo.TopOrderAcceptanceBo"
  7. resultType="com.zhongzheng.modules.top.order.vo.TopOrderAcceptanceVo">
  8. SELECT
  9. *
  10. FROM
  11. top_order_acceptance
  12. WHERE
  13. `status` = 1
  14. <if test="businessAffiliation != null and businessAffiliation != ''">
  15. AND business_affiliation = #{invoiceStatus}
  16. </if>
  17. <if test="incomeType != null and incomeType != ''">
  18. AND income_type = #{incomeType}
  19. </if>
  20. <if test="acceptanceType != null and acceptanceType != ''">
  21. AND acceptance_type = #{acceptanceType}
  22. </if>
  23. <if test="acceptanceStatus != null and acceptanceStatus != ''">
  24. AND acceptance_status = #{acceptanceStatus}
  25. </if>
  26. <if test="orderSn != null and orderSn != ''">
  27. AND acceptance_id IN (SELECT acceptance_id FROM top_order_acceptance_rel WHERE `status` = 1 AND order_sn = #{orderSn})
  28. </if>
  29. <if test="orderClient != null and orderClient != ''">
  30. AND order_client = #{orderClient}
  31. </if>
  32. <if test="incomeStartTime != null and incomeStartTime != ''">
  33. AND income_time <![CDATA[ >= ]]> #{incomeStartTime}
  34. </if>
  35. <if test="incomeEndTime != null and incomeEndTime != ''">
  36. AND income_time <![CDATA[ <= ]]> #{incomeEndTime}
  37. </if>
  38. ORDER BY create_time DESC
  39. </select>
  40. <select id="getAcceptanceOrderList" parameterType="com.zhongzheng.modules.top.order.bo.TopAcceptanceOrderBo"
  41. resultType="com.zhongzheng.modules.top.goods.vo.TopOldOrderVo">
  42. SELECT
  43. * ,
  44. (SELECT st.tenant_name FROM sys_tenant st WHERE st.tenant_id = t.tenant_id) AS tenant_name
  45. FROM
  46. top_old_order t
  47. WHERE
  48. t.`status` = 1
  49. AND t.check_status = 1
  50. <if test="orderSign != null and orderSign != '' and orderSign == 1">
  51. AND t.order_uncollected > 0
  52. </if>
  53. <if test="orderSn != null and orderSn != ''">
  54. AND t.order_sn = #{orderSn}
  55. </if>
  56. <if test="orderSnList != null and orderSnList.size()!=0 ">
  57. AND t.order_sn in
  58. <foreach collection="orderSnList" item="item" index="index" open="(" close=")" separator=",">
  59. #{item}
  60. </foreach>
  61. </if>
  62. <if test="createNo != null and createNo != ''">
  63. AND t.create_no = #{createNo}
  64. </if>
  65. <if test="purchaseOrg != null and purchaseOrg != ''">
  66. AND t.purchase_org = #{purchaseOrg}
  67. </if>
  68. <if test="userKey != null and userKey != ''">
  69. AND (
  70. SELECT
  71. COUNT( DISTINCT tog.order_goods_id )
  72. FROM
  73. top_old_order_goods tog
  74. WHERE
  75. tog.order_sn = t.order_sn
  76. AND tog.`status` = 1
  77. AND tog.check_status = 1
  78. AND ( tog.user_name = #{userKey} OR tog.user_card = #{userKey,typeHandler=com.zhongzheng.common.type.EncryptHandler} )) > 0
  79. </if>
  80. ORDER BY t.create_time DESC
  81. </select>
  82. </mapper>