Company.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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.picc.modules.base.dao.CompanyDAO">
  6. <resultMap id="CompanyMap" type="com.jpsoft.picc.modules.base.entity.Company">
  7. <id property="id" column="id_" />
  8. <result property="name" column="name_" />
  9. <result property="legalName" column="legal_name" />
  10. <result property="legalCard" column="legal_card" />
  11. <result property="legalCardFile" column="legal_card_file" />
  12. <result property="usccCode" column="uscc_code" />
  13. <result property="usccFiles" column="uscc_files" />
  14. <result property="type" column="type_" />
  15. <result property="businessNature" column="business_nature" />
  16. <result property="businessScope" column="business_scope" />
  17. <result property="industryType" column="industry_type" />
  18. <result property="employeesNumber" column="employees_number" />
  19. <result property="insuredNumber" column="insured_number" />
  20. <result property="person" column="person_" />
  21. <result property="tel" column="tel_" />
  22. <result property="mail" column="mail_" />
  23. <result property="postal" column="postal_" />
  24. <result property="address" column="address_" />
  25. <result property="companyStampFile" column="company_stamp_file" />
  26. <result property="promoter" column="promoter_" />
  27. <result property="remark" column="remark_" />
  28. <result property="buyId" column="buy_id" />
  29. <result property="status" column="status_" />
  30. <result property="createBy" column="create_by" />
  31. <result property="createTime" column="create_time" />
  32. <result property="updateBy" column="update_by" />
  33. <result property="updateTime" column="update_time" />
  34. <result property="delFlag" column="del_flag" />
  35. </resultMap>
  36. <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.Company">
  37. <!--
  38. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  39. select sys_guid() from dual
  40. </selectKey>
  41. -->
  42. <![CDATA[
  43. insert into base_company
  44. (id_,name_,legal_name,legal_card,legal_card_file,uscc_code,uscc_files,type_,business_nature,business_scope,industry_type,employees_number,insured_number,person_,tel_,mail_,postal_,address_,company_stamp_file,promoter_,remark_,buy_id,status_,create_by,create_time,update_by,update_time,del_flag)
  45. values
  46. (
  47. #{id,jdbcType=VARCHAR}
  48. ,#{name,jdbcType=VARCHAR}
  49. ,#{legalName,jdbcType=VARCHAR}
  50. ,#{legalCard,jdbcType=VARCHAR}
  51. ,#{legalCardFile,jdbcType=VARCHAR}
  52. ,#{usccCode,jdbcType=VARCHAR}
  53. ,#{usccFiles,jdbcType=VARCHAR}
  54. ,#{type,jdbcType=VARCHAR}
  55. ,#{businessNature,jdbcType=VARCHAR}
  56. ,#{businessScope,jdbcType=VARCHAR}
  57. ,#{industryType,jdbcType=VARCHAR}
  58. ,#{employeesNumber,jdbcType= NUMERIC }
  59. ,#{insuredNumber,jdbcType= NUMERIC }
  60. ,#{person,jdbcType=VARCHAR}
  61. ,#{tel,jdbcType=VARCHAR}
  62. ,#{mail,jdbcType=VARCHAR}
  63. ,#{postal,jdbcType=VARCHAR}
  64. ,#{address,jdbcType=VARCHAR}
  65. ,#{companyStampFile,jdbcType=VARCHAR}
  66. ,#{promoter,jdbcType=VARCHAR}
  67. ,#{remark,jdbcType=VARCHAR}
  68. ,#{buyId,jdbcType=VARCHAR}
  69. ,#{status,jdbcType=VARCHAR}
  70. ,#{createBy,jdbcType=VARCHAR}
  71. ,#{createTime,jdbcType= TIMESTAMP }
  72. ,#{updateBy,jdbcType=VARCHAR}
  73. ,#{updateTime,jdbcType= TIMESTAMP }
  74. ,#{delFlag,jdbcType= NUMERIC }
  75. )
  76. ]]>
  77. </insert>
  78. <delete id="delete" parameterType="string">
  79. delete from base_company where id_=#{id,jdbcType=VARCHAR}
  80. </delete>
  81. <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.Company">
  82. update base_company
  83. <set>
  84. <if test="name!=null">
  85. name_=#{name,jdbcType=VARCHAR},
  86. </if>
  87. <if test="legalName!=null">
  88. legal_name=#{legalName,jdbcType=VARCHAR},
  89. </if>
  90. <if test="legalCard!=null">
  91. legal_card=#{legalCard,jdbcType=VARCHAR},
  92. </if>
  93. <if test="legalCardFile!=null">
  94. legal_card_file=#{legalCardFile,jdbcType=VARCHAR},
  95. </if>
  96. <if test="usccCode!=null">
  97. uscc_code=#{usccCode,jdbcType=VARCHAR},
  98. </if>
  99. <if test="usccFiles!=null">
  100. uscc_files=#{usccFiles,jdbcType=VARCHAR},
  101. </if>
  102. <if test="type!=null">
  103. type_=#{type,jdbcType=VARCHAR},
  104. </if>
  105. <if test="businessNature!=null">
  106. business_nature=#{businessNature,jdbcType=VARCHAR},
  107. </if>
  108. <if test="businessScope!=null">
  109. business_scope=#{businessScope,jdbcType=VARCHAR},
  110. </if>
  111. <if test="industryType!=null">
  112. industry_type=#{industryType,jdbcType=VARCHAR},
  113. </if>
  114. <if test="employeesNumber!=null">
  115. employees_number=#{employeesNumber,jdbcType= NUMERIC },
  116. </if>
  117. <if test="insuredNumber!=null">
  118. insured_number=#{insuredNumber,jdbcType= NUMERIC },
  119. </if>
  120. <if test="person!=null">
  121. person_=#{person,jdbcType=VARCHAR},
  122. </if>
  123. <if test="tel!=null">
  124. tel_=#{tel,jdbcType=VARCHAR},
  125. </if>
  126. <if test="mail!=null">
  127. mail_=#{mail,jdbcType=VARCHAR},
  128. </if>
  129. <if test="postal!=null">
  130. postal_=#{postal,jdbcType=VARCHAR},
  131. </if>
  132. <if test="address!=null">
  133. address_=#{address,jdbcType=VARCHAR},
  134. </if>
  135. <if test="companyStampFile!=null">
  136. company_stamp_file=#{companyStampFile,jdbcType=VARCHAR},
  137. </if>
  138. <if test="promoter!=null">
  139. promoter_=#{promoter,jdbcType=VARCHAR},
  140. </if>
  141. <if test="remark!=null">
  142. remark_=#{remark,jdbcType=VARCHAR},
  143. </if>
  144. <if test="buyId!=null">
  145. buy_id=#{buyId,jdbcType=VARCHAR},
  146. </if>
  147. <if test="status!=null">
  148. status_=#{status,jdbcType=VARCHAR},
  149. </if>
  150. <if test="createBy!=null">
  151. create_by=#{createBy,jdbcType=VARCHAR},
  152. </if>
  153. <if test="createTime!=null">
  154. create_time=#{createTime,jdbcType= TIMESTAMP },
  155. </if>
  156. <if test="updateBy!=null">
  157. update_by=#{updateBy,jdbcType=VARCHAR},
  158. </if>
  159. <if test="updateTime!=null">
  160. update_time=#{updateTime,jdbcType= TIMESTAMP },
  161. </if>
  162. <if test="delFlag!=null">
  163. del_flag=#{delFlag,jdbcType= NUMERIC },
  164. </if>
  165. </set>
  166. where id_=#{id}
  167. </update>
  168. <select id="get" parameterType="string" resultMap="CompanyMap">
  169. select
  170. id_,name_,legal_name,legal_card,legal_card_file,uscc_code,uscc_files,type_,business_nature,business_scope,industry_type,employees_number,insured_number,person_,tel_,mail_,postal_,address_,company_stamp_file,promoter_,remark_,buy_id,status_,create_by,create_time,update_by,update_time,del_flag from base_company where id_=#{0}
  171. </select>
  172. <select id="exist" parameterType="string" resultType="int">
  173. select count(*) from base_company where id_=#{0}
  174. </select>
  175. <select id="list" resultMap="CompanyMap">
  176. select * from base_company
  177. </select>
  178. <select id="search" parameterType="hashmap" resultMap="CompanyMap">
  179. <![CDATA[
  180. select * from base_company
  181. ]]>
  182. <where>
  183. <if test="searchParams.id != null">
  184. and ID_ like #{searchParams.id}
  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="findByCreateBy" resultMap="CompanyMap">
  192. select * from base_company where create_by=#{0} and del_flag=0 limit 1
  193. </select>
  194. </mapper>