CompanyInfo.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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.enterprise.modules.base.dao.CompanyInfoDAO">
  6. <resultMap id="CompanyInfoMap" type="com.jpsoft.enterprise.modules.base.entity.CompanyInfo">
  7. <id property="id" column="id_" />
  8. <result property="companyName" column="company_name" />
  9. <result property="type" column="type_" />
  10. <result property="logoUrl" column="logo_url"/>
  11. <result property="creditCode" column="credit_code" />
  12. <result property="address" column="address_" />
  13. <result property="businessLicenseUrl" column="business_license_url" />
  14. <result property="scale" column="scale_" />
  15. <result property="industry" column="industry_" />
  16. <result property="region" column="region_" />
  17. <result property="companyIntroduction" column="company_introduction" />
  18. <result property="enterpriserIntroduction" column="enterpriser_introduction" />
  19. <result property="createBy" column="create_by" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateTime" column="update_time" />
  23. <result property="delFlag" column="del_flag" />
  24. <result property="industryName" column="industry_name" />
  25. <result property="position" column="position_" />
  26. <result property="inside" column="inside_"/>
  27. </resultMap>
  28. <insert id="insert" parameterType="com.jpsoft.enterprise.modules.base.entity.CompanyInfo">
  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_company_info
  36. (id_,company_name,type_,logo_url,credit_code,address_,business_license_url,scale_,industry_,region_,company_introduction,enterpriser_introduction,create_by,create_time,update_by,update_time,del_flag,position_,inside_)
  37. values
  38. (
  39. #{id,jdbcType=VARCHAR}
  40. ,#{companyName,jdbcType=VARCHAR}
  41. ,#{type,jdbcType=VARCHAR}
  42. ,#{logoUrl,jdbcType=VARCHAR}
  43. ,#{creditCode,jdbcType=VARCHAR}
  44. ,#{address,jdbcType=VARCHAR}
  45. ,#{businessLicenseUrl,jdbcType=VARCHAR}
  46. ,#{scale,jdbcType=VARCHAR}
  47. ,#{industry,jdbcType=VARCHAR}
  48. ,#{region,jdbcType=VARCHAR}
  49. ,#{companyIntroduction,jdbcType=VARCHAR}
  50. ,#{enterpriserIntroduction,jdbcType=VARCHAR}
  51. ,#{createBy,jdbcType=VARCHAR}
  52. ,#{createTime,jdbcType= TIMESTAMP }
  53. ,#{updateBy,jdbcType=VARCHAR}
  54. ,#{updateTime,jdbcType= TIMESTAMP }
  55. ,#{delFlag,jdbcType= NUMERIC }
  56. ,#{position,jdbcType=VARCHAR}
  57. ,#{inside,jdbcType=NUMERIC}
  58. )
  59. ]]>
  60. </insert>
  61. <delete id="delete" parameterType="string">
  62. delete from base_company_info where id_=#{id,jdbcType=VARCHAR}
  63. </delete>
  64. <update id="update" parameterType="com.jpsoft.enterprise.modules.base.entity.CompanyInfo">
  65. update base_company_info
  66. <set>
  67. <if test="companyName!=null">
  68. company_name=#{companyName,jdbcType=VARCHAR},
  69. </if>
  70. <if test="type!=null">
  71. type_=#{type,jdbcType=VARCHAR},
  72. </if>
  73. <if test="logoUrl!=null">
  74. logo_url=#{logoUrl,jdbcType=VARCHAR},
  75. </if>
  76. <if test="creditCode!=null">
  77. credit_code=#{creditCode,jdbcType=VARCHAR},
  78. </if>
  79. <if test="address!=null">
  80. address_=#{address,jdbcType=VARCHAR},
  81. </if>
  82. <if test="businessLicenseUrl!=null">
  83. business_license_url=#{businessLicenseUrl,jdbcType=VARCHAR},
  84. </if>
  85. <if test="scale!=null">
  86. scale_=#{scale,jdbcType=VARCHAR},
  87. </if>
  88. <if test="industry!=null">
  89. industry_=#{industry,jdbcType=VARCHAR},
  90. </if>
  91. <if test="region!=null">
  92. region_=#{region,jdbcType=VARCHAR},
  93. </if>
  94. <if test="companyIntroduction!=null">
  95. company_introduction=#{companyIntroduction,jdbcType=VARCHAR},
  96. </if>
  97. <if test="enterpriserIntroduction!=null">
  98. enterpriser_introduction=#{enterpriserIntroduction,jdbcType=VARCHAR},
  99. </if>
  100. <if test="createBy!=null">
  101. create_by=#{createBy,jdbcType=VARCHAR},
  102. </if>
  103. <if test="createTime!=null">
  104. create_time=#{createTime,jdbcType= TIMESTAMP },
  105. </if>
  106. <if test="updateBy!=null">
  107. update_by=#{updateBy,jdbcType=VARCHAR},
  108. </if>
  109. <if test="updateTime!=null">
  110. update_time=#{updateTime,jdbcType= TIMESTAMP },
  111. </if>
  112. <if test="delFlag!=null">
  113. del_flag=#{delFlag,jdbcType= NUMERIC },
  114. </if>
  115. <if test="position!=null">
  116. position_=#{position,jdbcType= VARCHAR },
  117. </if>
  118. <if test="inside!=null">
  119. inside_=#{inside,jdbcType= NUMERIC },
  120. </if>
  121. </set>
  122. where id_=#{id}
  123. </update>
  124. <select id="get" parameterType="string" resultMap="CompanyInfoMap">
  125. select * from base_company_info where id_=#{0}
  126. </select>
  127. <select id="exist" parameterType="string" resultType="int">
  128. select count(*) from base_company_info where id_=#{0}
  129. </select>
  130. <select id="list" resultMap="CompanyInfoMap">
  131. select * from base_company_info where del_flag = 0 order by create_time asc
  132. </select>
  133. <select id="search" parameterType="hashmap" resultMap="CompanyInfoMap">
  134. <![CDATA[
  135. SELECT
  136. a.*,
  137. b.industry_name AS industry_name
  138. FROM
  139. base_company_info a
  140. LEFT JOIN base_industry_info b ON a.industry_ = b.id_
  141. ]]>
  142. <where>
  143. a.del_flag = 0
  144. and b.del_flag = 0
  145. <if test="searchParams.id != null">
  146. and a.ID_ like #{searchParams.id}
  147. </if>
  148. <if test="searchParams.companyName != null">
  149. and a.company_name like #{searchParams.companyName}
  150. </if>
  151. <if test="searchParams.region != null">
  152. and a.region_ = #{searchParams.region}
  153. </if>
  154. <if test="searchParams.type != null">
  155. and a.type_ = #{searchParams.type}
  156. </if>
  157. <if test="searchParams.scale != null">
  158. and a.scale_ = #{searchParams.scale}
  159. </if>
  160. <if test="searchParams.industry != null">
  161. and a.industry_ = #{searchParams.industry}
  162. </if>
  163. </where>
  164. <foreach item="sort" collection="sortList" open="order by" separator=",">
  165. ${sort.name} ${sort.order}
  166. </foreach>
  167. </select>
  168. <select id="findByName" parameterType="string" resultMap="CompanyInfoMap">
  169. select * from base_company_info a where company_name=#{0} and del_flag = 0
  170. </select>
  171. </mapper>