HfMemberMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.ym.mec.biz.dal.dao.HfMemberDao">
  4. <resultMap id="hfMember" type="com.ym.mec.biz.dal.entity.HfMember">
  5. <id column="id_" property="id"/>
  6. <result column="name_" property="name"/>
  7. <result column="member_id_" property="memberId"/>
  8. <result column="prov_code_" property="provCode"/>
  9. <result column="area_code_" property="areaCode"/>
  10. <result column="social_credit_code_" property="socialCreditCode"/>
  11. <result column="social_credit_code_expires_" property="socialCreditCodeExpires"/>
  12. <result column="business_scope_" property="businessScope"/>
  13. <result column="legal_person_" property="legalPerson"/>
  14. <result column="legal_cert_id_" property="legalCertId"/>
  15. <result column="legal_cert_id_expires_" property="legalCertIdExpires"/>
  16. <result column="legal_mp_" property="legalMp"/>
  17. <result column="address_" property="address"/>
  18. <result column="zip_code_" property="zipCode"/>
  19. <result column="card_no_" property="cardNo"/>
  20. <result column="bank_code_" property="bankCode"/>
  21. <result column="settle_account_id_" property="settleAccountId"/>
  22. <result column="status_" property="status"/>
  23. <result column="memo_" property="memo"/>
  24. <result column="month_max_receipt_" property="monthMaxReceipt"/>
  25. <result column="route_member_id_" property="routeMemberId"/>
  26. <result column="route_organ_id_" property="routeOrganId"/>
  27. <result column="create_time_" property="createTime"/>
  28. <result column="update_time_" property="updateTime"/>
  29. <result column="tenant_id_" property="tenantId" />
  30. </resultMap>
  31. <sql id="Base_Column_List">
  32. <!--@mbg.generated-->
  33. id_, name_, member_id_, prov_code_, area_code_, social_credit_code_, social_credit_code_expires_,
  34. business_scope_, legal_person_, legal_cert_id_, legal_cert_id_expires_, legal_mp_,
  35. address_, zip_code_, card_no_,
  36. bank_code_,settle_account_id_,status_,month_max_receipt_,route_member_id_,route_organ_id_, create_time_,
  37. update_time_,tenant_id_
  38. </sql>
  39. <select id="get" parameterType="java.lang.Integer" resultMap="hfMember">
  40. <!--@mbg.generated-->
  41. select
  42. <include refid="Base_Column_List"/>
  43. from hf_member
  44. where id_ = #{id,jdbcType=INTEGER}
  45. </select>
  46. <delete id="delete" parameterType="java.lang.Integer">
  47. <!--@mbg.generated-->
  48. delete from hf_member
  49. where id_ = #{id,jdbcType=INTEGER}
  50. </delete>
  51. <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.HfMember"
  52. useGeneratedKeys="true">
  53. <!--@mbg.generated-->
  54. insert into hf_member (name_, member_id_, prov_code_,
  55. area_code_, social_credit_code_, social_credit_code_expires_,
  56. business_scope_, legal_person_, legal_cert_id_,
  57. legal_cert_id_expires_, legal_mp_, address_,
  58. zip_code_, card_no_, bank_code_,status_,
  59. create_time_, update_time_,tenant_id_)
  60. values (#{name}, #{memberId}, #{provCode},
  61. #{areaCode}, #{socialCreditCode}, #{socialCreditCodeExpires},
  62. #{businessScope}, #{legalPerson}, #{legalCertId},
  63. #{legalCertIdExpires}, #{legalMp}, #{address},
  64. #{zipCode}, #{cardNo}, #{bankCode},#{status},
  65. #{createTime}, #{updateTime},#{tenantId})
  66. </insert>
  67. <update id="update" parameterType="com.ym.mec.biz.dal.entity.HfMember">
  68. <!--@mbg.generated-->
  69. update hf_member
  70. <set>
  71. <if test="name != null">
  72. name_ = #{name},
  73. </if>
  74. <if test="memberId != null">
  75. member_id_ = #{memberId},
  76. </if>
  77. <if test="provCode != null">
  78. prov_code_ = #{provCode},
  79. </if>
  80. <if test="areaCode != null">
  81. area_code_ = #{areaCode},
  82. </if>
  83. <if test="socialCreditCode != null">
  84. social_credit_code_ = #{socialCreditCode},
  85. </if>
  86. <if test="socialCreditCodeExpires != null">
  87. social_credit_code_expires_ = #{socialCreditCodeExpires},
  88. </if>
  89. <if test="businessScope != null">
  90. business_scope_ = #{businessScope},
  91. </if>
  92. <if test="legalPerson != null">
  93. legal_person_ = #{legalPerson},
  94. </if>
  95. <if test="legalCertId != null">
  96. legal_cert_id_ = #{legalCertId},
  97. </if>
  98. <if test="legalCertIdExpires != null">
  99. legal_cert_id_expires_ = #{legalCertIdExpires},
  100. </if>
  101. <if test="legalMp != null">
  102. legal_mp_ = #{legalMp},
  103. </if>
  104. <if test="address != null">
  105. address_ = #{address},
  106. </if>
  107. <if test="zipCode != null">
  108. zip_code_ = #{zipCode},
  109. </if>
  110. <if test="cardNo != null">
  111. card_no_ = #{cardNo},
  112. </if>
  113. <if test="bankCode != null">
  114. bank_code_ = #{bankCode},
  115. </if>
  116. <if test="settleAccountId != null">
  117. settle_account_id_ = #{settleAccountId},
  118. </if>
  119. <if test="memo != null">
  120. memo_ = #{memo},
  121. </if>
  122. <if test="status != null">
  123. status_ = #{status},
  124. </if>
  125. <if test="monthMaxReceipt != null">
  126. month_max_receipt_ = #{monthMaxReceipt},
  127. </if>
  128. <if test="routeMemberId != null">
  129. route_member_id_ = #{routeMemberId},
  130. </if>
  131. <if test="routeOrganId != null">
  132. route_organ_id_ = #{routeOrganId},
  133. </if>
  134. <if test="createTime != null">
  135. create_time_ = #{createTime},
  136. </if>
  137. <if test="updateTime != null">
  138. update_time_ = #{updateTime},
  139. </if>
  140. </set>
  141. where id_ = #{id,jdbcType=INTEGER} and tenant_id_ = #{tennatId}
  142. </update>
  143. <!-- 分页查询 -->
  144. <select id="queryPage" resultMap="hfMember" parameterType="map">
  145. SELECT * FROM hf_member
  146. <include refid="queryPageSql"/>
  147. ORDER BY id_
  148. <include refid="global.limit"/>
  149. </select>
  150. <sql id="queryPageSql">
  151. <where>
  152. tenant_id_ = #{tenantId}
  153. <if test="name != null">
  154. AND name_ LIKE CONCAT( '%', #{name}, '%' )
  155. </if>
  156. <if test="memberId != null">
  157. AND member_id_ = #{memberId}
  158. </if>
  159. <if test="status != null">
  160. AND status_ = #{status}
  161. </if>
  162. </where>
  163. </sql>
  164. <!-- 查询当前表的总记录数 -->
  165. <select id="queryCount" resultType="int">
  166. SELECT COUNT(*) FROM hf_member
  167. <include refid="queryPageSql"/>
  168. </select>
  169. <select id="getByMemberId" resultMap="hfMember">
  170. SELECT *
  171. FROM hf_member
  172. WHERE member_id_ = #{memberId}
  173. LIMIT 1
  174. </select>
  175. <select id="getByName" resultMap="hfMember">
  176. SELECT *
  177. FROM hf_member
  178. WHERE name_ = #{name}
  179. LIMIT 1
  180. </select>
  181. </mapper>