FeeDiscountSpecServiceDaoImplMapper.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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="feeDiscountSpecServiceDaoImpl">
  6. <!-- 保存费用折扣信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveFeeDiscountSpecInfo" parameterType="Map">
  8. insert into fee_discount_spec(
  9. spec_id,spec_name,spec_value,discount_id,community_id, discount_spec_id
  10. ) values (
  11. #{specId},#{specName},#{specValue},#{discountId},#{communityId},#{discountSpecId}
  12. )
  13. </insert>
  14. <!-- 查询费用折扣信息 add by wuxw 2018-07-03 -->
  15. <select id="getFeeDiscountSpecInfo" parameterType="Map" resultType="Map">
  16. select t.spec_id,t.spec_id specId,t.spec_name,t.spec_name specName,t.spec_value,t.spec_value
  17. specValue,t.status_cd,t.status_cd statusCd,t.discount_id,t.discount_id discountId,t.community_id,t.community_id
  18. communityId,t.discount_spec_id discountSpecId
  19. from fee_discount_spec t
  20. where 1 =1
  21. <if test="specId !=null and specId != ''">
  22. and t.spec_id= #{specId}
  23. </if>
  24. <if test="specName !=null and specName != ''">
  25. and t.spec_name= #{specName}
  26. </if>
  27. <if test="specValue !=null and specValue != ''">
  28. and t.spec_value= #{specValue}
  29. </if>
  30. <if test="statusCd !=null and statusCd != ''">
  31. and t.status_cd= #{statusCd}
  32. </if>
  33. <if test="discountId !=null and discountId != ''">
  34. and t.discount_id= #{discountId}
  35. </if>
  36. <if test="discountIds !=null ">
  37. and t.discount_id in
  38. <foreach collection="discountIds" item="item" open="(" close=")" separator=",">
  39. #{item}
  40. </foreach>
  41. </if>
  42. <if test="communityId !=null and communityId != ''">
  43. and t.community_id= #{communityId}
  44. </if>
  45. <if test="discountSpecId !=null and discountSpecId != ''">
  46. and t.discount_spec_id= #{discountSpecId}
  47. </if>
  48. order by t.create_time desc
  49. <if test="page != -1 and page != null ">
  50. limit #{page}, #{row}
  51. </if>
  52. </select>
  53. <!-- 修改费用折扣信息 add by wuxw 2018-07-03 -->
  54. <update id="updateFeeDiscountSpecInfo" parameterType="Map">
  55. update fee_discount_spec t set t.status_cd = #{statusCd}
  56. <if test="newBId != null and newBId != ''">
  57. ,t.b_id = #{newBId}
  58. </if>
  59. <if test="specName !=null and specName != ''">
  60. , t.spec_name= #{specName}
  61. </if>
  62. <if test="specValue !=null and specValue != ''">
  63. , t.spec_value= #{specValue}
  64. </if>
  65. where 1=1
  66. <if test="specId !=null and specId != ''">
  67. and t.spec_id= #{specId}
  68. </if>
  69. <if test="discountId !=null and discountId != ''">
  70. and t.discount_id= #{discountId}
  71. </if>
  72. <if test="discountSpecId !=null and discountSpecId != ''">
  73. and t.discount_spec_id= #{discountSpecId}
  74. </if>
  75. <if test="communityId !=null and communityId != ''">
  76. and t.community_id= #{communityId}
  77. </if>
  78. </update>
  79. <!-- 查询费用折扣数量 add by wuxw 2018-07-03 -->
  80. <select id="queryFeeDiscountSpecsCount" parameterType="Map" resultType="Map">
  81. select count(1) count
  82. from fee_discount_spec t
  83. where 1 =1
  84. <if test="specId !=null and specId != ''">
  85. and t.spec_id= #{specId}
  86. </if>
  87. <if test="specName !=null and specName != ''">
  88. and t.spec_name= #{specName}
  89. </if>
  90. <if test="specValue !=null and specValue != ''">
  91. and t.spec_value= #{specValue}
  92. </if>
  93. <if test="statusCd !=null and statusCd != ''">
  94. and t.status_cd= #{statusCd}
  95. </if>
  96. <if test="discountId !=null and discountId != ''">
  97. and t.discount_id= #{discountId}
  98. </if>
  99. <if test="communityId !=null and communityId != ''">
  100. and t.community_id= #{communityId}
  101. </if>
  102. <if test="discountSpecId !=null and discountSpecId != ''">
  103. and t.discount_spec_id= #{discountSpecId}
  104. </if>
  105. </select>
  106. </mapper>