CustomerInfo.xml 4.6 KB

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