CustomerInfo.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.employment.modules.base.dao.CustomerInfoDAO">
  6. <resultMap id="CustomerInfoMap" type="com.jpsoft.employment.modules.base.entity.CustomerInfo">
  7. <id property="id" column="id_" />
  8. <result property="userName" column="user_name" />
  9. <result property="password" column="password_" />
  10. <result property="openId" column="open_id" />
  11. <result property="phone" column="phone_" />
  12. <result property="idCard" column="id_card" />
  13. <result property="idCardImage" column="id_card_image" />
  14. <result property="realName" column="real_name" />
  15. <result property="gender" column="gender_" />
  16. <result property="region" column="region_" />
  17. <result property="image" column="image_" />
  18. <result property="createTime" column="create_time" />
  19. <result property="updateTime" column="update_time" />
  20. <result property="delFlag" column="del_flag" />
  21. <result property="createBy" column="create_by" />
  22. <result property="updateBy" column="update_by" />
  23. <result property="companyName" column="company_name" />
  24. <result property="status" column="status_" />
  25. <result property="businessLicense" column="business_license" />
  26. <result property="businessCode" column="business_code" />
  27. </resultMap>
  28. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.CustomerInfo">
  29. <!--
  30. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  31. select sys_guid() from dual
  32. </selectKey>
  33. -->
  34. <![CDATA[
  35. insert into base_customer_info
  36. (id_,user_name,password_,open_id,phone_,id_card,id_card_image,real_name,gender_,region_,image_,create_time,update_time,del_flag,create_by,update_by,company_name,status_,business_license,business_code)
  37. values
  38. (
  39. #{id,jdbcType=VARCHAR}
  40. ,#{userName,jdbcType=VARCHAR}
  41. ,#{password,jdbcType=VARCHAR}
  42. ,#{openId,jdbcType=VARCHAR}
  43. ,#{phone,jdbcType=VARCHAR}
  44. ,#{idCard,jdbcType=VARCHAR}
  45. ,#{idCardImage,jdbcType=VARCHAR}
  46. ,#{realName,jdbcType=VARCHAR}
  47. ,#{gender,jdbcType=VARCHAR}
  48. ,#{region,jdbcType=VARCHAR}
  49. ,#{image,jdbcType=VARCHAR}
  50. ,#{createTime,jdbcType= TIMESTAMP }
  51. ,#{updateTime,jdbcType= TIMESTAMP }
  52. ,#{delFlag,jdbcType= NUMERIC }
  53. ,#{createBy,jdbcType=VARCHAR}
  54. ,#{updateBy,jdbcType=VARCHAR}
  55. ,#{companyName,jdbcType=VARCHAR}
  56. ,#{status,jdbcType=VARCHAR}
  57. ,#{businessLicense,jdbcType=VARCHAR}
  58. ,#{businessCode,jdbcType=VARCHAR}
  59. )
  60. ]]>
  61. </insert>
  62. <delete id="delete" parameterType="string">
  63. delete from base_customer_info where id_=#{id,jdbcType=VARCHAR}
  64. </delete>
  65. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.CustomerInfo">
  66. update base_customer_info
  67. <set>
  68. <if test="userName!=null">
  69. user_name=#{userName,jdbcType=VARCHAR},
  70. </if>
  71. <if test="password!=null">
  72. password_=#{password,jdbcType=VARCHAR},
  73. </if>
  74. <if test="openId!=null">
  75. open_id=#{openId,jdbcType=VARCHAR},
  76. </if>
  77. <if test="phone!=null">
  78. phone_=#{phone,jdbcType=VARCHAR},
  79. </if>
  80. <if test="idCard!=null">
  81. id_card=#{idCard,jdbcType=VARCHAR},
  82. </if>
  83. <if test="idCardImage!=null">
  84. id_card_image=#{idCardImage,jdbcType=VARCHAR},
  85. </if>
  86. <if test="realName!=null">
  87. real_name=#{realName,jdbcType=VARCHAR},
  88. </if>
  89. <if test="gender!=null">
  90. gender_=#{gender,jdbcType=VARCHAR},
  91. </if>
  92. <if test="region!=null">
  93. region_=#{region,jdbcType=VARCHAR},
  94. </if>
  95. <if test="image!=null">
  96. image_=#{image,jdbcType=VARCHAR},
  97. </if>
  98. <if test="createTime!=null">
  99. create_time=#{createTime,jdbcType= TIMESTAMP },
  100. </if>
  101. <if test="updateTime!=null">
  102. update_time=#{updateTime,jdbcType= TIMESTAMP },
  103. </if>
  104. <if test="delFlag!=null">
  105. del_flag=#{delFlag,jdbcType= NUMERIC },
  106. </if>
  107. <if test="createBy!=null">
  108. create_by=#{createBy,jdbcType=VARCHAR},
  109. </if>
  110. <if test="updateBy!=null">
  111. update_by=#{updateBy,jdbcType=VARCHAR},
  112. </if>
  113. <if test="companyName!=null">
  114. company_name=#{companyName,jdbcType=VARCHAR},
  115. </if>
  116. <if test="status!=null">
  117. status_=#{status,jdbcType=VARCHAR},
  118. </if>
  119. <if test="businessLicense!=null">
  120. business_license=#{businessLicense,jdbcType=VARCHAR},
  121. </if>
  122. <if test="businessCode!=null">
  123. business_code=#{businessCode,jdbcType=VARCHAR},
  124. </if>
  125. </set>
  126. where id_=#{id}
  127. </update>
  128. <select id="get" parameterType="string" resultMap="CustomerInfoMap">
  129. select * from base_customer_info where id_=#{0}
  130. </select>
  131. <select id="exist" parameterType="string" resultType="int">
  132. select count(*) from base_customer_info where id_=#{0}
  133. </select>
  134. <select id="list" resultMap="CustomerInfoMap">
  135. select * from base_customer_info
  136. </select>
  137. <select id="findByOpenId" resultMap="CustomerInfoMap">
  138. select * from base_customer_info
  139. where del_flag=0
  140. and open_id=#{openId}
  141. order by create_time asc
  142. limit 1
  143. </select>
  144. <select id="findByPhone" resultMap="CustomerInfoMap">
  145. select * from base_customer_info
  146. where del_flag=0
  147. and phone_=#{0}
  148. limit 1
  149. </select>
  150. <select id="search" parameterType="hashmap" resultMap="CustomerInfoMap">
  151. <![CDATA[
  152. select * from base_customer_info
  153. ]]>
  154. <where>
  155. <if test="searchParams.id != null">
  156. and ID_ like #{searchParams.id}
  157. </if>
  158. </where>
  159. <foreach item="sort" collection="sortList" open="order by" separator=",">
  160. ${sort.name} ${sort.order}
  161. </foreach>
  162. </select>
  163. </mapper>