SmallWeChatServiceDaoImplMapper.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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="smallWeChatServiceDaoImpl">
  6. <!-- 保存小程序管理信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessSmallWeChatInfo" parameterType="Map">
  8. insert into
  9. buiness_small_wechat
  10. (operate,appId,name,appSecret,wechat_id,b_id,store_Id,pay_password,remarks,obj_id,obj_type,mch_id,wechat_type)
  11. values
  12. (#{operate},#{appId},#{name},#{appSecret},#{weChatId},#{bId},#{storeId},#{payPassword},#{remarks},#{objId},#{objType},#{mchId},#{weChatType})
  13. </insert>
  14. <!-- 查询小程序管理信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessSmallWeChatInfo" parameterType="Map" resultType="Map">
  16. select
  17. t.operate,
  18. t.create_time,t.create_time createTime,
  19. t.appId,
  20. t.name,
  21. t.appSecret,
  22. t.wechat_id,t.wechat_id weChatId,
  23. t.b_id,t.b_id bId,
  24. t.store_Id,t.store_Id storeId,
  25. t.pay_password,t.pay_password payPassword,
  26. t.remarks,
  27. t.obj_id,t.obj_id objId,
  28. t.obj_type,t.obj_type objType,
  29. t.mch_id,t.mch_id mchId,
  30. t.wechat_type,t.wechat_type weChatType
  31. from
  32. buiness_small_wechat t
  33. where 1 =1
  34. <if test="operate !=null and operate != ''">
  35. and t.operate= #{operate}
  36. </if>
  37. <if test="createTime !=null and createTime != ''">
  38. and t.create_time= #{createTime}
  39. </if>
  40. <if test="appId !=null and appId != ''">
  41. and t.appId= #{appId}
  42. </if>
  43. <if test="name !=null and name != ''">
  44. and t.name= #{name}
  45. </if>
  46. <if test="weChatType !=null and weChatType != ''">
  47. and t.wechat_type= #{weChatType}
  48. </if>
  49. <if test="appSecret !=null and appSecret != ''">
  50. and t.appSecret= #{appSecret}
  51. </if>
  52. <if test="weChatId !=null and weChatId != ''">
  53. and t.wechat_id= #{weChatId}
  54. </if>
  55. <if test="bId !=null and bId != ''">
  56. and t.b_id= #{bId}
  57. </if>
  58. <if test="storeId !=null and storeId != ''">
  59. and t.store_Id= #{storeId}
  60. </if>
  61. <if test="payPassword !=null and payPassword != ''">
  62. and t.pay_password= #{payPassword}
  63. </if>
  64. <if test="remarks !=null and remarks != ''">
  65. and t.remarks= #{remarks}
  66. </if>
  67. </select>
  68. <!-- 保存小程序管理信息至 instance表中 add by wuxw 2018-07-03 -->
  69. <insert id="saveSmallWeChatInfoInstance" parameterType="Map">
  70. insert into
  71. small_wechat
  72. (create_time,appId,name,appSecret,status_cd,wechat_id,b_id,store_Id,pay_password,remarks,obj_id,obj_type,mch_id,wechat_type)
  73. select
  74. t.create_time,t.appId,t.name,t.appSecret,'0',
  75. t.wechat_id,t.b_id,t.store_Id,t.pay_password,t.remarks,t.obj_id,t.obj_type,t.mch_id,t.wechat_type
  76. from buiness_small_wechat t where 1=1 and t.operate= 'ADD'
  77. <if test="createTime !=null and createTime != ''">
  78. and t.create_time= #{createTime}
  79. </if>
  80. <if test="appId !=null and appId != ''">
  81. and t.appId= #{appId}
  82. </if>
  83. <if test="name !=null and name != ''">
  84. and t.name= #{name}
  85. </if>
  86. <if test="appSecret !=null and appSecret != ''">
  87. and t.appSecret= #{appSecret}
  88. </if>
  89. <if test="weChatId !=null and weChatId != ''">
  90. and t.wechat_id= #{weChatId}
  91. </if>
  92. <if test="weChatType !=null and weChatType != ''">
  93. and t.wechat_type= #{weChatType}
  94. </if>
  95. <if test="bId !=null and bId != ''">
  96. and t.b_id= #{bId}
  97. </if>
  98. <if test="storeId !=null and storeId != ''">
  99. and t.store_Id= #{storeId}
  100. </if>
  101. <if test="payPassword !=null and payPassword != ''">
  102. and t.pay_password= #{payPassword}
  103. </if>
  104. <if test="remarks !=null and remarks != ''">
  105. and t.remarks= #{remarks}
  106. </if>
  107. </insert>
  108. <!-- 查询小程序管理信息 add by wuxw 2018-07-03 -->
  109. <select id="getSmallWeChatInfo" parameterType="Map" resultType="Map">
  110. select
  111. t.create_time,t.create_time createTime,
  112. t.appId,
  113. t.name,
  114. t.appSecret,
  115. t.status_cd,t.status_cd statusCd,
  116. t.wechat_id,t.wechat_id weChatId,
  117. t.b_id,t.b_id bId,
  118. t.store_Id,t.store_Id storeId,
  119. t.pay_password,t.pay_password payPassword,
  120. t.remarks,
  121. t.obj_id,t.obj_id objId,
  122. t.obj_type,t.obj_type objType,
  123. t.mch_id,t.mch_id mchId,
  124. t.wechat_type, t.wechat_type weChatType,
  125. d.name objTypeName
  126. from small_wechat t left join t_dict d on t.obj_type = d.status_cd and d.table_name = 'small_wechat' and d.table_columns = 'obj_type'
  127. where 1 =1
  128. <if test="createTime !=null and createTime != ''">
  129. and t.create_time= #{createTime}
  130. </if>
  131. <if test="appId !=null and appId != ''">
  132. and t.appId= #{appId}
  133. </if>
  134. <if test="name !=null and name != ''">
  135. and t.name= #{name}
  136. </if>
  137. <if test="appSecret !=null and appSecret != ''">
  138. and t.appSecret= #{appSecret}
  139. </if>
  140. <if test="statusCd !=null and statusCd != ''">
  141. and t.status_cd= #{statusCd}
  142. </if>
  143. <if test="weChatType !=null and weChatType != ''">
  144. and t.wechat_type= #{weChatType}
  145. </if>
  146. <if test="weChatId !=null and weChatId != ''">
  147. and t.wechat_id= #{weChatId}
  148. </if>
  149. <if test="bId !=null and bId != ''">
  150. and t.b_id= #{bId}
  151. </if>
  152. <if test="storeId !=null and storeId != ''">
  153. and t.store_Id= #{storeId}
  154. </if>
  155. <if test="payPassword !=null and payPassword != ''">
  156. and t.pay_password= #{payPassword}
  157. </if>
  158. <if test="remarks !=null and remarks != ''">
  159. and t.remarks= #{remarks}
  160. </if>
  161. <if test="objType !=null and objType != ''">
  162. and t.obj_type= #{objType}
  163. </if>
  164. <if test="objId !=null and objId != ''">
  165. and t.obj_id= #{objId}
  166. </if>
  167. <if test="mchId !=null and mchId != ''">
  168. and t.mch_id= #{mchId}
  169. </if>
  170. order by t.create_time desc
  171. <if test="page != -1 and page != null ">
  172. limit #{page}, #{row}
  173. </if>
  174. </select>
  175. <!-- 修改小程序管理信息 add by wuxw 2018-07-03 -->
  176. <update id="updateSmallWeChatInfoInstance" parameterType="Map">
  177. update small_wechat t set t.status_cd = #{statusCd}
  178. <if test="newBId != null and newBId != ''">
  179. ,t.b_id = #{newBId}
  180. </if>
  181. <if test="createTime !=null">
  182. , t.create_time= #{createTime}
  183. </if>
  184. <if test="appId !=null and appId != ''">
  185. , t.appId= #{appId}
  186. </if>
  187. <if test="name !=null and name != ''">
  188. , t.name= #{name}
  189. </if>
  190. <if test="appSecret !=null and appSecret != ''">
  191. , t.appSecret= #{appSecret}
  192. </if>
  193. <if test="storeId !=null and storeId != ''">
  194. , t.store_Id= #{storeId}
  195. </if>
  196. <if test="payPassword !=null and payPassword != ''">
  197. , t.pay_password= #{payPassword}
  198. </if>
  199. <if test="remarks !=null and remarks != ''">
  200. , t.remarks= #{remarks}
  201. </if>
  202. <if test="objId !=null and objId != ''">
  203. , t.obj_id= #{objId}
  204. </if>
  205. <if test="objType !=null and objType != ''">
  206. , t.obj_type= #{objType}
  207. </if>
  208. <if test="mchId !=null and mchId != ''">
  209. , t.mch_id= #{mchId}
  210. </if>
  211. where 1=1
  212. <if test="weChatId !=null and weChatId != ''">
  213. and t.wechat_id= #{weChatId}
  214. </if>
  215. <if test="bId !=null and bId != ''">
  216. and t.b_id= #{bId}
  217. </if>
  218. </update>
  219. <!-- 查询小程序管理数量 add by wuxw 2018-07-03 -->
  220. <select id="querySmallWeChatsCount" parameterType="Map" resultType="Map">
  221. select count(1) count
  222. from small_wechat t
  223. where 1 =1
  224. <if test="createTime !=null and createTime != ''">
  225. and t.create_time= #{createTime}
  226. </if>
  227. <if test="appId !=null and appId != ''">
  228. and t.appId= #{appId}
  229. </if>
  230. <if test="name !=null and name != ''">
  231. and t.name= #{name}
  232. </if>
  233. <if test="appSecret !=null and appSecret != ''">
  234. and t.appSecret= #{appSecret}
  235. </if>
  236. <if test="weChatType !=null and weChatType != ''">
  237. and t.wechat_type= #{weChatType}
  238. </if>
  239. <if test="statusCd !=null and statusCd != ''">
  240. and t.status_cd= #{statusCd}
  241. </if>
  242. <if test="weChatId !=null and weChatId != ''">
  243. and t.wechat_id= #{weChatId}
  244. </if>
  245. <if test="bId !=null and bId != ''">
  246. and t.b_id= #{bId}
  247. </if>
  248. <if test="storeId !=null and storeId != ''">
  249. and t.store_Id= #{storeId}
  250. </if>
  251. <if test="payPassword !=null and payPassword != ''">
  252. and t.pay_password= #{payPassword}
  253. </if>
  254. <if test="remarks !=null and remarks != ''">
  255. and t.remarks= #{remarks}
  256. </if>
  257. <if test="objType !=null and objType != ''">
  258. and t.obj_type= #{objType}
  259. </if>
  260. <if test="objId !=null and objId != ''">
  261. and t.obj_id= #{objId}
  262. </if>
  263. </select>
  264. </mapper>