CommunitySpaceConfirmOrderV1ServiceDaoImplMapper.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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="communitySpaceConfirmOrderV1ServiceDaoImpl">
  6. <!-- 保存场地预约核销信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveCommunitySpaceConfirmOrderInfo" parameterType="Map">
  8. insert into community_space_confirm_order(
  9. space_id,csp_id,time_id,order_id,remark,community_id
  10. ) values (
  11. #{spaceId},#{cspId},#{timeId},#{orderId},#{remark},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询场地预约核销信息 add by wuxw 2018-07-03 -->
  15. <select id="getCommunitySpaceConfirmOrderInfo" parameterType="Map" resultType="Map">
  16. select t.space_id,t.space_id spaceId,t.csp_id,t.csp_id cspId,t.time_id,t.time_id timeId,t.order_id,t.order_id
  17. orderId,t.remark,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,
  18. cs.name spaceName,csp.person_name personName,csp.person_tel personTel,csp.appointment_time appointmentTime,
  19. cspt.hours,t.create_time createTime
  20. from community_space_confirm_order t
  21. left join community_space_person_time cspt on t.time_id = cspt.time_id and cspt.status_cd = '0'
  22. left join community_space_person csp on t.csp_id = csp.csp_id and csp.status_cd = '0'
  23. left join community_space cs on csp.space_id = cs.space_id and cs.status_cd = '0'
  24. where 1 =1
  25. <if test="personName !=null and personName != ''">
  26. and csp.person_name like concat('%',#{personName},'%')
  27. </if>
  28. <if test="personTel !=null and personTel != ''">
  29. and csp.person_tel = #{personTel}
  30. </if>
  31. <if test="appointmentTime !=null and appointmentTime != ''">
  32. and csp.appointment_time = #{appointmentTime}
  33. </if>
  34. <if test="spaceId !=null and spaceId != ''">
  35. and t.space_id= #{spaceId}
  36. </if>
  37. <if test="cspId !=null and cspId != ''">
  38. and t.csp_id= #{cspId}
  39. </if>
  40. <if test="timeId !=null and timeId != ''">
  41. and t.time_id= #{timeId}
  42. </if>
  43. <if test="orderId !=null and orderId != ''">
  44. and t.order_id= #{orderId}
  45. </if>
  46. <if test="remark !=null and remark != ''">
  47. and t.remark= #{remark}
  48. </if>
  49. <if test="statusCd !=null and statusCd != ''">
  50. and t.status_cd= #{statusCd}
  51. </if>
  52. <if test="communityId !=null and communityId != ''">
  53. and t.community_id= #{communityId}
  54. </if>
  55. order by t.create_time desc
  56. <if test="page != -1 and page != null ">
  57. limit #{page}, #{row}
  58. </if>
  59. </select>
  60. <!-- 修改场地预约核销信息 add by wuxw 2018-07-03 -->
  61. <update id="updateCommunitySpaceConfirmOrderInfo" parameterType="Map">
  62. update community_space_confirm_order t set t.status_cd = #{statusCd}
  63. <if test="newBId != null and newBId != ''">
  64. ,t.b_id = #{newBId}
  65. </if>
  66. <if test="spaceId !=null and spaceId != ''">
  67. , t.space_id= #{spaceId}
  68. </if>
  69. <if test="cspId !=null and cspId != ''">
  70. , t.csp_id= #{cspId}
  71. </if>
  72. <if test="timeId !=null and timeId != ''">
  73. , t.time_id= #{timeId}
  74. </if>
  75. <if test="remark !=null and remark != ''">
  76. , t.remark= #{remark}
  77. </if>
  78. <if test="communityId !=null and communityId != ''">
  79. , t.community_id= #{communityId}
  80. </if>
  81. where 1=1
  82. <if test="orderId !=null and orderId != ''">
  83. and t.order_id= #{orderId}
  84. </if>
  85. </update>
  86. <!-- 查询场地预约核销数量 add by wuxw 2018-07-03 -->
  87. <select id="queryCommunitySpaceConfirmOrdersCount" parameterType="Map" resultType="Map">
  88. select count(1) count
  89. from community_space_confirm_order t
  90. left join community_space_person_time cspt on t.time_id = cspt.time_id and cspt.status_cd = '0'
  91. left join community_space_person csp on t.csp_id = csp.csp_id and csp.status_cd = '0'
  92. left join community_space cs on csp.space_id = cs.space_id and cs.status_cd = '0'
  93. where 1 =1
  94. <if test="personName !=null and personName != ''">
  95. and csp.person_name like concat('%',#{personName},'%')
  96. </if>
  97. <if test="personTel !=null and personTel != ''">
  98. and csp.person_tel = #{personTel}
  99. </if>
  100. <if test="appointmentTime !=null and appointmentTime != ''">
  101. and csp.appointment_time = #{appointmentTime}
  102. </if>
  103. <if test="spaceId !=null and spaceId != ''">
  104. and t.space_id= #{spaceId}
  105. </if>
  106. <if test="cspId !=null and cspId != ''">
  107. and t.csp_id= #{cspId}
  108. </if>
  109. <if test="timeId !=null and timeId != ''">
  110. and t.time_id= #{timeId}
  111. </if>
  112. <if test="orderId !=null and orderId != ''">
  113. and t.order_id= #{orderId}
  114. </if>
  115. <if test="remark !=null and remark != ''">
  116. and t.remark= #{remark}
  117. </if>
  118. <if test="statusCd !=null and statusCd != ''">
  119. and t.status_cd= #{statusCd}
  120. </if>
  121. <if test="communityId !=null and communityId != ''">
  122. and t.community_id= #{communityId}
  123. </if>
  124. </select>
  125. </mapper>