FeeDiscountServiceDaoImplMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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="feeDiscountServiceDaoImpl">
  6. <!-- 保存费用折扣信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveFeeDiscountInfo" parameterType="Map">
  8. insert into fee_discount(
  9. discount_name,discount_desc,discount_type,discount_id,community_id,rule_id
  10. ) values (
  11. #{discountName},#{discountDesc},#{discountType},#{discountId},#{communityId},#{ruleId}
  12. )
  13. </insert>
  14. <!-- 查询费用折扣信息 add by wuxw 2018-07-03 -->
  15. <select id="getFeeDiscountInfo" parameterType="Map" resultType="Map">
  16. select t.discount_name,t.discount_name discountName,t.discount_desc,t.discount_desc
  17. discountDesc,t.discount_type,t.discount_type discountType,td.name discountTypeName,t.status_cd,t.status_cd
  18. statusCd,t.discount_id,t.discount_id discountId,t.community_id,t.community_id communityId,t.rule_id,t.rule_id
  19. ruleId,t.create_time createTime,fdr.rule_name ruleName,fdr.bean_impl beanImpl
  20. from fee_discount t
  21. left join fee_discount_rule fdr on t.rule_id = fdr.rule_id and fdr.status_cd = '0'
  22. left join t_dict td on td.status_cd = t.discount_type and td.table_name = 'fee_discount'
  23. and table_columns = 'discount_type'
  24. where 1 = 1
  25. <if test="discountName !=null and discountName != ''">
  26. and t.discount_name like '%${discountName}%'
  27. </if>
  28. <if test="ruleName !=null and ruleName != ''">
  29. and fdr.rule_name like '%${ruleName}%'
  30. </if>
  31. <if test="discountDesc !=null and discountDesc != ''">
  32. and t.discount_desc= #{discountDesc}
  33. </if>
  34. <if test="discountType !=null and discountType != ''">
  35. and t.discount_type= #{discountType}
  36. </if>
  37. <if test="statusCd !=null and statusCd != ''">
  38. and t.status_cd= #{statusCd}
  39. </if>
  40. <if test="discountId !=null and discountId != ''">
  41. and t.discount_id= #{discountId}
  42. </if>
  43. <if test="communityId !=null and communityId != ''">
  44. and t.community_id= #{communityId}
  45. </if>
  46. <if test="ruleId !=null and ruleId != ''">
  47. and t.rule_id= #{ruleId}
  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="updateFeeDiscountInfo" parameterType="Map">
  56. update fee_discount t set t.status_cd = #{statusCd}
  57. <if test="newBId != null and newBId != ''">
  58. ,t.b_id = #{newBId}
  59. </if>
  60. <if test="discountName !=null and discountName != ''">
  61. , t.discount_name= #{discountName}
  62. </if>
  63. <if test="discountDesc !=null and discountDesc != ''">
  64. , t.discount_desc= #{discountDesc}
  65. </if>
  66. <if test="discountType !=null and discountType != ''">
  67. , t.discount_type= #{discountType}
  68. </if>
  69. <if test="communityId !=null and communityId != ''">
  70. , t.community_id= #{communityId}
  71. </if>
  72. <if test="ruleId !=null and ruleId != ''">
  73. , t.rule_id= #{ruleId}
  74. </if>
  75. where 1=1
  76. <if test="discountId !=null and discountId != ''">
  77. and t.discount_id= #{discountId}
  78. </if>
  79. </update>
  80. <!-- 查询费用折扣数量 add by wuxw 2018-07-03 -->
  81. <select id="queryFeeDiscountsCount" parameterType="Map" resultType="Map">
  82. select count(1) count
  83. from fee_discount t
  84. left join fee_discount_rule fdr on t.rule_id = fdr.rule_id and fdr.status_cd = '0'
  85. where 1 = 1
  86. <if test="discountName !=null and discountName != ''">
  87. and t.discount_name like '%${discountName}%'
  88. </if>
  89. <if test="ruleName !=null and ruleName != ''">
  90. and fdr.rule_name like '%${ruleName}%'
  91. </if>
  92. <if test="discountDesc !=null and discountDesc != ''">
  93. and t.discount_desc= #{discountDesc}
  94. </if>
  95. <if test="discountType !=null and discountType != ''">
  96. and t.discount_type= #{discountType}
  97. </if>
  98. <if test="statusCd !=null and statusCd != ''">
  99. and t.status_cd= #{statusCd}
  100. </if>
  101. <if test="discountId !=null and discountId != ''">
  102. and t.discount_id= #{discountId}
  103. </if>
  104. <if test="communityId !=null and communityId != ''">
  105. and t.community_id= #{communityId}
  106. </if>
  107. <if test="ruleId !=null and ruleId != ''">
  108. and t.rule_id= #{ruleId}
  109. </if>
  110. </select>
  111. </mapper>