WechatMenuServiceDaoImplMapper.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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="wechatMenuServiceDaoImpl">
  6. <!-- 保存公众号菜单信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessWechatMenuInfo" parameterType="Map">
  8. insert into business_wechat_menu(
  9. pagepath,operate,app_id,menu_level,menu_name,menu_type,menu_value,b_id,community_id,wechat_menu_id
  10. ) values (
  11. #{pagepath},#{operate},#{appId},#{menuLevel},#{menuName},#{menuType},#{menuValue},#{bId},#{communityId},#{wechatMenuId}
  12. )
  13. </insert>
  14. <!-- 查询公众号菜单信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessWechatMenuInfo" parameterType="Map" resultType="Map">
  16. select t.pagepath,t.operate,t.app_id,t.app_id appId,t.menu_level,t.menu_level menuLevel,t.menu_name,t.menu_name menuName,t.menu_type,t.menu_type menuType,t.menu_value,t.menu_value menuValue,t.b_id,t.b_id bId,t.community_id,t.community_id communityId,t.wechat_menu_id,t.wechat_menu_id wechatMenuId
  17. from business_wechat_menu t
  18. where 1 =1
  19. <if test="pagepath !=null and pagepath != ''">
  20. and t.pagepath= #{pagepath}
  21. </if>
  22. <if test="operate !=null and operate != ''">
  23. and t.operate= #{operate}
  24. </if>
  25. <if test="appId !=null and appId != ''">
  26. and t.app_id= #{appId}
  27. </if>
  28. <if test="menuLevel !=null and menuLevel != ''">
  29. and t.menu_level= #{menuLevel}
  30. </if>
  31. <if test="menuName !=null and menuName != ''">
  32. and t.menu_name= #{menuName}
  33. </if>
  34. <if test="menuType !=null and menuType != ''">
  35. and t.menu_type= #{menuType}
  36. </if>
  37. <if test="menuValue !=null and menuValue != ''">
  38. and t.menu_value= #{menuValue}
  39. </if>
  40. <if test="bId !=null and bId != ''">
  41. and t.b_id= #{bId}
  42. </if>
  43. <if test="communityId !=null and communityId != ''">
  44. and t.community_id= #{communityId}
  45. </if>
  46. <if test="wechatMenuId !=null and wechatMenuId != ''">
  47. and t.wechat_menu_id= #{wechatMenuId}
  48. </if>
  49. </select>
  50. <!-- 保存公众号菜单信息至 instance表中 add by wuxw 2018-07-03 -->
  51. <insert id="saveWechatMenuInfoInstance" parameterType="Map">
  52. insert into wechat_menu(
  53. pagepath,app_id,menu_level,menu_name,menu_type,menu_value,status_cd,b_id,community_id,wechat_menu_id
  54. ) select t.pagepath,t.app_id,t.menu_level,t.menu_name,t.menu_type,t.menu_value,'0',t.b_id,t.community_id,t.wechat_menu_id from business_wechat_menu t where 1=1
  55. <if test="pagepath !=null and pagepath != ''">
  56. and t.pagepath= #{pagepath}
  57. </if>
  58. and t.operate= 'ADD'
  59. <if test="appId !=null and appId != ''">
  60. and t.app_id= #{appId}
  61. </if>
  62. <if test="menuLevel !=null and menuLevel != ''">
  63. and t.menu_level= #{menuLevel}
  64. </if>
  65. <if test="menuName !=null and menuName != ''">
  66. and t.menu_name= #{menuName}
  67. </if>
  68. <if test="menuType !=null and menuType != ''">
  69. and t.menu_type= #{menuType}
  70. </if>
  71. <if test="menuValue !=null and menuValue != ''">
  72. and t.menu_value= #{menuValue}
  73. </if>
  74. <if test="bId !=null and bId != ''">
  75. and t.b_id= #{bId}
  76. </if>
  77. <if test="communityId !=null and communityId != ''">
  78. and t.community_id= #{communityId}
  79. </if>
  80. <if test="wechatMenuId !=null and wechatMenuId != ''">
  81. and t.wechat_menu_id= #{wechatMenuId}
  82. </if>
  83. </insert>
  84. <!-- 查询公众号菜单信息 add by wuxw 2018-07-03 -->
  85. <select id="getWechatMenuInfo" parameterType="Map" resultType="Map">
  86. select t.pagepath,t.app_id,t.app_id appId,t.menu_level,t.menu_level menuLevel,t.menu_name,t.menu_name menuName,t.menu_type,t.menu_type menuType,t.menu_value,t.menu_value menuValue,t.status_cd,t.status_cd statusCd,t.b_id,t.b_id bId,t.community_id,t.community_id communityId,t.wechat_menu_id,t.wechat_menu_id wechatMenuId
  87. from wechat_menu t
  88. where 1 =1
  89. <if test="pagepath !=null and pagepath != ''">
  90. and t.pagepath= #{pagepath}
  91. </if>
  92. <if test="appId !=null and appId != ''">
  93. and t.app_id= #{appId}
  94. </if>
  95. <if test="menuLevel !=null and menuLevel != ''">
  96. and t.menu_level= #{menuLevel}
  97. </if>
  98. <if test="menuName !=null and menuName != ''">
  99. and t.menu_name= #{menuName}
  100. </if>
  101. <if test="menuType !=null and menuType != ''">
  102. and t.menu_type= #{menuType}
  103. </if>
  104. <if test="menuValue !=null and menuValue != ''">
  105. and t.menu_value= #{menuValue}
  106. </if>
  107. <if test="statusCd !=null and statusCd != ''">
  108. and t.status_cd= #{statusCd}
  109. </if>
  110. <if test="bId !=null and bId != ''">
  111. and t.b_id= #{bId}
  112. </if>
  113. <if test="communityId !=null and communityId != ''">
  114. and t.community_id= #{communityId}
  115. </if>
  116. <if test="wechatMenuId !=null and wechatMenuId != ''">
  117. and t.wechat_menu_id= #{wechatMenuId}
  118. </if>
  119. order by t.create_time desc
  120. <if test="page != -1 and page != null ">
  121. limit #{page}, #{row}
  122. </if>
  123. </select>
  124. <!-- 修改公众号菜单信息 add by wuxw 2018-07-03 -->
  125. <update id="updateWechatMenuInfoInstance" parameterType="Map">
  126. update wechat_menu t set t.status_cd = #{statusCd}
  127. <if test="newBId != null and newBId != ''">
  128. ,t.b_id = #{newBId}
  129. </if>
  130. <if test="pagepath !=null and pagepath != ''">
  131. , t.pagepath= #{pagepath}
  132. </if>
  133. <if test="appId !=null and appId != ''">
  134. , t.app_id= #{appId}
  135. </if>
  136. <if test="menuLevel !=null and menuLevel != ''">
  137. , t.menu_level= #{menuLevel}
  138. </if>
  139. <if test="menuName !=null and menuName != ''">
  140. , t.menu_name= #{menuName}
  141. </if>
  142. <if test="menuType !=null and menuType != ''">
  143. , t.menu_type= #{menuType}
  144. </if>
  145. <if test="menuValue !=null and menuValue != ''">
  146. , t.menu_value= #{menuValue}
  147. </if>
  148. <if test="communityId !=null and communityId != ''">
  149. , t.community_id= #{communityId}
  150. </if>
  151. where 1=1 <if test="bId !=null and bId != ''">
  152. and t.b_id= #{bId}
  153. </if>
  154. <if test="wechatMenuId !=null and wechatMenuId != ''">
  155. and t.wechat_menu_id= #{wechatMenuId}
  156. </if>
  157. </update>
  158. <!-- 查询公众号菜单数量 add by wuxw 2018-07-03 -->
  159. <select id="queryWechatMenusCount" parameterType="Map" resultType="Map">
  160. select count(1) count
  161. from wechat_menu t
  162. where 1 =1
  163. <if test="pagepath !=null and pagepath != ''">
  164. and t.pagepath= #{pagepath}
  165. </if>
  166. <if test="appId !=null and appId != ''">
  167. and t.app_id= #{appId}
  168. </if>
  169. <if test="menuLevel !=null and menuLevel != ''">
  170. and t.menu_level= #{menuLevel}
  171. </if>
  172. <if test="menuName !=null and menuName != ''">
  173. and t.menu_name= #{menuName}
  174. </if>
  175. <if test="menuType !=null and menuType != ''">
  176. and t.menu_type= #{menuType}
  177. </if>
  178. <if test="menuValue !=null and menuValue != ''">
  179. and t.menu_value= #{menuValue}
  180. </if>
  181. <if test="statusCd !=null and statusCd != ''">
  182. and t.status_cd= #{statusCd}
  183. </if>
  184. <if test="bId !=null and bId != ''">
  185. and t.b_id= #{bId}
  186. </if>
  187. <if test="communityId !=null and communityId != ''">
  188. and t.community_id= #{communityId}
  189. </if>
  190. <if test="wechatMenuId !=null and wechatMenuId != ''">
  191. and t.wechat_menu_id= #{wechatMenuId}
  192. </if>
  193. </select>
  194. </mapper>