IntegralConfigV1ServiceDaoImplMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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="integralConfigV1ServiceDaoImpl">
  6. <!-- 保存积分标准信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveIntegralConfigInfo" parameterType="Map">
  8. insert into integral_config(
  9. square_price,config_name,computing_formula,config_id,additional_amount,scale,community_id
  10. ) values (
  11. #{squarePrice},#{configName},#{computingFormula},#{configId},#{additionalAmount},#{scale},#{communityId}
  12. )
  13. </insert>
  14. <!-- 查询积分标准信息 add by wuxw 2018-07-03 -->
  15. <select id="getIntegralConfigInfo" parameterType="Map" resultType="Map">
  16. select t.square_price,t.square_price squarePrice,t.config_name,t.config_name
  17. configName,t.computing_formula,t.computing_formula computingFormula,t.config_id,t.config_id
  18. configId,t.additional_amount,t.additional_amount additionalAmount,t.scale,t.status_cd,t.status_cd
  19. statusCd,t.community_id,t.community_id communityId,td.name computingFormulaName,td1.`name` scaleName
  20. from integral_config t
  21. left join t_dict td on t.computing_formula = td.status_cd and td.table_name = 'integral_config' and td.table_columns = 'computing_formula'
  22. left join t_dict td1 on t.scale = td1.status_cd and td1.table_name = 'integral_config' and td1.table_columns = 'scale'
  23. where 1 =1
  24. <if test="squarePrice !=null and squarePrice != ''">
  25. and t.square_price= #{squarePrice}
  26. </if>
  27. <if test="configName !=null and configName != ''">
  28. and t.config_name= #{configName}
  29. </if>
  30. <if test="computingFormula !=null and computingFormula != ''">
  31. and t.computing_formula= #{computingFormula}
  32. </if>
  33. <if test="configId !=null and configId != ''">
  34. and t.config_id= #{configId}
  35. </if>
  36. <if test="additionalAmount !=null and additionalAmount != ''">
  37. and t.additional_amount= #{additionalAmount}
  38. </if>
  39. <if test="scale !=null and scale != ''">
  40. and t.scale= #{scale}
  41. </if>
  42. <if test="statusCd !=null and statusCd != ''">
  43. and t.status_cd= #{statusCd}
  44. </if>
  45. <if test="communityId !=null and communityId != ''">
  46. and t.community_id= #{communityId}
  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="updateIntegralConfigInfo" parameterType="Map">
  55. update integral_config t set t.status_cd = #{statusCd}
  56. <if test="newBId != null and newBId != ''">
  57. ,t.b_id = #{newBId}
  58. </if>
  59. <if test="squarePrice !=null and squarePrice != ''">
  60. , t.square_price= #{squarePrice}
  61. </if>
  62. <if test="configName !=null and configName != ''">
  63. , t.config_name= #{configName}
  64. </if>
  65. <if test="computingFormula !=null and computingFormula != ''">
  66. , t.computing_formula= #{computingFormula}
  67. </if>
  68. <if test="additionalAmount !=null and additionalAmount != ''">
  69. , t.additional_amount= #{additionalAmount}
  70. </if>
  71. <if test="scale !=null and scale != ''">
  72. , t.scale= #{scale}
  73. </if>
  74. <if test="communityId !=null and communityId != ''">
  75. , t.community_id= #{communityId}
  76. </if>
  77. where 1=1
  78. <if test="configId !=null and configId != ''">
  79. and t.config_id= #{configId}
  80. </if>
  81. </update>
  82. <!-- 查询积分标准数量 add by wuxw 2018-07-03 -->
  83. <select id="queryIntegralConfigsCount" parameterType="Map" resultType="Map">
  84. select count(1) count
  85. from integral_config t
  86. where 1 =1
  87. <if test="squarePrice !=null and squarePrice != ''">
  88. and t.square_price= #{squarePrice}
  89. </if>
  90. <if test="configName !=null and configName != ''">
  91. and t.config_name= #{configName}
  92. </if>
  93. <if test="computingFormula !=null and computingFormula != ''">
  94. and t.computing_formula= #{computingFormula}
  95. </if>
  96. <if test="configId !=null and configId != ''">
  97. and t.config_id= #{configId}
  98. </if>
  99. <if test="additionalAmount !=null and additionalAmount != ''">
  100. and t.additional_amount= #{additionalAmount}
  101. </if>
  102. <if test="scale !=null and scale != ''">
  103. and t.scale= #{scale}
  104. </if>
  105. <if test="statusCd !=null and statusCd != ''">
  106. and t.status_cd= #{statusCd}
  107. </if>
  108. <if test="communityId !=null and communityId != ''">
  109. and t.community_id= #{communityId}
  110. </if>
  111. </select>
  112. </mapper>