CustomerInfo.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. </resultMap>
  27. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.CustomerInfo">
  28. <!--
  29. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  30. select sys_guid() from dual
  31. </selectKey>
  32. -->
  33. <![CDATA[
  34. insert into base_customer_info
  35. (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)
  36. values
  37. (
  38. #{id,jdbcType=VARCHAR}
  39. ,#{userName,jdbcType=VARCHAR}
  40. ,#{password,jdbcType=VARCHAR}
  41. ,#{openId,jdbcType=VARCHAR}
  42. ,#{phone,jdbcType=VARCHAR}
  43. ,#{idCard,jdbcType=VARCHAR}
  44. ,#{idCardImage,jdbcType=VARCHAR}
  45. ,#{realName,jdbcType=VARCHAR}
  46. ,#{gender,jdbcType=VARCHAR}
  47. ,#{region,jdbcType=VARCHAR}
  48. ,#{image,jdbcType=VARCHAR}
  49. ,#{createTime,jdbcType= TIMESTAMP }
  50. ,#{updateTime,jdbcType= TIMESTAMP }
  51. ,#{delFlag,jdbcType= NUMERIC }
  52. ,#{createBy,jdbcType=VARCHAR}
  53. ,#{updateBy,jdbcType=VARCHAR}
  54. ,#{companyName,jdbcType=VARCHAR}
  55. ,#{status,jdbcType=VARCHAR}
  56. ,#{businessLicense,jdbcType=VARCHAR}
  57. )
  58. ]]>
  59. </insert>
  60. <delete id="delete" parameterType="string">
  61. delete from base_customer_info where id_=#{id,jdbcType=VARCHAR}
  62. </delete>
  63. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.CustomerInfo">
  64. update base_customer_info
  65. <set>
  66. <if test="userName!=null">
  67. user_name=#{userName,jdbcType=VARCHAR},
  68. </if>
  69. <if test="password!=null">
  70. password_=#{password,jdbcType=VARCHAR},
  71. </if>
  72. <if test="openId!=null">
  73. open_id=#{openId,jdbcType=VARCHAR},
  74. </if>
  75. <if test="phone!=null">
  76. phone_=#{phone,jdbcType=VARCHAR},
  77. </if>
  78. <if test="idCard!=null">
  79. id_card=#{idCard,jdbcType=VARCHAR},
  80. </if>
  81. <if test="idCardImage!=null">
  82. id_card_image=#{idCardImage,jdbcType=VARCHAR},
  83. </if>
  84. <if test="realName!=null">
  85. real_name=#{realName,jdbcType=VARCHAR},
  86. </if>
  87. <if test="gender!=null">
  88. gender_=#{gender,jdbcType=VARCHAR},
  89. </if>
  90. <if test="region!=null">
  91. region_=#{region,jdbcType=VARCHAR},
  92. </if>
  93. <if test="image!=null">
  94. image_=#{image,jdbcType=VARCHAR},
  95. </if>
  96. <if test="createTime!=null">
  97. create_time=#{createTime,jdbcType= TIMESTAMP },
  98. </if>
  99. <if test="updateTime!=null">
  100. update_time=#{updateTime,jdbcType= TIMESTAMP },
  101. </if>
  102. <if test="delFlag!=null">
  103. del_flag=#{delFlag,jdbcType= NUMERIC },
  104. </if>
  105. <if test="createBy!=null">
  106. create_by=#{createBy,jdbcType=VARCHAR},
  107. </if>
  108. <if test="updateBy!=null">
  109. update_by=#{updateBy,jdbcType=VARCHAR},
  110. </if>
  111. <if test="companyName!=null">
  112. company_name=#{companyName,jdbcType=VARCHAR},
  113. </if>
  114. <if test="status!=null">
  115. status_=#{status,jdbcType=VARCHAR},
  116. </if>
  117. <if test="businessLicense!=null">
  118. business_license=#{businessLicense,jdbcType=VARCHAR},
  119. </if>
  120. </set>
  121. where id_=#{id}
  122. </update>
  123. <select id="get" parameterType="string" resultMap="CustomerInfoMap">
  124. select * from base_customer_info where id_=#{0}
  125. </select>
  126. <select id="exist" parameterType="string" resultType="int">
  127. select count(*) from base_customer_info where id_=#{0}
  128. </select>
  129. <select id="list" resultMap="CustomerInfoMap">
  130. select * from base_customer_info
  131. </select>
  132. <select id="search" parameterType="hashmap" resultMap="CustomerInfoMap">
  133. <![CDATA[
  134. select * from base_customer_info
  135. ]]>
  136. <where>
  137. <if test="searchParams.id != null">
  138. and ID_ like #{searchParams.id}
  139. </if>
  140. </where>
  141. <foreach item="sort" collection="sortList" open="order by" separator=",">
  142. ${sort.name} ${sort.order}
  143. </foreach>
  144. </select>
  145. </mapper>