ShOrderMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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.ShOrderMapper">
  4. <select id="queryOrder" resultType="hashmap" parameterType="java.lang.String">
  5. SELECT
  6. VOI_ID "id",
  7. VOI_CHANNEL "channel",
  8. VOI_PERSON_ID "personId",
  9. VOI_EQUIPMENT_ID "equipmentId",
  10. VOI_ORDER_AMT "orderAmt",
  11. VOI_STATE "state",
  12. VOI_PAY_ORDERNO "payOrderno",
  13. VOI_REMARKS "remarks",
  14. VOI_PAY_TYPE "payType",
  15. VOI_NUMBER "number",
  16. VOI_PRO_TYPE "proType",
  17. VOI_IS_DRAW "isDraw",
  18. VOI_IS_USED "isUsed",
  19. VOI_PRO_STATE "proState",
  20. VOI_DRAW_PRICE "drawPrice",
  21. VOI_CREATE_USER "createUser",
  22. VOI_CREATE_TIME "createTime",
  23. VOI_MODIFY_USER "modifyUser",
  24. VOI_MODIFY_TIME "modifyTime",
  25. VOI_BRANCHID "branchid",
  26. VOI_PAY_MODE "payMode",
  27. b.VCI_NAME "personName",
  28. c.VEQ_NAME "equipmentName"
  29. FROM
  30. vm_order_inf a LEFT JOIN vm_person_inf b ON a.VOI_PERSON_ID = b.VCI_ID
  31. LEFT JOIN vm_equipment_inf c ON a.VOI_EQUIPMENT_ID = c.VEQ_ID
  32. WHERE 1=1
  33. <if test="dates!=null and dates != ''">
  34. and substr(a.VOI_CREATE_TIME,1,8) between substr((#{dates,jdbcType=VARCHAR}),1,8)
  35. and substr((#{dates,jdbcType=VARCHAR}),10,17)
  36. </if>
  37. <if test="equipmentId != null and equipmentId != ''">
  38. and a.VOI_EQUIPMENT_ID = #{equipmentId,jdbcType=VARCHAR}
  39. </if>
  40. <if test="payMode != null and payMode != ''">
  41. and a.VOI_PAY_MODE = #{payMode,jdbcType=VARCHAR}
  42. </if>
  43. <if test="playerId != null and playerId != ''">
  44. and a.VOI_PERSON_ID = #{playerId,jdbcType=VARCHAR}
  45. </if>
  46. <if test="state != null and state != ''">
  47. and a.VOI_IS_DRAW = #{state,jdbcType=VARCHAR}
  48. </if>
  49. <if test="orderNo != null and orderNo != ''">
  50. and a.VOI_ID = #{orderNo,jdbcType=VARCHAR}
  51. </if>
  52. order by a.VOI_CREATE_TIME desc
  53. </select>
  54. <select id="queryOrderNew" resultType="hashmap" parameterType="java.lang.String">
  55. SELECT
  56. d.VOD_DETAILS_ID "id",
  57. d.VOD_DELIVERY_ID "deliveryId",
  58. d.VOD_CREATE_TIME "createTime",
  59. a.VOI_EQUIPMENT_ID "equipmentId",
  60. c.VEQ_IMEI_ADDR "imeiAddr",
  61. d.VOD_PRO_NAME "productName",
  62. d.VOD_AMOUNT "orderAmt",
  63. e.VCI_AISLE "aisle",
  64. e.VCI_COST_PRICE "costPrice",
  65. a.VOI_STATE "state",
  66. a.VOI_PAY_MODE "payMode",
  67. a.VOI_GAME_RULE "gameRule",
  68. d.VOD_IS_DELIVERY "pickupStt",
  69. b.VCI_NAME "personName",
  70. d.VOD_IS_WINNING "isDraw"
  71. FROM vm_order_details d LEFT JOIN vm_order_inf a ON d.VOD_ORDER_ID = a.VOI_ID
  72. LEFT JOIN vm_equipment_inf c ON a.VOI_EQUIPMENT_ID = c.VEQ_ID
  73. LEFT JOIN vm_person_inf b ON a.VOI_PERSON_ID = b.VCI_ID
  74. LEFT JOIN vm_pro_equ_rel e ON d.VOD_PRO_EQU_REL_ID = e.VCI_ID
  75. WHERE 1=1 and a.VOI_OPERATION = '0' AND a.VOI_STATE = '00'
  76. <if test="dates!=null and dates != ''">
  77. and substr(d.VOD_CREATE_TIME,1,8) between substr((#{dates,jdbcType=VARCHAR}),1,8)
  78. and substr((#{dates,jdbcType=VARCHAR}),10,17)
  79. </if>
  80. <if test="equipmentId != null and equipmentId != ''">
  81. and a.VOI_EQUIPMENT_ID = #{equipmentId,jdbcType=VARCHAR}
  82. </if>
  83. <if test="imeiAddr != null and imeiAddr != ''">
  84. and c.VEQ_IMEI_ADDR = #{imeiAddr,jdbcType=VARCHAR}
  85. </if>
  86. <if test="equipmentName != null and equipmentName != ''">
  87. and c.VEQ_NAME like CONCAT('%', #{equipmentName,jdbcType=VARCHAR}, '%')
  88. </if>
  89. <if test="freightwayId != null and freightwayId != ''">
  90. and e.VCI_AISLE = #{freightwayId,jdbcType=VARCHAR}
  91. </if>
  92. <if test="payMode != null and payMode != ''">
  93. and a.VOI_PAY_MODE = #{payMode,jdbcType=VARCHAR}
  94. </if>
  95. <if test="playerId != null and playerId != ''">
  96. and a.VOI_PERSON_ID = #{playerId,jdbcType=VARCHAR}
  97. </if>
  98. <if test="state != null and state != ''">
  99. and a.VOI_STATE = #{state,jdbcType=VARCHAR}
  100. </if>
  101. <if test="playerName != null and playerName != ''">
  102. and b.VCI_NAME = #{playerName,jdbcType=VARCHAR}
  103. </if>
  104. <if test="isDraw != null and isDraw != ''">
  105. and d.VOD_IS_WINNING = #{isDraw,jdbcType=VARCHAR}
  106. </if>
  107. <if test="orderNo != null and orderNo != ''">
  108. and d.VOD_DETAILS_ID = #{orderNo,jdbcType=VARCHAR}
  109. </if>
  110. <if test="productName != null and productName != ''">
  111. and d.VOD_PRO_NAME like CONCAT('%', #{productName,jdbcType=VARCHAR}, '%')
  112. </if>
  113. <if test="gameRule != null and gameRule != ''">
  114. and a.VOI_GAME_RULE = #{gameRule,jdbcType=VARCHAR}
  115. </if>
  116. <if test="pickupStt != null and pickupStt != ''">
  117. and d.VOD_IS_DELIVERY = #{pickupStt,jdbcType=VARCHAR}
  118. </if>
  119. <if test="deliveryId != null and deliveryId != ''">
  120. and d.VOD_DELIVERY_ID = #{deliveryId,jdbcType=VARCHAR}
  121. </if>
  122. <if test="branchId != null and branchId != ''">
  123. and a.VOI_BRANCHID = #{branchId,jdbcType=VARCHAR}
  124. </if>
  125. order by d.VOD_CREATE_TIME desc
  126. </select>
  127. </mapper>