CommunitySettingServiceDaoImplMapper.xml 4.6 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="communitySettingServiceDaoImpl">
  6. <!-- 保存小区相关设置信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveCommunitySettingInfo" parameterType="Map">
  8. insert into community_setting(
  9. cs_id,setting_value,remark,community_id,setting_key,setting_type,setting_name
  10. ) values (
  11. #{csId},#{settingValue},#{remark},#{communityId},#{settingKey},#{settingType},#{settingName}
  12. )
  13. </insert>
  14. <!-- 查询小区相关设置信息 add by wuxw 2018-07-03 -->
  15. <select id="getCommunitySettingInfo" parameterType="Map" resultType="Map">
  16. select t.cs_id,t.cs_id csId,t.setting_value,t.setting_value settingValue,t.remark,t.status_cd,t.status_cd
  17. statusCd,t.community_id,t.community_id communityId,t.setting_key,t.setting_key
  18. settingKey,t.setting_type,t.setting_type settingType,t.setting_name,t.setting_name settingName,
  19. td.name settingTypeName
  20. from community_setting t
  21. left join t_dict td on t.setting_type = td.status_cd and td.table_name = 'community_setting_key' and
  22. td.table_columns = 'setting_type'
  23. where 1 = 1
  24. <if test="csId !=null and csId != ''">
  25. and t.cs_id= #{csId}
  26. </if>
  27. <if test="settingValue !=null and settingValue != ''">
  28. and t.setting_value= #{settingValue}
  29. </if>
  30. <if test="remark !=null and remark != ''">
  31. and t.remark= #{remark}
  32. </if>
  33. <if test="statusCd !=null and statusCd != ''">
  34. and t.status_cd= #{statusCd}
  35. </if>
  36. <if test="communityId !=null and communityId != ''">
  37. and t.community_id= #{communityId}
  38. </if>
  39. <if test="settingKey !=null and settingKey != ''">
  40. and t.setting_key= #{settingKey}
  41. </if>
  42. <if test="settingType !=null and settingType != ''">
  43. and t.setting_type= #{settingType}
  44. </if>
  45. <if test="settingName !=null and settingName != ''">
  46. and t.setting_name= #{settingName}
  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="updateCommunitySettingInfo" parameterType="Map">
  55. update community_setting t set t.status_cd = #{statusCd}
  56. <if test="newBId != null and newBId != ''">
  57. ,t.b_id = #{newBId}
  58. </if>
  59. <if test="settingValue !=null and settingValue != ''">
  60. , t.setting_value= #{settingValue}
  61. </if>
  62. <if test="remark !=null and remark != ''">
  63. , t.remark= #{remark}
  64. </if>
  65. <if test="communityId !=null and communityId != ''">
  66. , t.community_id= #{communityId}
  67. </if>
  68. <if test="settingKey !=null and settingKey != ''">
  69. , t.setting_key= #{settingKey}
  70. </if>
  71. <if test="settingType !=null and settingType != ''">
  72. , t.setting_type= #{settingType}
  73. </if>
  74. <if test="settingName !=null and settingName != ''">
  75. , t.setting_name= #{settingName}
  76. </if>
  77. where 1=1
  78. <if test="csId !=null and csId != ''">
  79. and t.cs_id= #{csId}
  80. </if>
  81. </update>
  82. <!-- 查询小区相关设置数量 add by wuxw 2018-07-03 -->
  83. <select id="queryCommunitySettingsCount" parameterType="Map" resultType="Map">
  84. select count(1) count
  85. from community_setting t
  86. where 1 =1
  87. <if test="csId !=null and csId != ''">
  88. and t.cs_id= #{csId}
  89. </if>
  90. <if test="settingValue !=null and settingValue != ''">
  91. and t.setting_value= #{settingValue}
  92. </if>
  93. <if test="remark !=null and remark != ''">
  94. and t.remark= #{remark}
  95. </if>
  96. <if test="statusCd !=null and statusCd != ''">
  97. and t.status_cd= #{statusCd}
  98. </if>
  99. <if test="communityId !=null and communityId != ''">
  100. and t.community_id= #{communityId}
  101. </if>
  102. <if test="settingKey !=null and settingKey != ''">
  103. and t.setting_key= #{settingKey}
  104. </if>
  105. <if test="settingType !=null and settingType != ''">
  106. and t.setting_type= #{settingType}
  107. </if>
  108. <if test="settingName !=null and settingName != ''">
  109. and t.setting_name= #{settingName}
  110. </if>
  111. </select>
  112. </mapper>