CommunitySpaceV1ServiceDaoImplMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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="communitySpaceV1ServiceDaoImpl">
  6. <!-- 保存小区场地信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveCommunitySpaceInfo" parameterType="Map">
  8. insert into community_space(
  9. admin_name,space_id,name,start_time,tel,end_time,state,community_id,fee_money
  10. ) values (
  11. #{adminName},#{spaceId},#{name},#{startTime},#{tel},#{endTime},#{state},#{communityId},#{feeMoney}
  12. )
  13. </insert>
  14. <!-- 查询小区场地信息 add by wuxw 2018-07-03 -->
  15. <select id="getCommunitySpaceInfo" parameterType="Map" resultType="Map">
  16. select t.admin_name,t.admin_name adminName,t.space_id,t.space_id spaceId,t.name,t.start_time,t.start_time startTime,t.tel,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time endTime,t.state,t.community_id,t.community_id communityId,t.fee_money,t.fee_money feeMoney
  17. from community_space t
  18. where 1 =1
  19. <if test="adminName !=null and adminName != ''">
  20. and t.admin_name= #{adminName}
  21. </if>
  22. <if test="spaceId !=null and spaceId != ''">
  23. and t.space_id= #{spaceId}
  24. </if>
  25. <if test="name !=null and name != ''">
  26. and t.name= #{name}
  27. </if>
  28. <if test="startTime !=null and startTime != ''">
  29. and t.start_time= #{startTime}
  30. </if>
  31. <if test="tel !=null and tel != ''">
  32. and t.tel= #{tel}
  33. </if>
  34. <if test="statusCd !=null and statusCd != ''">
  35. and t.status_cd= #{statusCd}
  36. </if>
  37. <if test="endTime !=null and endTime != ''">
  38. and t.end_time= #{endTime}
  39. </if>
  40. <if test="state !=null and state != ''">
  41. and t.state= #{state}
  42. </if>
  43. <if test="communityId !=null and communityId != ''">
  44. and t.community_id= #{communityId}
  45. </if>
  46. <if test="feeMoney !=null and feeMoney != ''">
  47. and t.fee_money= #{feeMoney}
  48. </if>
  49. order by t.create_time desc
  50. <if test="page != -1 and page != null ">
  51. limit #{page}, #{row}
  52. </if>
  53. </select>
  54. <!-- 修改小区场地信息 add by wuxw 2018-07-03 -->
  55. <update id="updateCommunitySpaceInfo" parameterType="Map">
  56. update community_space t set t.status_cd = #{statusCd}
  57. <if test="newBId != null and newBId != ''">
  58. ,t.b_id = #{newBId}
  59. </if>
  60. <if test="adminName !=null and adminName != ''">
  61. , t.admin_name= #{adminName}
  62. </if>
  63. <if test="name !=null and name != ''">
  64. , t.name= #{name}
  65. </if>
  66. <if test="startTime !=null and startTime != ''">
  67. , t.start_time= #{startTime}
  68. </if>
  69. <if test="tel !=null and tel != ''">
  70. , t.tel= #{tel}
  71. </if>
  72. <if test="endTime !=null and endTime != ''">
  73. , t.end_time= #{endTime}
  74. </if>
  75. <if test="state !=null and state != ''">
  76. , t.state= #{state}
  77. </if>
  78. <if test="communityId !=null and communityId != ''">
  79. , t.community_id= #{communityId}
  80. </if>
  81. <if test="feeMoney !=null and feeMoney != ''">
  82. , t.fee_money= #{feeMoney}
  83. </if>
  84. where 1=1 <if test="spaceId !=null and spaceId != ''">
  85. and t.space_id= #{spaceId}
  86. </if>
  87. </update>
  88. <!-- 查询小区场地数量 add by wuxw 2018-07-03 -->
  89. <select id="queryCommunitySpacesCount" parameterType="Map" resultType="Map">
  90. select count(1) count
  91. from community_space t
  92. where 1 =1
  93. <if test="adminName !=null and adminName != ''">
  94. and t.admin_name= #{adminName}
  95. </if>
  96. <if test="spaceId !=null and spaceId != ''">
  97. and t.space_id= #{spaceId}
  98. </if>
  99. <if test="name !=null and name != ''">
  100. and t.name= #{name}
  101. </if>
  102. <if test="startTime !=null and startTime != ''">
  103. and t.start_time= #{startTime}
  104. </if>
  105. <if test="tel !=null and tel != ''">
  106. and t.tel= #{tel}
  107. </if>
  108. <if test="statusCd !=null and statusCd != ''">
  109. and t.status_cd= #{statusCd}
  110. </if>
  111. <if test="endTime !=null and endTime != ''">
  112. and t.end_time= #{endTime}
  113. </if>
  114. <if test="state !=null and state != ''">
  115. and t.state= #{state}
  116. </if>
  117. <if test="communityId !=null and communityId != ''">
  118. and t.community_id= #{communityId}
  119. </if>
  120. <if test="feeMoney !=null and feeMoney != ''">
  121. and t.fee_money= #{feeMoney}
  122. </if>
  123. </select>
  124. </mapper>