OrganizationIdentityMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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.goafanti.common.dao.OrganizationIdentityMapper" >
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OrganizationIdentity" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="uid" property="uid" jdbcType="VARCHAR" />
  7. <result column="contacts" property="contacts" jdbcType="VARCHAR" />
  8. <result column="fixed_tel" property="fixedTel" jdbcType="VARCHAR" />
  9. <result column="qq" property="qq" jdbcType="VARCHAR" />
  10. <result column="postal_address" property="postalAddress" jdbcType="VARCHAR" />
  11. <result column="postcode" property="postcode" jdbcType="VARCHAR" />
  12. <result column="legal_person" property="legalPerson" jdbcType="VARCHAR" />
  13. </resultMap>
  14. <resultMap type="com.goafanti.user.bo.OrgIdentityBo" id="OrgIdentityBoMap">
  15. <id column="id" property="id" jdbcType="VARCHAR" />
  16. <result column="uid" property="uid" jdbcType="VARCHAR" />
  17. <result column="contacts" property="contacts" jdbcType="VARCHAR" />
  18. <result column="fixed_tel" property="fixedTel" jdbcType="VARCHAR" />
  19. <result column="qq" property="qq" jdbcType="VARCHAR" />
  20. <result column="postal_address" property="postalAddress" jdbcType="VARCHAR" />
  21. <result column="postcode" property="postcode" jdbcType="VARCHAR" />
  22. <result column="legal_person" property="legalPerson" jdbcType="VARCHAR" />
  23. <result column="email" property="email" jdbcType="VARCHAR" />
  24. </resultMap>
  25. <sql id="Base_Column_List" >
  26. id, uid, contacts, fixed_tel, qq, postal_address, postcode ,legal_Person
  27. </sql>
  28. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  29. select
  30. <include refid="Base_Column_List" />
  31. from organization_identity
  32. where id = #{id,jdbcType=VARCHAR}
  33. </select>
  34. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  35. delete from organization_identity
  36. where id = #{id,jdbcType=VARCHAR}
  37. </delete>
  38. <insert id="insert" parameterType="com.goafanti.common.model.OrganizationIdentity" >
  39. insert into organization_identity (id, uid, contacts,
  40. fixed_tel, qq, postal_address,
  41. postcode, legal_person)
  42. values (#{id,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR},
  43. #{fixedTel,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR}, #{postalAddress,jdbcType=VARCHAR},
  44. #{postcode,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR})
  45. </insert>
  46. <insert id="insertSelective" parameterType="com.goafanti.common.model.OrganizationIdentity" >
  47. insert into organization_identity
  48. <trim prefix="(" suffix=")" suffixOverrides="," >
  49. <if test="id != null" >
  50. id,
  51. </if>
  52. <if test="uid != null" >
  53. uid,
  54. </if>
  55. <if test="contacts != null" >
  56. contacts,
  57. </if>
  58. <if test="fixedTel != null" >
  59. fixed_tel,
  60. </if>
  61. <if test="qq != null" >
  62. qq,
  63. </if>
  64. <if test="postalAddress != null" >
  65. postal_address,
  66. </if>
  67. <if test="postcode != null" >
  68. postcode,
  69. </if>
  70. <if test="legalPerson != null" >
  71. legal_person,
  72. </if>
  73. </trim>
  74. <trim prefix="values (" suffix=")" suffixOverrides="," >
  75. <if test="id != null" >
  76. #{id,jdbcType=VARCHAR},
  77. </if>
  78. <if test="uid != null" >
  79. #{uid,jdbcType=VARCHAR},
  80. </if>
  81. <if test="contacts != null" >
  82. #{contacts,jdbcType=VARCHAR},
  83. </if>
  84. <if test="fixedTel != null" >
  85. #{fixedTel,jdbcType=VARCHAR},
  86. </if>
  87. <if test="qq != null" >
  88. #{qq,jdbcType=VARCHAR},
  89. </if>
  90. <if test="postalAddress != null" >
  91. #{postalAddress,jdbcType=VARCHAR},
  92. </if>
  93. <if test="postcode != null" >
  94. #{postcode,jdbcType=VARCHAR},
  95. </if>
  96. <if test="legalPerson != null" >
  97. #{legalPerson,jdbcType=VARCHAR},
  98. </if>
  99. </trim>
  100. </insert>
  101. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OrganizationIdentity" >
  102. update organization_identity
  103. <set >
  104. <if test="uid != null" >
  105. uid = #{uid,jdbcType=VARCHAR},
  106. </if>
  107. <if test="contacts != null" >
  108. contacts = #{contacts,jdbcType=VARCHAR},
  109. </if>
  110. <if test="fixedTel != null" >
  111. fixed_tel = #{fixedTel,jdbcType=VARCHAR},
  112. </if>
  113. <if test="qq != null" >
  114. qq = #{qq,jdbcType=VARCHAR},
  115. </if>
  116. <if test="postalAddress != null" >
  117. postal_address = #{postalAddress,jdbcType=VARCHAR},
  118. </if>
  119. <if test="postcode != null" >
  120. postcode = #{postcode,jdbcType=VARCHAR},
  121. </if>
  122. <if test="legalPerson != null" >
  123. legal_person = #{legalPerson,jdbcType=VARCHAR},
  124. </if>
  125. </set>
  126. where id = #{id,jdbcType=VARCHAR}
  127. </update>
  128. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OrganizationIdentity" >
  129. update organization_identity
  130. set uid = #{uid,jdbcType=VARCHAR},
  131. contacts = #{contacts,jdbcType=VARCHAR},
  132. fixed_tel = #{fixedTel,jdbcType=VARCHAR},
  133. qq = #{qq,jdbcType=VARCHAR},
  134. postal_address = #{postalAddress,jdbcType=VARCHAR},
  135. postcode = #{postcode,jdbcType=VARCHAR}
  136. legal_person = #{legalPerson,jdbcType=VARCHAR}
  137. where id = #{id,jdbcType=VARCHAR}
  138. </update>
  139. <select id="selectOrgIdentityByUserId" parameterType="java.lang.String" resultMap="BaseResultMap">
  140. select
  141. <include refid="Base_Column_List" />
  142. from organization_identity
  143. where uid = #{uid,jdbcType=VARCHAR}
  144. </select>
  145. <select id="selectOrgIdentityBoByUserId" parameterType="java.lang.String" resultMap="OrgIdentityBoMap">
  146. select t.id,t.uid,t.contacts,t.fixed_tel,t.qq,t.postal_address,t.postcode,t.legal_person,
  147. u.email from user u LEFT JOIN organization_identity t
  148. on t.uid = u.id where t.uid=#{uid,jdbcType=VARCHAR}
  149. </select>
  150. </mapper>