Company.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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.CompanyDAO">
  6. <resultMap id="CompanyMap" type="com.jpsoft.employment.modules.base.entity.Company">
  7. <id property="id" column="id_" />
  8. <result property="name" column="name_" />
  9. <result property="type" column="type_" />
  10. <result property="scale" column="scale_" />
  11. <result property="area" column="area_" />
  12. <result property="industry" column="industry_" />
  13. <result property="address" column="address_" />
  14. <result property="introduction" column="introduction_" />
  15. <result property="contactPerson" column="contact_person" />
  16. <result property="tel" column="tel_" />
  17. <result property="longtitude" column="longtitude_" />
  18. <result property="latitude" column="latitude_" />
  19. <result property="email" column="email_" />
  20. <result property="sortNo" column="sort_no" />
  21. <result property="createBy" column="create_by" />
  22. <result property="createTime" column="create_time" />
  23. <result property="updateBy" column="update_by" />
  24. <result property="updateTime" column="update_time" />
  25. <result property="delFlag" column="del_flag" />
  26. <result property="isCertification" column="is_certification" />
  27. <result property="creditCode" column="credit_code" />
  28. <result property="legalPerson" column="legal_person" />
  29. <result property="legalTel" column="legal_tel" />
  30. <result property="businessLicenseUrl" column="business_license_url" />
  31. <result property="logo" column="logo_" />
  32. </resultMap>
  33. <insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.Company">
  34. <!--
  35. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  36. select sys_guid() from dual
  37. </selectKey>
  38. -->
  39. <![CDATA[
  40. insert into base_company
  41. (id_,name_,type_,scale_,industry_,address_,introduction_,contact_person,tel_,longtitude_,latitude_,email_,sort_no,create_by,create_time,update_by,update_time,del_flag,is_certification,credit_code,legal_person,legal_tel,business_license_url,logo_,area_)
  42. values
  43. (
  44. #{id,jdbcType=VARCHAR}
  45. ,#{name,jdbcType=VARCHAR}
  46. ,#{type,jdbcType=VARCHAR}
  47. ,#{scale,jdbcType=VARCHAR}
  48. ,#{industry,jdbcType=VARCHAR}
  49. ,#{address,jdbcType=VARCHAR}
  50. ,#{introduction,jdbcType=VARCHAR}
  51. ,#{contactPerson,jdbcType=VARCHAR}
  52. ,#{tel,jdbcType=VARCHAR}
  53. ,#{longtitude,jdbcType=VARCHAR}
  54. ,#{latitude,jdbcType=VARCHAR}
  55. ,#{email,jdbcType=VARCHAR}
  56. ,#{sortNo,jdbcType= NUMERIC }
  57. ,#{createBy,jdbcType=VARCHAR}
  58. ,#{createTime,jdbcType= TIMESTAMP }
  59. ,#{updateBy,jdbcType=VARCHAR}
  60. ,#{updateTime,jdbcType= TIMESTAMP }
  61. ,#{delFlag,jdbcType= NUMERIC }
  62. ,#{isCertification,jdbcType= VARCHAR }
  63. ,#{creditCode,jdbcType=VARCHAR}
  64. ,#{legalPerson,jdbcType=VARCHAR}
  65. ,#{legalTel,jdbcType=VARCHAR}
  66. ,#{businessLicenseUrl,jdbcType=VARCHAR}
  67. ,#{logo,jdbcType=VARCHAR}
  68. ,#{area,jdbcType=VARCHAR}
  69. )
  70. ]]>
  71. </insert>
  72. <delete id="delete" parameterType="string">
  73. delete from base_company where id_=#{id,jdbcType=VARCHAR}
  74. </delete>
  75. <update id="update" parameterType="com.jpsoft.employment.modules.base.entity.Company">
  76. update base_company
  77. <set>
  78. <if test="name!=null">
  79. name_=#{name,jdbcType=VARCHAR},
  80. </if>
  81. <if test="type!=null">
  82. type_=#{type,jdbcType=VARCHAR},
  83. </if>
  84. <if test="scale!=null">
  85. scale_=#{scale,jdbcType=VARCHAR},
  86. </if>
  87. <if test="industry!=null">
  88. industry_=#{industry,jdbcType=VARCHAR},
  89. </if>
  90. <if test="address!=null">
  91. address_=#{address,jdbcType=VARCHAR},
  92. </if>
  93. <if test="introduction!=null">
  94. introduction_=#{introduction,jdbcType=VARCHAR},
  95. </if>
  96. <if test="contactPerson!=null">
  97. contact_person=#{contactPerson,jdbcType=VARCHAR},
  98. </if>
  99. <if test="tel!=null">
  100. tel_=#{tel,jdbcType=VARCHAR},
  101. </if>
  102. <if test="longtitude!=null">
  103. longtitude_=#{longtitude,jdbcType=VARCHAR},
  104. </if>
  105. <if test="latitude!=null">
  106. latitude_=#{latitude,jdbcType=VARCHAR},
  107. </if>
  108. <if test="email!=null">
  109. email_=#{email,jdbcType=VARCHAR},
  110. </if>
  111. <if test="sortNo!=null">
  112. sort_no=#{sortNo,jdbcType= NUMERIC },
  113. </if>
  114. <if test="createBy!=null">
  115. create_by=#{createBy,jdbcType=VARCHAR},
  116. </if>
  117. <if test="createTime!=null">
  118. create_time=#{createTime,jdbcType= TIMESTAMP },
  119. </if>
  120. <if test="updateBy!=null">
  121. update_by=#{updateBy,jdbcType=VARCHAR},
  122. </if>
  123. <if test="updateTime!=null">
  124. update_time=#{updateTime,jdbcType= TIMESTAMP },
  125. </if>
  126. <if test="delFlag!=null">
  127. del_flag=#{delFlag,jdbcType= NUMERIC },
  128. </if>
  129. <if test="isCertification!=null">
  130. is_certification=#{isCertification,jdbcType= VARCHAR },
  131. </if>
  132. <if test="creditCode!=null">
  133. credit_code=#{creditCode,jdbcType=VARCHAR},
  134. </if>
  135. <if test="legalPerson!=null">
  136. legal_person=#{legalPerson,jdbcType=VARCHAR},
  137. </if>
  138. <if test="legalTel!=null">
  139. legal_tel=#{legalTel,jdbcType=VARCHAR},
  140. </if>
  141. <if test="businessLicenseUrl!=null">
  142. business_license_url=#{businessLicenseUrl,jdbcType=VARCHAR},
  143. </if>
  144. <if test="logo!=null">
  145. logo_=#{logo,jdbcType=VARCHAR},
  146. </if>
  147. <if test="area!=null">
  148. area_=#{area,jdbcType=VARCHAR},
  149. </if>
  150. </set>
  151. where id_=#{id}
  152. </update>
  153. <select id="get" parameterType="string" resultMap="CompanyMap">
  154. select * from base_company where id_=#{0}
  155. </select>
  156. <select id="exist" parameterType="string" resultType="int">
  157. select count(*) from base_company where id_=#{0}
  158. </select>
  159. <select id="list" resultMap="CompanyMap">
  160. select * from base_company where del_flag = 0
  161. </select>
  162. <select id="search" parameterType="hashmap" resultMap="CompanyMap">
  163. <![CDATA[
  164. select * from base_company
  165. ]]>
  166. <where>
  167. del_flag = 0
  168. <if test="searchParams.id != null">
  169. and ID_ like #{searchParams.id}
  170. </if>
  171. <if test="searchParams.name != null">
  172. and name_ like #{searchParams.name}
  173. </if>
  174. <if test="searchParams.scale != null">
  175. and scale_ = #{searchParams.scale}
  176. </if>
  177. <if test="searchParams.industry != null">
  178. and industry_ = #{searchParams.industry}
  179. </if>
  180. <if test="searchParams.isCertification != null">
  181. and is_certification = #{searchParams.isCertification}
  182. </if>
  183. <if test="searchParams.companyName != null">
  184. and name_ like #{searchParams.companyName}
  185. </if>
  186. </where>
  187. <foreach item="sort" collection="sortList" open="order by" separator=",">
  188. ${sort.name} ${sort.order}
  189. </foreach>
  190. </select>
  191. <select id="findByAll" resultMap="CompanyMap">
  192. select * from base_company where del_flag = 0
  193. and is_certification = 2
  194. order by sort_no
  195. </select>
  196. </mapper>