UserMapper.xml 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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="com.caimei365.manager.dao.user.UserMapper">
  6. <resultMap type="User" id="UserResult">
  7. <result property="userID" column="userID" />
  8. <result property="userOrganizeID" column="userOrganizeID" />
  9. <result property="account" column="account" />
  10. <result property="mobile" column="mobile" />
  11. <result property="bindMobile" column="bindMobile" />
  12. <result property="userPermission" column="userPermission" />
  13. <result property="userIdentity" column="userIdentity" />
  14. <result property="email" column="email" />
  15. <result property="userName" column="userName" />
  16. <result property="realName" column="realName" />
  17. <result property="source" column="source" />
  18. <result property="image" column="image" />
  19. <result property="password" column="password" />
  20. <result property="name" column="name" />
  21. <result property="registerUserTypeID" column="registerUserTypeID" />
  22. <result property="manufacturerStatus" column="manufacturerStatus" />
  23. <result property="shopID" column="shopID" />
  24. <result property="auditStatus" column="auditStatus" />
  25. <result property="auditTime" column="auditTime" />
  26. <result property="auditNote" column="auditNote" />
  27. <result property="registerTime" column="registerTime" />
  28. <result property="registerIP" column="registerIP" />
  29. <result property="ipAddress" column="ipAddress" />
  30. <result property="loginTime" column="loginTime" />
  31. <result property="loginIP" column="loginIP" />
  32. <result property="validFlag" column="validFlag" />
  33. <result property="clubStatus" column="clubStatus" />
  34. <result property="clubID" column="clubID" />
  35. <result property="agreeFlag" column="agreeFlag" />
  36. <result property="serviceProviderStatus" column="serviceProviderStatus" />
  37. <result property="serviceProviderID" column="serviceProviderID" />
  38. <result property="userMoney" column="userMoney" />
  39. <result property="ableUserMoney" column="ableUserMoney" />
  40. <result property="logoffTime" column="logoffTime" />
  41. <result property="appKey" column="appKey" />
  42. <result property="appSecret" column="appSecret" />
  43. <result property="scanFlag" column="scanFlag" />
  44. <result property="userBeans" column="userBeans" />
  45. <result property="guideFlag" column="guideFlag" />
  46. <result property="loginFailTime" column="loginFailTime" />
  47. <result property="tipStatus" column="tipStatus" />
  48. <result property="onlineMoney" column="onlineMoney" />
  49. <result property="unionId" column="unionId" />
  50. <result property="openId" column="openId" />
  51. </resultMap>
  52. <sql id="selectUserVo">
  53. select
  54. user.userID,
  55. user.userOrganizeID,
  56. user.account,
  57. user.mobile,
  58. user.bindMobile,
  59. user.userPermission,
  60. user.userIdentity,
  61. user.email,
  62. user.userName,
  63. user.realName,
  64. user.source,
  65. user.image,
  66. user.password,
  67. user.name,
  68. user.registerUserTypeID,
  69. user.manufacturerStatus,
  70. user.shopID,
  71. user.auditStatus,
  72. user.auditTime,
  73. user.auditNote,
  74. user.registerTime,
  75. user.registerIP,
  76. user.ipAddress,
  77. user.loginTime,
  78. user.loginIP,
  79. user.validFlag,
  80. user.clubStatus,
  81. user.clubID,
  82. user.agreeFlag,
  83. user.serviceProviderStatus,
  84. user.serviceProviderID,
  85. ifnull(user.userMoney,0) AS userMoney,
  86. ifnull(user.ableUserMoney,0) AS ableUserMoney,
  87. user.logoffTime,
  88. user.appKey,
  89. user.appSecret,
  90. user.scanFlag,
  91. user.userBeans,
  92. user.guideFlag,
  93. user.loginFailTime,
  94. user.tipStatus,
  95. ifnull(user.onlineMoney,0) AS onlineMoney,
  96. user.unionId,
  97. user.openId
  98. </sql>
  99. <select id="getByUser" parameterType="User" resultMap="UserResult">
  100. <include refid="selectUserVo"/>
  101. from user AS user
  102. <where> user.delFlag = 0
  103. <if test="userID != null and userID != ''"> and user.userID = #{userID}</if>
  104. <if test="userOrganizeID != null "> and user.userOrganizeID = #{userOrganizeID}</if>
  105. <if test="account != null and account != ''"> and user.account = #{account}</if>
  106. <if test="mobile != null and mobile != ''"> and user.mobile = #{mobile}</if>
  107. <if test="bindMobile != null and bindMobile != ''"> and user.bindMobile = #{bindMobile}</if>
  108. <if test="userPermission != null "> and user.userPermission = #{userPermission}</if>
  109. <if test="userIdentity != null "> and user.userIdentity = #{userIdentity}</if>
  110. <if test="email != null and email != ''"> and user.email = #{email}</if>
  111. <if test="userName != null and userName != ''"> and user.userName like concat('%', #{userName}, '%')</if>
  112. <if test="realName != null and realName != ''"> and user.realName like concat('%', #{realName}, '%')</if>
  113. <if test="source != null and source != ''"> and user.source = #{source}</if>
  114. <if test="image != null and image != ''"> and user.image = #{image}</if>
  115. <if test="password != null and password != ''"> and user.password = #{password}</if>
  116. <if test="name != null and name != ''"> and user.name like concat('%', #{name}, '%')</if>
  117. <if test="registerUserTypeID != null and registerUserTypeID != ''"> and user.registerUserTypeID = #{registerUserTypeID}</if>
  118. <if test="manufacturerStatus != null "> and user.manufacturerStatus = #{manufacturerStatus}</if>
  119. <if test="shopID != null "> and user.shopID = #{shopID}</if>
  120. <if test="auditStatus != null and auditStatus != ''"> and user.auditStatus = #{auditStatus}</if>
  121. <if test="auditTime != null and auditTime != ''"> and user.auditTime = #{auditTime}</if>
  122. <if test="auditNote != null and auditNote != ''"> and user.auditNote = #{auditNote}</if>
  123. <if test="registerTime != null and registerTime != ''"> and user.registerTime = #{registerTime}</if>
  124. <if test="registerIP != null and registerIP != ''"> and user.registerIP = #{registerIP}</if>
  125. <if test="ipAddress != null and ipAddress != ''"> and user.ipAddress = #{ipAddress}</if>
  126. <if test="loginTime != null and loginTime != ''"> and user.loginTime = #{loginTime}</if>
  127. <if test="loginIP != null and loginIP != ''"> and user.loginIP = #{loginIP}</if>
  128. <if test="validFlag != null and validFlag != ''"> and user.validFlag = #{validFlag}</if>
  129. <if test="clubStatus != null "> and user.clubStatus = #{clubStatus}</if>
  130. <if test="clubID != null "> and user.clubID = #{clubID}</if>
  131. <if test="agreeFlag != null and agreeFlag != ''"> and user.agreeFlag = #{agreeFlag}</if>
  132. <if test="serviceProviderStatus != null "> and user.serviceProviderStatus = #{serviceProviderStatus}</if>
  133. <if test="serviceProviderID != null "> and user.serviceProviderID = #{serviceProviderID}</if>
  134. <if test="userMoney != null "> and user.userMoney = #{userMoney}</if>
  135. <if test="ableUserMoney != null "> and user.ableUserMoney = #{ableUserMoney}</if>
  136. <if test="logoffTime != null and logoffTime != ''"> and user.logoffTime = #{logoffTime}</if>
  137. <if test="appKey != null and appKey != ''"> and user.appKey = #{appKey}</if>
  138. <if test="appSecret != null and appSecret != ''"> and user.appSecret = #{appSecret}</if>
  139. <if test="scanFlag != null "> and user.scanFlag = #{scanFlag}</if>
  140. <if test="userBeans != null "> and user.userBeans = #{userBeans}</if>
  141. <if test="guideFlag != null "> and user.guideFlag = #{guideFlag}</if>
  142. <if test="loginFailTime != null "> and user.loginFailTime = #{loginFailTime}</if>
  143. <if test="tipStatus != null and tipStatus != ''"> and user.tipStatus = #{tipStatus}</if>
  144. <if test="onlineMoney != null "> and user.onlineMoney = #{onlineMoney}</if>
  145. <if test="unionId != null and unionId != ''"> and user.unionId = #{unionId}</if>
  146. <if test="openId != null and openId != ''"> and user.openId = #{openId}</if>
  147. </where>
  148. group by user.userID
  149. limit 0,1
  150. </select>
  151. <select id="getUserList" parameterType="User" resultMap="UserResult">
  152. <include refid="selectUserVo"/>
  153. from user AS user
  154. <where> user.delFlag = 0
  155. <if test="userID != null and userID != ''"> and user.userID = #{userID}</if>
  156. <if test="userOrganizeID != null "> and user.userOrganizeID = #{userOrganizeID}</if>
  157. <if test="account != null and account != ''"> and user.account = #{account}</if>
  158. <if test="mobile != null and mobile != ''"> and user.mobile = #{mobile}</if>
  159. <if test="bindMobile != null and bindMobile != ''"> and user.bindMobile = #{bindMobile}</if>
  160. <if test="userPermission != null "> and user.userPermission = #{userPermission}</if>
  161. <if test="userIdentity != null "> and user.userIdentity = #{userIdentity}</if>
  162. <if test="email != null and email != ''"> and user.email = #{email}</if>
  163. <if test="userName != null and userName != ''"> and user.userName like concat('%', #{userName}, '%')</if>
  164. <if test="realName != null and realName != ''"> and user.realName like concat('%', #{realName}, '%')</if>
  165. <if test="source != null and source != ''"> and user.source = #{source}</if>
  166. <if test="image != null and image != ''"> and user.image = #{image}</if>
  167. <if test="password != null and password != ''"> and user.password = #{password}</if>
  168. <if test="name != null and name != ''"> and user.name like concat('%', #{name}, '%')</if>
  169. <if test="registerUserTypeID != null and registerUserTypeID != ''"> and user.registerUserTypeID = #{registerUserTypeID}</if>
  170. <if test="manufacturerStatus != null "> and user.manufacturerStatus = #{manufacturerStatus}</if>
  171. <if test="shopID != null "> and user.shopID = #{shopID}</if>
  172. <if test="auditStatus != null and auditStatus != ''"> and user.auditStatus = #{auditStatus}</if>
  173. <if test="auditTime != null and auditTime != ''"> and user.auditTime = #{auditTime}</if>
  174. <if test="auditNote != null and auditNote != ''"> and user.auditNote = #{auditNote}</if>
  175. <if test="registerTime != null and registerTime != ''"> and user.registerTime = #{registerTime}</if>
  176. <if test="registerIP != null and registerIP != ''"> and user.registerIP = #{registerIP}</if>
  177. <if test="ipAddress != null and ipAddress != ''"> and user.ipAddress = #{ipAddress}</if>
  178. <if test="loginTime != null and loginTime != ''"> and user.loginTime = #{loginTime}</if>
  179. <if test="loginIP != null and loginIP != ''"> and user.loginIP = #{loginIP}</if>
  180. <if test="validFlag != null and validFlag != ''"> and user.validFlag = #{validFlag}</if>
  181. <if test="clubStatus != null "> and user.clubStatus = #{clubStatus}</if>
  182. <if test="clubID != null "> and user.clubID = #{clubID}</if>
  183. <if test="agreeFlag != null and agreeFlag != ''"> and user.agreeFlag = #{agreeFlag}</if>
  184. <if test="serviceProviderStatus != null "> and user.serviceProviderStatus = #{serviceProviderStatus}</if>
  185. <if test="serviceProviderID != null "> and user.serviceProviderID = #{serviceProviderID}</if>
  186. <if test="userMoney != null "> and user.userMoney = #{userMoney}</if>
  187. <if test="ableUserMoney != null "> and user.ableUserMoney = #{ableUserMoney}</if>
  188. <if test="logoffTime != null and logoffTime != ''"> and user.logoffTime = #{logoffTime}</if>
  189. <if test="appKey != null and appKey != ''"> and user.appKey = #{appKey}</if>
  190. <if test="appSecret != null and appSecret != ''"> and user.appSecret = #{appSecret}</if>
  191. <if test="scanFlag != null "> and user.scanFlag = #{scanFlag}</if>
  192. <if test="userBeans != null "> and user.userBeans = #{userBeans}</if>
  193. <if test="guideFlag != null "> and user.guideFlag = #{guideFlag}</if>
  194. <if test="loginFailTime != null "> and user.loginFailTime = #{loginFailTime}</if>
  195. <if test="tipStatus != null and tipStatus != ''"> and user.tipStatus = #{tipStatus}</if>
  196. <if test="onlineMoney != null "> and user.onlineMoney = #{onlineMoney}</if>
  197. <if test="unionId != null and unionId != ''"> and user.unionId = #{unionId}</if>
  198. <if test="openId != null and openId != ''"> and user.openId = #{openId}</if>
  199. </where>
  200. group by user.userID
  201. order by user.createTime desc
  202. </select>
  203. <select id="getCount" parameterType="User" resultType="int">
  204. select count(1)
  205. from user AS user
  206. <where> user.delFlag = 0
  207. <if test="userID != null and userID != ''"> and user.userID = #{userID}</if>
  208. <if test="userOrganizeID != null "> and user.userOrganizeID = #{userOrganizeID}</if>
  209. <if test="account != null and account != ''"> and user.account = #{account}</if>
  210. <if test="mobile != null and mobile != ''"> and user.mobile = #{mobile}</if>
  211. <if test="bindMobile != null and bindMobile != ''"> and user.bindMobile = #{bindMobile}</if>
  212. <if test="userPermission != null "> and user.userPermission = #{userPermission}</if>
  213. <if test="userIdentity != null "> and user.userIdentity = #{userIdentity}</if>
  214. <if test="email != null and email != ''"> and user.email = #{email}</if>
  215. <if test="userName != null and userName != ''"> and user.userName like concat('%', #{userName}, '%')</if>
  216. <if test="realName != null and realName != ''"> and user.realName like concat('%', #{realName}, '%')</if>
  217. <if test="source != null and source != ''"> and user.source = #{source}</if>
  218. <if test="image != null and image != ''"> and user.image = #{image}</if>
  219. <if test="password != null and password != ''"> and user.password = #{password}</if>
  220. <if test="name != null and name != ''"> and user.name like concat('%', #{name}, '%')</if>
  221. <if test="registerUserTypeID != null and registerUserTypeID != ''"> and user.registerUserTypeID = #{registerUserTypeID}</if>
  222. <if test="manufacturerStatus != null "> and user.manufacturerStatus = #{manufacturerStatus}</if>
  223. <if test="shopID != null "> and user.shopID = #{shopID}</if>
  224. <if test="auditStatus != null and auditStatus != ''"> and user.auditStatus = #{auditStatus}</if>
  225. <if test="auditTime != null and auditTime != ''"> and user.auditTime = #{auditTime}</if>
  226. <if test="auditNote != null and auditNote != ''"> and user.auditNote = #{auditNote}</if>
  227. <if test="registerTime != null and registerTime != ''"> and user.registerTime = #{registerTime}</if>
  228. <if test="registerIP != null and registerIP != ''"> and user.registerIP = #{registerIP}</if>
  229. <if test="ipAddress != null and ipAddress != ''"> and user.ipAddress = #{ipAddress}</if>
  230. <if test="loginTime != null and loginTime != ''"> and user.loginTime = #{loginTime}</if>
  231. <if test="loginIP != null and loginIP != ''"> and user.loginIP = #{loginIP}</if>
  232. <if test="validFlag != null and validFlag != ''"> and user.validFlag = #{validFlag}</if>
  233. <if test="clubStatus != null "> and user.clubStatus = #{clubStatus}</if>
  234. <if test="clubID != null "> and user.clubID = #{clubID}</if>
  235. <if test="agreeFlag != null and agreeFlag != ''"> and user.agreeFlag = #{agreeFlag}</if>
  236. <if test="serviceProviderStatus != null "> and user.serviceProviderStatus = #{serviceProviderStatus}</if>
  237. <if test="serviceProviderID != null "> and user.serviceProviderID = #{serviceProviderID}</if>
  238. <if test="userMoney != null "> and user.userMoney = #{userMoney}</if>
  239. <if test="ableUserMoney != null "> and user.ableUserMoney = #{ableUserMoney}</if>
  240. <if test="logoffTime != null and logoffTime != ''"> and user.logoffTime = #{logoffTime}</if>
  241. <if test="appKey != null and appKey != ''"> and user.appKey = #{appKey}</if>
  242. <if test="appSecret != null and appSecret != ''"> and user.appSecret = #{appSecret}</if>
  243. <if test="scanFlag != null "> and user.scanFlag = #{scanFlag}</if>
  244. <if test="userBeans != null "> and user.userBeans = #{userBeans}</if>
  245. <if test="guideFlag != null "> and user.guideFlag = #{guideFlag}</if>
  246. <if test="loginFailTime != null "> and user.loginFailTime = #{loginFailTime}</if>
  247. <if test="tipStatus != null and tipStatus != ''"> and user.tipStatus = #{tipStatus}</if>
  248. <if test="onlineMoney != null "> and user.onlineMoney = #{onlineMoney}</if>
  249. <if test="unionId != null and unionId != ''"> and user.unionId = #{unionId}</if>
  250. <if test="openId != null and openId != ''"> and user.openId = #{openId}</if>
  251. </where>
  252. </select>
  253. <select id="getUserById" parameterType="String" resultMap="UserResult">
  254. <include refid="selectUserVo"/>
  255. from user AS user
  256. where user.delFlag = 0 and user.userID = #{userID}
  257. </select>
  258. <select id="getById" parameterType="User" resultType="String">
  259. select userID
  260. from user AS user
  261. <where> user.delFlag = 0
  262. <if test="userID != null and userID != ''"> and user.userID = #{userID}</if>
  263. <if test="userOrganizeID != null "> and user.userOrganizeID = #{userOrganizeID}</if>
  264. <if test="account != null and account != ''"> and user.account = #{account}</if>
  265. <if test="mobile != null and mobile != ''"> and user.mobile = #{mobile}</if>
  266. <if test="bindMobile != null and bindMobile != ''"> and user.bindMobile = #{bindMobile}</if>
  267. <if test="userPermission != null "> and user.userPermission = #{userPermission}</if>
  268. <if test="userIdentity != null "> and user.userIdentity = #{userIdentity}</if>
  269. <if test="email != null and email != ''"> and user.email = #{email}</if>
  270. <if test="userName != null and userName != ''"> and user.userName like concat('%', #{userName}, '%')</if>
  271. <if test="realName != null and realName != ''"> and user.realName like concat('%', #{realName}, '%')</if>
  272. <if test="source != null and source != ''"> and user.source = #{source}</if>
  273. <if test="image != null and image != ''"> and user.image = #{image}</if>
  274. <if test="password != null and password != ''"> and user.password = #{password}</if>
  275. <if test="name != null and name != ''"> and user.name like concat('%', #{name}, '%')</if>
  276. <if test="registerUserTypeID != null and registerUserTypeID != ''"> and user.registerUserTypeID = #{registerUserTypeID}</if>
  277. <if test="manufacturerStatus != null "> and user.manufacturerStatus = #{manufacturerStatus}</if>
  278. <if test="shopID != null "> and user.shopID = #{shopID}</if>
  279. <if test="auditStatus != null and auditStatus != ''"> and user.auditStatus = #{auditStatus}</if>
  280. <if test="auditTime != null and auditTime != ''"> and user.auditTime = #{auditTime}</if>
  281. <if test="auditNote != null and auditNote != ''"> and user.auditNote = #{auditNote}</if>
  282. <if test="registerTime != null and registerTime != ''"> and user.registerTime = #{registerTime}</if>
  283. <if test="registerIP != null and registerIP != ''"> and user.registerIP = #{registerIP}</if>
  284. <if test="ipAddress != null and ipAddress != ''"> and user.ipAddress = #{ipAddress}</if>
  285. <if test="loginTime != null and loginTime != ''"> and user.loginTime = #{loginTime}</if>
  286. <if test="loginIP != null and loginIP != ''"> and user.loginIP = #{loginIP}</if>
  287. <if test="validFlag != null and validFlag != ''"> and user.validFlag = #{validFlag}</if>
  288. <if test="clubStatus != null "> and user.clubStatus = #{clubStatus}</if>
  289. <if test="clubID != null "> and user.clubID = #{clubID}</if>
  290. <if test="agreeFlag != null and agreeFlag != ''"> and user.agreeFlag = #{agreeFlag}</if>
  291. <if test="serviceProviderStatus != null "> and user.serviceProviderStatus = #{serviceProviderStatus}</if>
  292. <if test="serviceProviderID != null "> and user.serviceProviderID = #{serviceProviderID}</if>
  293. <if test="userMoney != null "> and user.userMoney = #{userMoney}</if>
  294. <if test="ableUserMoney != null "> and user.ableUserMoney = #{ableUserMoney}</if>
  295. <if test="logoffTime != null and logoffTime != ''"> and user.logoffTime = #{logoffTime}</if>
  296. <if test="appKey != null and appKey != ''"> and user.appKey = #{appKey}</if>
  297. <if test="appSecret != null and appSecret != ''"> and user.appSecret = #{appSecret}</if>
  298. <if test="scanFlag != null "> and user.scanFlag = #{scanFlag}</if>
  299. <if test="userBeans != null "> and user.userBeans = #{userBeans}</if>
  300. <if test="guideFlag != null "> and user.guideFlag = #{guideFlag}</if>
  301. <if test="loginFailTime != null "> and user.loginFailTime = #{loginFailTime}</if>
  302. <if test="tipStatus != null and tipStatus != ''"> and user.tipStatus = #{tipStatus}</if>
  303. <if test="onlineMoney != null "> and user.onlineMoney = #{onlineMoney}</if>
  304. <if test="unionId != null and unionId != ''"> and user.unionId = #{unionId}</if>
  305. <if test="openId != null and openId != ''"> and user.openId = #{openId}</if>
  306. </where>
  307. group by user.userID
  308. limit 0,1
  309. </select>
  310. <insert id="addUser" parameterType="User" useGeneratedKeys="true" keyProperty="userID">
  311. insert into user
  312. <trim prefix="(" suffix=")" suffixOverrides=",">
  313. <if test="userID != null and userID != ''">userID,</if>
  314. <if test="userOrganizeID != null">userOrganizeID,</if>
  315. <if test="account != null and account != ''">account,</if>
  316. <if test="mobile != null and mobile != ''">mobile,</if>
  317. <if test="bindMobile != null and bindMobile != ''">bindMobile,</if>
  318. <if test="userPermission != null">userPermission,</if>
  319. <if test="userIdentity != null">userIdentity,</if>
  320. <if test="email != null and email != ''">email,</if>
  321. <if test="userName != null and userName != ''">userName,</if>
  322. <if test="realName != null and realName != ''">realName,</if>
  323. <if test="source != null and source != ''">source,</if>
  324. <if test="image != null and image != ''">image,</if>
  325. <if test="password != null and password != ''">password,</if>
  326. <if test="name != null and name != ''">name,</if>
  327. <if test="registerUserTypeID != null and registerUserTypeID != ''">registerUserTypeID,</if>
  328. <if test="manufacturerStatus != null">manufacturerStatus,</if>
  329. <if test="shopID != null">shopID,</if>
  330. <if test="auditStatus != null and auditStatus != ''">auditStatus,</if>
  331. <if test="auditTime != null and auditTime != ''">auditTime,</if>
  332. <if test="auditNote != null and auditNote != ''">auditNote,</if>
  333. <if test="registerTime != null and registerTime != ''">registerTime,</if>
  334. <if test="registerIP != null and registerIP != ''">registerIP,</if>
  335. <if test="ipAddress != null and ipAddress != ''">ipAddress,</if>
  336. <if test="loginTime != null and loginTime != ''">loginTime,</if>
  337. <if test="loginIP != null and loginIP != ''">loginIP,</if>
  338. <if test="validFlag != null and validFlag != ''">validFlag,</if>
  339. <if test="clubStatus != null">clubStatus,</if>
  340. <if test="clubID != null">clubID,</if>
  341. <if test="agreeFlag != null and agreeFlag != ''">agreeFlag,</if>
  342. <if test="serviceProviderStatus != null">serviceProviderStatus,</if>
  343. <if test="serviceProviderID != null">serviceProviderID,</if>
  344. <if test="userMoney != null">userMoney,</if>
  345. <if test="ableUserMoney != null">ableUserMoney,</if>
  346. <if test="logoffTime != null and logoffTime != ''">logoffTime,</if>
  347. <if test="appKey != null and appKey != ''">appKey,</if>
  348. <if test="appSecret != null and appSecret != ''">appSecret,</if>
  349. <if test="scanFlag != null">scanFlag,</if>
  350. <if test="userBeans != null">userBeans,</if>
  351. <if test="guideFlag != null">guideFlag,</if>
  352. <if test="loginFailTime != null">loginFailTime,</if>
  353. <if test="tipStatus != null and tipStatus != ''">tipStatus,</if>
  354. <if test="onlineMoney != null">onlineMoney,</if>
  355. <if test="unionId != null and unionId != ''">unionId,</if>
  356. <if test="openId != null and openId != ''">openId,</if>
  357. </trim>
  358. <trim prefix="values (" suffix=")" suffixOverrides=",">
  359. <if test="userID != null and userID != ''">#{userID},</if>
  360. <if test="userOrganizeID != null">#{userOrganizeID},</if>
  361. <if test="account != null and account != ''">#{account},</if>
  362. <if test="mobile != null and mobile != ''">#{mobile},</if>
  363. <if test="bindMobile != null and bindMobile != ''">#{bindMobile},</if>
  364. <if test="userPermission != null">#{userPermission},</if>
  365. <if test="userIdentity != null">#{userIdentity},</if>
  366. <if test="email != null and email != ''">#{email},</if>
  367. <if test="userName != null and userName != ''">#{userName},</if>
  368. <if test="realName != null and realName != ''">#{realName},</if>
  369. <if test="source != null and source != ''">#{source},</if>
  370. <if test="image != null and image != ''">#{image},</if>
  371. <if test="password != null and password != ''">#{password},</if>
  372. <if test="name != null and name != ''">#{name},</if>
  373. <if test="registerUserTypeID != null and registerUserTypeID != ''">#{registerUserTypeID},</if>
  374. <if test="manufacturerStatus != null">#{manufacturerStatus},</if>
  375. <if test="shopID != null">#{shopID},</if>
  376. <if test="auditStatus != null and auditStatus != ''">#{auditStatus},</if>
  377. <if test="auditTime != null and auditTime != ''">#{auditTime},</if>
  378. <if test="auditNote != null and auditNote != ''">#{auditNote},</if>
  379. <if test="registerTime != null and registerTime != ''">#{registerTime},</if>
  380. <if test="registerIP != null and registerIP != ''">#{registerIP},</if>
  381. <if test="ipAddress != null and ipAddress != ''">#{ipAddress},</if>
  382. <if test="loginTime != null and loginTime != ''">#{loginTime},</if>
  383. <if test="loginIP != null and loginIP != ''">#{loginIP},</if>
  384. <if test="validFlag != null and validFlag != ''">#{validFlag},</if>
  385. <if test="clubStatus != null">#{clubStatus},</if>
  386. <if test="clubID != null">#{clubID},</if>
  387. <if test="agreeFlag != null and agreeFlag != ''">#{agreeFlag},</if>
  388. <if test="serviceProviderStatus != null">#{serviceProviderStatus},</if>
  389. <if test="serviceProviderID != null">#{serviceProviderID},</if>
  390. <if test="userMoney != null">#{userMoney},</if>
  391. <if test="ableUserMoney != null">#{ableUserMoney},</if>
  392. <if test="logoffTime != null and logoffTime != ''">#{logoffTime},</if>
  393. <if test="appKey != null and appKey != ''">#{appKey},</if>
  394. <if test="appSecret != null and appSecret != ''">#{appSecret},</if>
  395. <if test="scanFlag != null">#{scanFlag},</if>
  396. <if test="userBeans != null">#{userBeans},</if>
  397. <if test="guideFlag != null">#{guideFlag},</if>
  398. <if test="loginFailTime != null">#{loginFailTime},</if>
  399. <if test="tipStatus != null and tipStatus != ''">#{tipStatus},</if>
  400. <if test="onlineMoney != null">#{onlineMoney},</if>
  401. <if test="unionId != null and unionId != ''">#{unionId},</if>
  402. <if test="openId != null and openId != ''">#{openId},</if>
  403. </trim>
  404. </insert>
  405. <update id="updateUser" parameterType="User">
  406. update user
  407. <trim prefix="SET" suffixOverrides=",">
  408. <if test="userOrganizeID != null">userOrganizeID = #{userOrganizeID},</if>
  409. <if test="account != null and account != ''">account = #{account},</if>
  410. <if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
  411. <if test="bindMobile != null and bindMobile != ''">bindMobile = #{bindMobile},</if>
  412. <if test="userPermission != null">userPermission = #{userPermission},</if>
  413. <if test="userIdentity != null">userIdentity = #{userIdentity},</if>
  414. <if test="email != null and email != ''">email = #{email},</if>
  415. <if test="userName != null and userName != ''">userName = #{userName},</if>
  416. <if test="realName != null and realName != ''">realName = #{realName},</if>
  417. <if test="source != null and source != ''">source = #{source},</if>
  418. <if test="image != null and image != ''">image = #{image},</if>
  419. <if test="password != null and password != ''">password = #{password},</if>
  420. <if test="name != null and name != ''">name = #{name},</if>
  421. <if test="registerUserTypeID != null and registerUserTypeID != ''">registerUserTypeID = #{registerUserTypeID},</if>
  422. <if test="manufacturerStatus != null">manufacturerStatus = #{manufacturerStatus},</if>
  423. <if test="shopID != null">shopID = #{shopID},</if>
  424. <if test="auditStatus != null and auditStatus != ''">auditStatus = #{auditStatus},</if>
  425. <if test="auditTime != null and auditTime != ''">auditTime = #{auditTime},</if>
  426. <if test="auditNote != null and auditNote != ''">auditNote = #{auditNote},</if>
  427. <if test="registerTime != null and registerTime != ''">registerTime = #{registerTime},</if>
  428. <if test="registerIP != null and registerIP != ''">registerIP = #{registerIP},</if>
  429. <if test="ipAddress != null and ipAddress != ''">ipAddress = #{ipAddress},</if>
  430. <if test="loginTime != null and loginTime != ''">loginTime = #{loginTime},</if>
  431. <if test="loginIP != null and loginIP != ''">loginIP = #{loginIP},</if>
  432. <if test="validFlag != null and validFlag != ''">validFlag = #{validFlag},</if>
  433. <if test="clubStatus != null">clubStatus = #{clubStatus},</if>
  434. <if test="clubID != null">clubID = #{clubID},</if>
  435. <if test="agreeFlag != null and agreeFlag != ''">agreeFlag = #{agreeFlag},</if>
  436. <if test="serviceProviderStatus != null">serviceProviderStatus = #{serviceProviderStatus},</if>
  437. <if test="serviceProviderID != null">serviceProviderID = #{serviceProviderID},</if>
  438. <if test="userMoney != null">userMoney = #{userMoney},</if>
  439. <if test="ableUserMoney != null">ableUserMoney = #{ableUserMoney},</if>
  440. <if test="logoffTime != null and logoffTime != ''">logoffTime = #{logoffTime},</if>
  441. <if test="appKey != null and appKey != ''">appKey = #{appKey},</if>
  442. <if test="appSecret != null and appSecret != ''">appSecret = #{appSecret},</if>
  443. <if test="scanFlag != null">scanFlag = #{scanFlag},</if>
  444. <if test="userBeans != null">userBeans = #{userBeans},</if>
  445. <if test="guideFlag != null">guideFlag = #{guideFlag},</if>
  446. <if test="loginFailTime != null">loginFailTime = #{loginFailTime},</if>
  447. <if test="tipStatus != null and tipStatus != ''">tipStatus = #{tipStatus},</if>
  448. <if test="onlineMoney != null">onlineMoney = #{onlineMoney},</if>
  449. <if test="unionId != null and unionId != ''">unionId = #{unionId},</if>
  450. <if test="openId != null and openId != ''">openId = #{openId},</if>
  451. </trim>
  452. where userID = #{userID}
  453. </update>
  454. <delete id="delUserByUserID" parameterType="String">
  455. delete
  456. from user where userID = #{userID}
  457. </delete>
  458. <delete id="delUser" parameterType="User">
  459. delete
  460. from user AS user
  461. <where>
  462. <if test="userID != null and userID != ''"> and user.userID = #{userID}</if>
  463. <if test="userOrganizeID != null "> and user.userOrganizeID = #{userOrganizeID}</if>
  464. <if test="account != null and account != ''"> and user.account = #{account}</if>
  465. <if test="mobile != null and mobile != ''"> and user.mobile = #{mobile}</if>
  466. <if test="bindMobile != null and bindMobile != ''"> and user.bindMobile = #{bindMobile}</if>
  467. <if test="userPermission != null "> and user.userPermission = #{userPermission}</if>
  468. <if test="userIdentity != null "> and user.userIdentity = #{userIdentity}</if>
  469. <if test="email != null and email != ''"> and user.email = #{email}</if>
  470. <if test="userName != null and userName != ''"> and user.userName like concat('%', #{userName}, '%')</if>
  471. <if test="realName != null and realName != ''"> and user.realName like concat('%', #{realName}, '%')</if>
  472. <if test="source != null and source != ''"> and user.source = #{source}</if>
  473. <if test="image != null and image != ''"> and user.image = #{image}</if>
  474. <if test="password != null and password != ''"> and user.password = #{password}</if>
  475. <if test="name != null and name != ''"> and user.name like concat('%', #{name}, '%')</if>
  476. <if test="registerUserTypeID != null and registerUserTypeID != ''"> and user.registerUserTypeID = #{registerUserTypeID}</if>
  477. <if test="manufacturerStatus != null "> and user.manufacturerStatus = #{manufacturerStatus}</if>
  478. <if test="shopID != null "> and user.shopID = #{shopID}</if>
  479. <if test="auditStatus != null and auditStatus != ''"> and user.auditStatus = #{auditStatus}</if>
  480. <if test="auditTime != null and auditTime != ''"> and user.auditTime = #{auditTime}</if>
  481. <if test="auditNote != null and auditNote != ''"> and user.auditNote = #{auditNote}</if>
  482. <if test="registerTime != null and registerTime != ''"> and user.registerTime = #{registerTime}</if>
  483. <if test="registerIP != null and registerIP != ''"> and user.registerIP = #{registerIP}</if>
  484. <if test="ipAddress != null and ipAddress != ''"> and user.ipAddress = #{ipAddress}</if>
  485. <if test="loginTime != null and loginTime != ''"> and user.loginTime = #{loginTime}</if>
  486. <if test="loginIP != null and loginIP != ''"> and user.loginIP = #{loginIP}</if>
  487. <if test="validFlag != null and validFlag != ''"> and user.validFlag = #{validFlag}</if>
  488. <if test="clubStatus != null "> and user.clubStatus = #{clubStatus}</if>
  489. <if test="clubID != null "> and user.clubID = #{clubID}</if>
  490. <if test="agreeFlag != null and agreeFlag != ''"> and user.agreeFlag = #{agreeFlag}</if>
  491. <if test="serviceProviderStatus != null "> and user.serviceProviderStatus = #{serviceProviderStatus}</if>
  492. <if test="serviceProviderID != null "> and user.serviceProviderID = #{serviceProviderID}</if>
  493. <if test="userMoney != null "> and user.userMoney = #{userMoney}</if>
  494. <if test="ableUserMoney != null "> and user.ableUserMoney = #{ableUserMoney}</if>
  495. <if test="logoffTime != null and logoffTime != ''"> and user.logoffTime = #{logoffTime}</if>
  496. <if test="appKey != null and appKey != ''"> and user.appKey = #{appKey}</if>
  497. <if test="appSecret != null and appSecret != ''"> and user.appSecret = #{appSecret}</if>
  498. <if test="scanFlag != null "> and user.scanFlag = #{scanFlag}</if>
  499. <if test="userBeans != null "> and user.userBeans = #{userBeans}</if>
  500. <if test="guideFlag != null "> and user.guideFlag = #{guideFlag}</if>
  501. <if test="loginFailTime != null "> and user.loginFailTime = #{loginFailTime}</if>
  502. <if test="tipStatus != null and tipStatus != ''"> and user.tipStatus = #{tipStatus}</if>
  503. <if test="onlineMoney != null "> and user.onlineMoney = #{onlineMoney}</if>
  504. <if test="unionId != null and unionId != ''"> and user.unionId = #{unionId}</if>
  505. <if test="openId != null and openId != ''"> and user.openId = #{openId}</if>
  506. </where>
  507. </delete>
  508. </mapper>