MemberReadMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.slodon.b2b2c.dao.read.member.MemberReadMapper">
  4. <resultMap id="resultMap" type="com.slodon.b2b2c.member.pojo.Member">
  5. <id column="member_id" property="memberId"/>
  6. <result column="member_name" property="memberName"/>
  7. <result column="member_nick_name" property="memberNickName"/>
  8. <result column="member_true_name" property="memberTrueName"/>
  9. <result column="member_birthday" property="memberBirthday"/>
  10. <result column="member_integral" property="memberIntegral"/>
  11. <result column="integral_frozen" property="integralFrozen"/>
  12. <result column="member_email" property="memberEmail"/>
  13. <result column="member_qq" property="memberQq"/>
  14. <result column="member_mobile" property="memberMobile"/>
  15. <result column="member_avatar" property="memberAvatar"/>
  16. <result column="login_pwd" property="loginPwd"/>
  17. <result column="pay_pwd" property="payPwd"/>
  18. <result column="gender" property="gender"/>
  19. <result column="grade" property="grade"/>
  20. <result column="experience_value" property="experienceValue"/>
  21. <result column="register_time" property="registerTime"/>
  22. <result column="last_login_time" property="lastLoginTime"/>
  23. <result column="last_login_ip" property="lastLoginIp"/>
  24. <result column="login_number" property="loginNumber"/>
  25. <result column="last_payment_code" property="lastPaymentCode"/>
  26. <result column="pay_error_count" property="payErrorCount"/>
  27. <result column="login_error_count" property="loginErrorCount"/>
  28. <result column="register_channel" property="registerChannel"/>
  29. <result column="balance_available" property="balanceAvailable"/>
  30. <result column="balance_frozen" property="balanceFrozen"/>
  31. <result column="state" property="state"/>
  32. <result column="is_email_verify" property="isEmailVerify"/>
  33. <result column="is_mobile_verify" property="isMobileVerify"/>
  34. <result column="is_receive_sms" property="isReceiveSms"/>
  35. <result column="is_receive_email" property="isReceiveEmail"/>
  36. <result column="is_allow_buy" property="isAllowBuy"/>
  37. <result column="is_allow_ask" property="isAllowAsk"/>
  38. <result column="is_allow_comment" property="isAllowComment"/>
  39. <result column="wx_unionid" property="wxUnionid"/>
  40. <result column="wx_avatar_img" property="wxAvatarImg"/>
  41. <result column="update_time" property="updateTime"/>
  42. <result column="is_email_active" property="isEmailActive" />
  43. <result column="gp_uid" property="gpUid" />
  44. <result column="gp_token" property="gpToken" />
  45. <result column="member_company" property="memberCompany" />
  46. <result column="member_main_product" property="memberMainProduct" />
  47. <result column="country" property="country" />
  48. <result column="city" property="city" />
  49. <result column="member_type" property="memberType" />
  50. </resultMap>
  51. <!--按照主键值进行操作-->
  52. <sql id="pkWhere">
  53. WHERE `member_id` = #{primaryKey}
  54. </sql>
  55. <!--操作条件-->
  56. <sql id="whereCondition">
  57. <if test="example != null">
  58. <trim prefix="WHERE" prefixOverrides="AND|OR">
  59. <if test="example.memberIdNotEquals != null">
  60. AND `member_id` != #{example.memberIdNotEquals}
  61. </if>
  62. <if test="example.memberIdIn != null">
  63. AND `member_id` in (${example.memberIdIn})
  64. </if>
  65. <if test="example.memberName != null">
  66. AND `member_name` = #{example.memberName}
  67. </if>
  68. <if test="example.memberNameLike != null">
  69. AND `member_name` like concat('%',#{example.memberNameLike},'%')
  70. </if>
  71. <if test="example.memberNickName != null">
  72. AND `member_nick_name` = #{example.memberNickName}
  73. </if>
  74. <if test="example.memberNickNameLike != null">
  75. AND `member_nick_name` like concat('%',#{example.memberNickNameLike},'%')
  76. </if>
  77. <if test="example.memberTrueName != null">
  78. AND `member_true_name` = #{example.memberTrueName}
  79. </if>
  80. <if test="example.memberTrueNameLike != null">
  81. AND `member_true_name` like concat('%',#{example.memberTrueNameLike},'%')
  82. </if>
  83. <if test="example.memberBirthday != null">
  84. AND `member_birthday` = #{example.memberBirthday}
  85. </if>
  86. <if test="example.memberIntegral != null">
  87. AND `member_integral` = #{example.memberIntegral}
  88. </if>
  89. <if test="example.integralFrozen != null">
  90. AND `integral_frozen` = #{example.integralFrozen}
  91. </if>
  92. <if test="example.memberEmail != null">
  93. AND `member_email` = #{example.memberEmail}
  94. </if>
  95. <if test="example.memberQq != null">
  96. AND `member_qq` = #{example.memberQq}
  97. </if>
  98. <if test="example.memberMobile != null">
  99. AND `member_mobile` = #{example.memberMobile}
  100. </if>
  101. <if test="example.memberMobileLike != null">
  102. AND `member_mobile` like concat('%',#{example.memberMobileLike},'%')
  103. </if>
  104. <if test="example.memberAvatar != null">
  105. AND `member_avatar` = #{example.memberAvatar}
  106. </if>
  107. <if test="example.loginPwd != null">
  108. AND `login_pwd` = #{example.loginPwd}
  109. </if>
  110. <if test="example.payPwd != null">
  111. AND `pay_pwd` = #{example.payPwd}
  112. </if>
  113. <if test="example.gender != null">
  114. AND `gender` = #{example.gender}
  115. </if>
  116. <if test="example.grade != null">
  117. AND `grade` = #{example.grade}
  118. </if>
  119. <if test="example.experienceValue != null">
  120. AND `experience_value` = #{example.experienceValue}
  121. </if>
  122. <if test="example.registerTimeAfter != null">
  123. AND `register_time` <![CDATA[ >= ]]> #{example.registerTimeAfter}
  124. </if>
  125. <if test="example.registerTimeBefore != null">
  126. AND `register_time` <![CDATA[ <= ]]> #{example.registerTimeBefore}
  127. </if>
  128. <if test="example.lastLoginTimeAfter != null">
  129. AND `last_login_time` <![CDATA[ >= ]]> #{example.lastLoginTimeAfter}
  130. </if>
  131. <if test="example.lastLoginTimeBefore != null">
  132. AND `last_login_time` <![CDATA[ <= ]]> #{example.lastLoginTimeBefore}
  133. </if>
  134. <if test="example.lastLoginIp != null">
  135. AND `last_login_ip` = #{example.lastLoginIp}
  136. </if>
  137. <if test="example.loginNumber != null">
  138. AND `login_number` = #{example.loginNumber}
  139. </if>
  140. <if test="example.lastPaymentCode != null">
  141. AND `last_payment_code` = #{example.lastPaymentCode}
  142. </if>
  143. <if test="example.payErrorCount != null">
  144. AND `pay_error_count` = #{example.payErrorCount}
  145. </if>
  146. <if test="example.loginErrorCount != null">
  147. AND `login_error_count` = #{example.loginErrorCount}
  148. </if>
  149. <if test="example.registerChannel != null">
  150. AND `register_channel` = #{example.registerChannel}
  151. </if>
  152. <if test="example.balanceAvailable != null">
  153. AND `balance_available` = #{example.balanceAvailable}
  154. </if>
  155. <if test="example.balanceFrozen != null">
  156. AND `balance_frozen` = #{example.balanceFrozen}
  157. </if>
  158. <if test="example.state != null">
  159. AND `state` = #{example.state}
  160. </if>
  161. <if test="example.stateNotEquals != null">
  162. AND `state` != #{example.stateNotEquals}
  163. </if>
  164. <if test="example.isEmailVerify != null">
  165. AND `is_email_verify` = #{example.isEmailVerify}
  166. </if>
  167. <if test="example.isMobileVerify != null">
  168. AND `is_mobile_verify` = #{example.isMobileVerify}
  169. </if>
  170. <if test="example.isReceiveSms != null">
  171. AND `is_receive_sms` = #{example.isReceiveSms}
  172. </if>
  173. <if test="example.isReceiveEmail != null">
  174. AND `is_receive_email` = #{example.isReceiveEmail}
  175. </if>
  176. <if test="example.isAllowBuy != null">
  177. AND `is_allow_buy` = #{example.isAllowBuy}
  178. </if>
  179. <if test="example.isAllowAsk != null">
  180. AND `is_allow_ask` = #{example.isAllowAsk}
  181. </if>
  182. <if test="example.isAllowComment != null">
  183. AND `is_allow_comment` = #{example.isAllowComment}
  184. </if>
  185. <if test="example.wxUnionid != null">
  186. AND `wx_unionid` = #{example.wxUnionid}
  187. </if>
  188. <if test="example.wxAvatarImg != null">
  189. AND `wx_avatar_img` = #{example.wxAvatarImg}
  190. </if>
  191. <if test="example.updateTimeAfter != null">
  192. AND `update_time` <![CDATA[ >= ]]> #{example.updateTimeAfter}
  193. </if>
  194. <if test="example.updateTimeBefore != null">
  195. AND `update_time` <![CDATA[ <= ]]> #{example.updateTimeBefore}
  196. </if>
  197. <if test="example.memberNameOrMemberMobile != null">
  198. AND `member_name` = #{example.memberNameOrMemberMobile} or `member_mobile` = #{example.memberNameOrMemberMobile}
  199. </if>
  200. <if test="example.isEmailActive != null">
  201. AND `is_email_active` = #{example.isEmailActive}
  202. </if>
  203. <if test="example.gpUid != null">
  204. AND `gp_uid` = #{example.gpUid}
  205. </if>
  206. <if test="example.gpToken != null">
  207. AND `gp_token` = #{example.gpToken}
  208. </if>
  209. <if test="example.memberType != null">
  210. AND `member_type` = #{example.memberType}
  211. </if>
  212. </trim>
  213. </if>
  214. </sql>
  215. <!--排序条件-->
  216. <sql id="orderBy">
  217. ORDER BY `member_id` DESC
  218. </sql>
  219. <sql id="orderByOther">
  220. order by ${example.orderBy}
  221. </sql>
  222. <!--分组条件-->
  223. <sql id="groupBy">
  224. group by ${example.groupBy}
  225. </sql>
  226. <!--分页条件-->
  227. <sql id="limit">
  228. <if test="size != null and size &gt; 0">
  229. limit #{startRow},#{size}
  230. </if>
  231. </sql>
  232. <!--查询符合条件的记录数-->
  233. <select id="countByExample" parameterType="com.slodon.b2b2c.member.example.MemberExample"
  234. resultType="java.lang.Integer">
  235. SELECT
  236. COUNT(*)
  237. FROM `member`
  238. <include refid="whereCondition"/>
  239. </select>
  240. <!--根据主键查询记录-->
  241. <select id="getByPrimaryKey" resultMap="resultMap">
  242. SELECT
  243. *
  244. FROM `member`
  245. <include refid="pkWhere"/>
  246. </select>
  247. <!--查询符合条件的记录(所有字段)-->
  248. <select id="listByExample" resultMap="resultMap">
  249. SELECT
  250. *
  251. FROM `member`
  252. <include refid="whereCondition"/>
  253. <if test="example.groupBy != null">
  254. <include refid="groupBy"/>
  255. </if>
  256. <choose>
  257. <when test="example.orderBy != null">
  258. <include refid="orderByOther"/>
  259. </when>
  260. <otherwise>
  261. <include refid="orderBy"/>
  262. </otherwise>
  263. </choose>
  264. </select>
  265. <!--分页查询符合条件的记录(所有字段)-->
  266. <select id="listPageByExample" resultMap="resultMap">
  267. SELECT
  268. *
  269. FROM `member`
  270. <include refid="whereCondition"/>
  271. <if test="example.groupBy != null">
  272. <include refid="groupBy"/>
  273. </if>
  274. <choose>
  275. <when test="example.orderBy != null">
  276. <include refid="orderByOther"/>
  277. </when>
  278. <otherwise>
  279. <include refid="orderBy"/>
  280. </otherwise>
  281. </choose>
  282. <include refid="limit"/>
  283. </select>
  284. <!--查询符合条件的记录(指定字段)-->
  285. <select id="listFieldsByExample" resultMap="resultMap">
  286. SELECT
  287. ${fields}
  288. FROM `member`
  289. <include refid="whereCondition"/>
  290. <if test="example.groupBy != null">
  291. <include refid="groupBy"/>
  292. </if>
  293. <choose>
  294. <when test="example.orderBy != null">
  295. <include refid="orderByOther"/>
  296. </when>
  297. <otherwise>
  298. <include refid="orderBy"/>
  299. </otherwise>
  300. </choose>
  301. </select>
  302. <!--分页查询符合条件的记录(指定字段)-->
  303. <select id="listFieldsPageByExample" resultMap="resultMap">
  304. SELECT
  305. ${fields}
  306. FROM `member`
  307. <include refid="whereCondition"/>
  308. <if test="example.groupBy != null">
  309. <include refid="groupBy"/>
  310. </if>
  311. <choose>
  312. <when test="example.orderBy != null">
  313. <include refid="orderByOther"/>
  314. </when>
  315. <otherwise>
  316. <include refid="orderBy"/>
  317. </otherwise>
  318. </choose>
  319. <include refid="limit"/>
  320. </select>
  321. </mapper>