ReserveGoodsOrderTimeV1ServiceDaoImplMapper.xml 5.4 KB

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