FeeDiscountRuleSpecServiceDaoImplMapper.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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="feeDiscountRuleSpecServiceDaoImpl">
  6. <!-- 保存折扣规则配置信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveFeeDiscountRuleSpecInfo" parameterType="Map">
  8. insert into fee_discount_rule_spec(
  9. spec_id,spec_name,remark,rule_id
  10. ) values (
  11. #{specId},#{specName},#{remark},#{ruleId}
  12. )
  13. </insert>
  14. <!-- 查询折扣规则配置信息 add by wuxw 2018-07-03 -->
  15. <select id="getFeeDiscountRuleSpecInfo" parameterType="Map" resultType="Map">
  16. select t.spec_id,t.spec_id specId,t.spec_name,t.spec_name specName,t.remark,t.status_cd,t.status_cd
  17. statusCd,t.rule_id,t.rule_id ruleId
  18. from fee_discount_rule_spec t
  19. where 1 =1
  20. <if test="specId !=null and specId != ''">
  21. and t.spec_id= #{specId}
  22. </if>
  23. <if test="specName !=null and specName != ''">
  24. and t.spec_name= #{specName}
  25. </if>
  26. <if test="remark !=null and remark != ''">
  27. and t.remark= #{remark}
  28. </if>
  29. <if test="statusCd !=null and statusCd != ''">
  30. and t.status_cd= #{statusCd}
  31. </if>
  32. <if test="ruleId !=null and ruleId != ''">
  33. and t.rule_id= #{ruleId}
  34. </if>
  35. <if test="ruleIds !=null ">
  36. and t.rule_id in
  37. <foreach collection="ruleIds" item="item" index="index" open="(" close=")" separator=",">
  38. #{item}
  39. </foreach>
  40. </if>
  41. order by t.create_time desc
  42. <if test="page != -1 and page != null ">
  43. limit #{page}, #{row}
  44. </if>
  45. </select>
  46. <!-- 修改折扣规则配置信息 add by wuxw 2018-07-03 -->
  47. <update id="updateFeeDiscountRuleSpecInfo" parameterType="Map">
  48. update fee_discount_rule_spec t set t.status_cd = #{statusCd}
  49. <if test="newBId != null and newBId != ''">
  50. ,t.b_id = #{newBId}
  51. </if>
  52. <if test="specName !=null and specName != ''">
  53. , t.spec_name= #{specName}
  54. </if>
  55. <if test="remark !=null and remark != ''">
  56. , t.remark= #{remark}
  57. </if>
  58. <if test="ruleId !=null and ruleId != ''">
  59. , t.rule_id= #{ruleId}
  60. </if>
  61. where 1=1
  62. <if test="specId !=null and specId != ''">
  63. and t.spec_id= #{specId}
  64. </if>
  65. </update>
  66. <!-- 查询折扣规则配置数量 add by wuxw 2018-07-03 -->
  67. <select id="queryFeeDiscountRuleSpecsCount" parameterType="Map" resultType="Map">
  68. select count(1) count
  69. from fee_discount_rule_spec t
  70. where 1 =1
  71. <if test="specId !=null and specId != ''">
  72. and t.spec_id= #{specId}
  73. </if>
  74. <if test="specName !=null and specName != ''">
  75. and t.spec_name= #{specName}
  76. </if>
  77. <if test="remark !=null and remark != ''">
  78. and t.remark= #{remark}
  79. </if>
  80. <if test="statusCd !=null and statusCd != ''">
  81. and t.status_cd= #{statusCd}
  82. </if>
  83. <if test="ruleId !=null and ruleId != ''">
  84. and t.rule_id= #{ruleId}
  85. </if>
  86. </select>
  87. </mapper>