ReserveGoodsOrderTimeV1ServiceDaoImplMapper.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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="reserveGoodsOrderTimeV1ServiceDaoImpl">
  6. <!-- 保存预约订单时间信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveReserveGoodsOrderTimeInfo" parameterType="Map">
  8. insert into reserve_goods_order_time(
  9. hours,quantity,time_id,order_id,goods_id,state,community_id
  10. ) values (
  11. #{hours},#{quantity},#{timeId},#{orderId},#{goodsId},#{state},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询预约订单时间信息 add by wuxw 2018-07-03 -->
  15. <select id="getReserveGoodsOrderTimeInfo" parameterType="Map" resultType="Map">
  16. select t.hours,t.quantity,t.time_id,t.time_id timeId,t.order_id,t.order_id orderId,t.goods_id,t.goods_id
  17. goodsId,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId
  18. from reserve_goods_order_time t
  19. left join reserve_goods_order rgo on t.goods_id = rgo.goods_id and rgo.status_cd='0'
  20. where 1 =1
  21. <if test="appointmentTime !=null and appointmentTime != ''">
  22. and rgo.appointment_time = #{appointmentTime}
  23. </if>
  24. <if test="hours !=null and hours != ''">
  25. and t.hours= #{hours}
  26. </if>
  27. <if test="quantity !=null and quantity != ''">
  28. and t.quantity= #{quantity}
  29. </if>
  30. <if test="timeId !=null and timeId != ''">
  31. and t.time_id= #{timeId}
  32. </if>
  33. <if test="orderId !=null and orderId != ''">
  34. and t.order_id= #{orderId}
  35. </if>
  36. <if test="goodsId !=null and goodsId != ''">
  37. and t.goods_id= #{goodsId}
  38. </if>
  39. <if test="goodsIds !=null">
  40. and t.goods_id in
  41. <foreach collection="goodsIds" item="item" open="(" close=")" separator=",">
  42. #{item}
  43. </foreach>
  44. </if>
  45. <if test="statusCd !=null and statusCd != ''">
  46. and t.status_cd= #{statusCd}
  47. </if>
  48. <if test="state !=null and state != ''">
  49. and t.state= #{state}
  50. </if>
  51. <if test="communityId !=null and communityId != ''">
  52. and t.community_id= #{communityId}
  53. </if>
  54. order by t.create_time desc
  55. <if test="page != -1 and page != null ">
  56. limit #{page}, #{row}
  57. </if>
  58. </select>
  59. <!-- 修改预约订单时间信息 add by wuxw 2018-07-03 -->
  60. <update id="updateReserveGoodsOrderTimeInfo" parameterType="Map">
  61. update reserve_goods_order_time t set t.status_cd = #{statusCd}
  62. <if test="newBId != null and newBId != ''">
  63. ,t.b_id = #{newBId}
  64. </if>
  65. <if test="hours !=null and hours != ''">
  66. , t.hours= #{hours}
  67. </if>
  68. <if test="quantity !=null and quantity != ''">
  69. , t.quantity= #{quantity}
  70. </if>
  71. <if test="orderId !=null and orderId != ''">
  72. , t.order_id= #{orderId}
  73. </if>
  74. <if test="goodsId !=null and goodsId != ''">
  75. , t.goods_id= #{goodsId}
  76. </if>
  77. <if test="state !=null and state != ''">
  78. , t.state= #{state}
  79. </if>
  80. <if test="communityId !=null and communityId != ''">
  81. , t.community_id= #{communityId}
  82. </if>
  83. where 1=1
  84. <if test="timeId !=null and timeId != ''">
  85. and t.time_id= #{timeId}
  86. </if>
  87. </update>
  88. <!-- 查询预约订单时间数量 add by wuxw 2018-07-03 -->
  89. <select id="queryReserveGoodsOrderTimesCount" parameterType="Map" resultType="Map">
  90. select count(1) count
  91. from reserve_goods_order_time t
  92. left join reserve_goods_order rgo on t.goods_id = rgo.goods_id and rgo.status_cd='0'
  93. where 1 =1
  94. <if test="appointmentTime !=null and appointmentTime != ''">
  95. and rgo.appointment_time = #{appointmentTime}
  96. </if>
  97. <if test="hours !=null and hours != ''">
  98. and t.hours= #{hours}
  99. </if>
  100. <if test="quantity !=null and quantity != ''">
  101. and t.quantity= #{quantity}
  102. </if>
  103. <if test="timeId !=null and timeId != ''">
  104. and t.time_id= #{timeId}
  105. </if>
  106. <if test="orderId !=null and orderId != ''">
  107. and t.order_id= #{orderId}
  108. </if>
  109. <if test="goodsId !=null and goodsId != ''">
  110. and t.goods_id= #{goodsId}
  111. </if>
  112. <if test="goodsIds !=null">
  113. and t.goods_id in
  114. <foreach collection="goodsIds" item="item" open="(" close=")" separator=",">
  115. #{item}
  116. </foreach>
  117. </if>
  118. <if test="statusCd !=null and statusCd != ''">
  119. and t.status_cd= #{statusCd}
  120. </if>
  121. <if test="state !=null and state != ''">
  122. and t.state= #{state}
  123. </if>
  124. <if test="communityId !=null and communityId != ''">
  125. and t.community_id= #{communityId}
  126. </if>
  127. </select>
  128. </mapper>