CompanyExtInfoMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.dgtly.companyext.mapper.CompanyExtInfoMapper">
  6. <resultMap type="CompanyExtInfo" id="CompanyExtInfoResult">
  7. <result property="id" column="id" />
  8. <result property="companyId" column="company_id" />
  9. <result property="companyName" column="company_name" />
  10. <result property="companyType" column="company_type" />
  11. <result property="detailAddress" column="detail_address" />
  12. <result property="longitude" column="longitude" />
  13. <result property="latitude" column="latitude" />
  14. <result property="legalPerson" column="legal_person" />
  15. <result property="contactNumber" column="contact_number" />
  16. <result property="establishDate" column="establish_date" />
  17. <result property="unifiedSocialCreditCode" column="unified_social_credit_code" />
  18. <result property="businessLicenseUrl" column="business_license_url" />
  19. <result property="defaultImgUrl" column="default_img_url" />
  20. <result property="propagandaImgUrl" column="propaganda_img_url" />
  21. <result property="companyIntroduce" column="company_introduce" />
  22. <result property="versionNum" column="version_num" />
  23. <result property="createBy" column="create_by" />
  24. <result property="createTime" column="create_time" />
  25. <result property="updateBy" column="update_by" />
  26. <result property="updateTime" column="update_time" />
  27. <result property="remark" column="remark" />
  28. </resultMap>
  29. <sql id="selectCompanyExtInfoVo">
  30. select id, company_id, company_name, company_type, detail_address, longitude, latitude, legal_person, contact_number, establish_date, unified_social_credit_code, business_license_url, default_img_url, propaganda_img_url, company_introduce, version_num, create_by, create_time, update_by, update_time, remark from company_ext_info
  31. </sql>
  32. <select id="selectCompanyExtInfoList" parameterType="CompanyExtInfo" resultMap="CompanyExtInfoResult">
  33. <include refid="selectCompanyExtInfoVo"/>
  34. <where>
  35. <if test="companyId != null "> and company_id = #{companyId}</if>
  36. <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
  37. <if test="companyType != null "> and company_type = #{companyType}</if>
  38. <if test="detailAddress != null and detailAddress != ''"> and detail_address = #{detailAddress}</if>
  39. <if test="longitude != null and longitude != ''"> and longitude = #{longitude}</if>
  40. <if test="latitude != null and latitude != ''"> and latitude = #{latitude}</if>
  41. <if test="legalPerson != null and legalPerson != ''"> and legal_person = #{legalPerson}</if>
  42. <if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
  43. <if test="establishDate != null "> and establish_date = #{establishDate}</if>
  44. <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''"> and unified_social_credit_code = #{unifiedSocialCreditCode}</if>
  45. <if test="businessLicenseUrl != null and businessLicenseUrl != ''"> and business_license_url = #{businessLicenseUrl}</if>
  46. <if test="defaultImgUrl != null and defaultImgUrl != ''"> and default_img_url = #{defaultImgUrl}</if>
  47. <if test="propagandaImgUrl != null and propagandaImgUrl != ''"> and propaganda_img_url = #{propagandaImgUrl}</if>
  48. <if test="companyIntroduce != null and companyIntroduce != ''"> and company_introduce = #{companyIntroduce}</if>
  49. <if test="versionNum != null "> and version_num = #{versionNum}</if>
  50. </where>
  51. </select>
  52. <select id="selectCompanyExtInfoById" parameterType="Long" resultMap="CompanyExtInfoResult">
  53. <include refid="selectCompanyExtInfoVo"/>
  54. where id = #{id}
  55. </select>
  56. <insert id="insertCompanyExtInfo" parameterType="CompanyExtInfo" useGeneratedKeys="true" keyProperty="id">
  57. insert into company_ext_info
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="companyId != null ">company_id,</if>
  60. <if test="companyName != null and companyName != ''">company_name,</if>
  61. <if test="companyType != null ">company_type,</if>
  62. <if test="detailAddress != null and detailAddress != ''">detail_address,</if>
  63. <if test="longitude != null and longitude != ''">longitude,</if>
  64. <if test="latitude != null and latitude != ''">latitude,</if>
  65. <if test="legalPerson != null and legalPerson != ''">legal_person,</if>
  66. <if test="contactNumber != null and contactNumber != ''">contact_number,</if>
  67. <if test="establishDate != null ">establish_date,</if>
  68. <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''">unified_social_credit_code,</if>
  69. <if test="businessLicenseUrl != null and businessLicenseUrl != ''">business_license_url,</if>
  70. <if test="defaultImgUrl != null and defaultImgUrl != ''">default_img_url,</if>
  71. <if test="propagandaImgUrl != null and propagandaImgUrl != ''">propaganda_img_url,</if>
  72. <if test="companyIntroduce != null and companyIntroduce != ''">company_introduce,</if>
  73. <if test="versionNum != null ">version_num,</if>
  74. <if test="createBy != null and createBy != ''">create_by,</if>
  75. <if test="createTime != null ">create_time,</if>
  76. <if test="updateBy != null and updateBy != ''">update_by,</if>
  77. <if test="updateTime != null ">update_time,</if>
  78. <if test="remark != null and remark != ''">remark,</if>
  79. </trim>
  80. <trim prefix="values (" suffix=")" suffixOverrides=",">
  81. <if test="companyId != null ">#{companyId},</if>
  82. <if test="companyName != null and companyName != ''">#{companyName},</if>
  83. <if test="companyType != null ">#{companyType},</if>
  84. <if test="detailAddress != null and detailAddress != ''">#{detailAddress},</if>
  85. <if test="longitude != null and longitude != ''">#{longitude},</if>
  86. <if test="latitude != null and latitude != ''">#{latitude},</if>
  87. <if test="legalPerson != null and legalPerson != ''">#{legalPerson},</if>
  88. <if test="contactNumber != null and contactNumber != ''">#{contactNumber},</if>
  89. <if test="establishDate != null ">#{establishDate},</if>
  90. <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''">#{unifiedSocialCreditCode},</if>
  91. <if test="businessLicenseUrl != null and businessLicenseUrl != ''">#{businessLicenseUrl},</if>
  92. <if test="defaultImgUrl != null and defaultImgUrl != ''">#{defaultImgUrl},</if>
  93. <if test="propagandaImgUrl != null and propagandaImgUrl != ''">#{propagandaImgUrl},</if>
  94. <if test="companyIntroduce != null and companyIntroduce != ''">#{companyIntroduce},</if>
  95. <if test="versionNum != null ">#{versionNum},</if>
  96. <if test="createBy != null and createBy != ''">#{createBy},</if>
  97. <if test="createTime != null ">#{createTime},</if>
  98. <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
  99. <if test="updateTime != null ">#{updateTime},</if>
  100. <if test="remark != null and remark != ''">#{remark},</if>
  101. </trim>
  102. </insert>
  103. <update id="updateCompanyExtInfo" parameterType="CompanyExtInfo">
  104. update company_ext_info
  105. <trim prefix="SET" suffixOverrides=",">
  106. <if test="companyId != null ">company_id = #{companyId},</if>
  107. <if test="companyName != null and companyName != ''">company_name = #{companyName},</if>
  108. <if test="companyType != null ">company_type = #{companyType},</if>
  109. <if test="detailAddress != null and detailAddress != ''">detail_address = #{detailAddress},</if>
  110. <if test="longitude != null and longitude != ''">longitude = #{longitude},</if>
  111. <if test="latitude != null and latitude != ''">latitude = #{latitude},</if>
  112. <if test="legalPerson != null and legalPerson != ''">legal_person = #{legalPerson},</if>
  113. <if test="contactNumber != null and contactNumber != ''">contact_number = #{contactNumber},</if>
  114. <if test="establishDate != null ">establish_date = #{establishDate},</if>
  115. <if test="unifiedSocialCreditCode != null and unifiedSocialCreditCode != ''">unified_social_credit_code = #{unifiedSocialCreditCode},</if>
  116. <if test="businessLicenseUrl != null and businessLicenseUrl != ''">business_license_url = #{businessLicenseUrl},</if>
  117. <if test="defaultImgUrl != null and defaultImgUrl != ''">default_img_url = #{defaultImgUrl},</if>
  118. <if test="propagandaImgUrl != null and propagandaImgUrl != ''">propaganda_img_url = #{propagandaImgUrl},</if>
  119. <if test="companyIntroduce != null and companyIntroduce != ''">company_introduce = #{companyIntroduce},</if>
  120. <if test="versionNum != null ">version_num = #{versionNum},</if>
  121. <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
  122. <if test="createTime != null ">create_time = #{createTime},</if>
  123. <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  124. <if test="updateTime != null ">update_time = #{updateTime},</if>
  125. <if test="remark != null and remark != ''">remark = #{remark},</if>
  126. </trim>
  127. where id = #{id}
  128. </update>
  129. <delete id="deleteCompanyExtInfoById" parameterType="Long">
  130. delete from company_ext_info where id = #{id}
  131. </delete>
  132. <delete id="deleteCompanyExtInfoByIds" parameterType="String">
  133. delete from company_ext_info where id in
  134. <foreach item="id" collection="array" open="(" separator="," close=")">
  135. #{id}
  136. </foreach>
  137. </delete>
  138. </mapper>