旭捷内部项目管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
8.9 KiB

10 months ago
  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.gaotao.modules.app.dao.SupplierMapper">
  4. <resultMap id="BaseResultMap" type="com.gaotao.modules.app.entity.Supplier">
  5. <!--@mbg.generated-->
  6. <!--@Table Supplier-->
  7. <id column="SupplierID" jdbcType="VARCHAR" property="supplierid" />
  8. <id column="Site" jdbcType="VARCHAR" property="site" />
  9. <result column="SupplierName" jdbcType="VARCHAR" property="suppliername" />
  10. <result column="TaxCode" jdbcType="VARCHAR" property="taxcode" />
  11. <result column="FaxNo" jdbcType="VARCHAR" property="faxno" />
  12. <result column="PhoneNo" jdbcType="VARCHAR" property="phoneno" />
  13. <result column="Contact" jdbcType="VARCHAR" property="contact" />
  14. <result column="Address" jdbcType="VARCHAR" property="address" />
  15. <result column="PaymentTerm" jdbcType="VARCHAR" property="paymentterm" />
  16. <result column="DeliveryTerm" jdbcType="VARCHAR" property="deliveryterm" />
  17. <result column="Buyer" jdbcType="VARCHAR" property="buyer" />
  18. <result column="Currency" jdbcType="VARCHAR" property="currency" />
  19. <result column="SupplierGroup" jdbcType="VARCHAR" property="suppliergroup" />
  20. <result column="ABC" jdbcType="CHAR" property="abc" />
  21. <result column="Active" jdbcType="CHAR" property="active" />
  22. <result column="CreateDate" jdbcType="TIMESTAMP" property="createdate" />
  23. <result column="BankName" jdbcType="VARCHAR" property="bankname" />
  24. <result column="BankAccount" jdbcType="VARCHAR" property="bankaccount" />
  25. <result column="TaxNo" jdbcType="VARCHAR" property="taxno" />
  26. <result column="Email" jdbcType="VARCHAR" property="email" />
  27. <result column="Memo" jdbcType="VARCHAR" property="memo" />
  28. </resultMap>
  29. <sql id="Base_Column_List">
  30. <!--@mbg.generated-->
  31. SupplierID, Site, SupplierName, TaxCode, FaxNo, PhoneNo, Contact, Address, PaymentTerm,
  32. DeliveryTerm, Buyer, Currency, SupplierGroup, ABC, Active, CreateDate, BankName,
  33. BankAccount, TaxNo, Email, Memo
  34. </sql>
  35. <select id="getSupplierList" resultMap="BaseResultMap">
  36. <!--@mbg.generated-->
  37. select A.SupplierID,A.Site,A.SupplierName,A.TaxCode,A.FaxNo,A.PhoneNo,A.Contact,A.Address,A.PaymentTerm,A.DeliveryTerm,
  38. A.Buyer,A.Currency,A.SupplierGroup,A.ABC,A.Active,A.CreateDate,A.BankName,A.BankAccount,A.TaxNo,A.Email,A.Memo
  39. from Supplier A
  40. <where>
  41. <if test="site != null and site != ''">
  42. and A.Site=#{site,jdbcType=VARCHAR}
  43. </if>
  44. <if test="supplierid != null and supplierid != ''">
  45. and A.SupplierID=#{supplierid,jdbcType=VARCHAR}
  46. </if>
  47. <if test="active != null and active != ''">
  48. and A.Active = #{active,jdbcType=VARCHAR}
  49. </if>
  50. </where>
  51. </select>
  52. <insert id="insertSelective">
  53. <!--@mbg.generated-->
  54. INSERT INTO Supplier
  55. <trim prefix="(" suffix=")" suffixOverrides=",">
  56. <if test="supplierid!=null">SupplierID,</if>
  57. <if test="site!=null">Site,</if>
  58. <if test="suppliername!=null">SupplierName,</if>
  59. <if test="taxcode!=null">TaxCode,</if>
  60. <if test="faxno!=null">FaxNo,</if>
  61. <if test="phoneno!=null">PhoneNo,</if>
  62. <if test="contact!=null">Contact,</if>
  63. <if test="address!=null">Address,</if>
  64. <if test="paymentterm!=null">PaymentTerm,</if>
  65. <if test="deliveryterm!=null">DeliveryTerm,</if>
  66. <if test="buyer!=null">Buyer,</if>
  67. <if test="currency!=null">Currency,</if>
  68. <if test="suppliergroup!=null">SupplierGroup,</if>
  69. <if test="abc!=null">ABC,</if>
  70. <if test="active!=null">Active,</if>
  71. <if test="createdate!=null">CreateDate,</if>
  72. <if test="bankname!=null">BankName,</if>
  73. <if test="bankaccount!=null">BankAccount,</if>
  74. <if test="taxno!=null">TaxNo,</if>
  75. <if test="email!=null">Email,</if>
  76. <if test="memo!=null">Memo</if>
  77. </trim>
  78. VALUES
  79. <trim prefix="(" suffix=")" suffixOverrides=",">
  80. <if test="supplierid!=null">#{supplierid,jdbcType=VARCHAR},</if>
  81. <if test="site!=null">#{site,jdbcType=VARCHAR},</if>
  82. <if test="suppliername!=null">#{suppliername,jdbcType=VARCHAR},</if>
  83. <if test="taxcode!=null">#{taxcode,jdbcType=VARCHAR},</if>
  84. <if test="faxno!=null">#{faxno,jdbcType=VARCHAR},</if>
  85. <if test="phoneno!=null">#{phoneno,jdbcType=VARCHAR},</if>
  86. <if test="contact!=null">#{contact,jdbcType=VARCHAR},</if>
  87. <if test="address!=null">#{address,jdbcType=VARCHAR},</if>
  88. <if test="paymentterm!=null">#{paymentterm,jdbcType=VARCHAR},</if>
  89. <if test="deliveryterm!=null">#{deliveryterm,jdbcType=VARCHAR},</if>
  90. <if test="buyer!=null">#{buyer,jdbcType=VARCHAR},</if>
  91. <if test="currency!=null">#{currency,jdbcType=VARCHAR},</if>
  92. <if test="suppliergroup!=null">#{suppliergroup,jdbcType=VARCHAR},</if>
  93. <if test="abc!=null">#{abc,jdbcType=CHAR},</if>
  94. <if test="active!=null">#{active,jdbcType=CHAR},</if>
  95. <if test="createdate!=null">#{createdate,jdbcType=TIMESTAMP},</if>
  96. <if test="bankname!=null">#{bankname,jdbcType=VARCHAR},</if>
  97. <if test="bankaccount!=null">#{bankaccount,jdbcType=VARCHAR},</if>
  98. <if test="taxno!=null">#{taxno,jdbcType=VARCHAR},</if>
  99. <if test="email!=null">#{email,jdbcType=VARCHAR},</if>
  100. <if test="memo!=null">#{memo,jdbcType=VARCHAR}</if>
  101. </trim>
  102. </insert>
  103. <delete id="deleteSupplier">
  104. <!--@mbg.generated-->
  105. delete from Supplier
  106. <where>
  107. <if test="site != null">
  108. and Site=#{site,jdbcType=VARCHAR}
  109. </if>
  110. <if test="supplierid != null">
  111. and SupplierID=#{supplierid,jdbcType=VARCHAR}
  112. </if>
  113. </where>
  114. </delete>
  115. <update id="updateSupplier">
  116. <!--@mbg.generated-->
  117. update Supplier
  118. <set>
  119. <if test="suppliername != null">
  120. SupplierName = #{suppliername,jdbcType=VARCHAR},
  121. </if>
  122. <if test="taxcode != null">
  123. TaxCode = #{taxcode,jdbcType=VARCHAR},
  124. </if>
  125. <if test="faxno != null">
  126. FaxNo = #{faxno,jdbcType=VARCHAR},
  127. </if>
  128. <if test="phoneno != null">
  129. PhoneNo = #{phoneno,jdbcType=VARCHAR},
  130. </if>
  131. <if test="contact != null">
  132. Contact = #{contact,jdbcType=VARCHAR},
  133. </if>
  134. <if test="address != null">
  135. Address = #{address,jdbcType=VARCHAR},
  136. </if>
  137. <if test="paymentterm != null">
  138. PaymentTerm = #{paymentterm,jdbcType=VARCHAR},
  139. </if>
  140. <if test="deliveryterm != null">
  141. DeliveryTerm = #{deliveryterm,jdbcType=VARCHAR},
  142. </if>
  143. <if test="buyer != null">
  144. Buyer = #{buyer,jdbcType=VARCHAR},
  145. </if>
  146. <if test="currency != null">
  147. Currency = #{currency,jdbcType=VARCHAR},
  148. </if>
  149. <if test="suppliergroup != null">
  150. SupplierGroup = #{suppliergroup,jdbcType=VARCHAR},
  151. </if>
  152. <if test="abc != null">
  153. ABC = #{abc,jdbcType=CHAR},
  154. </if>
  155. <if test="active != null">
  156. Active = #{active,jdbcType=CHAR},
  157. </if>
  158. <if test="createdate != null">
  159. CreateDate = #{createdate,jdbcType=TIMESTAMP},
  160. </if>
  161. <if test="bankname != null">
  162. BankName = #{bankname,jdbcType=VARCHAR},
  163. </if>
  164. <if test="bankaccount != null">
  165. BankAccount = #{bankaccount,jdbcType=VARCHAR},
  166. </if>
  167. <if test="taxno != null">
  168. TaxNo = #{taxno,jdbcType=VARCHAR},
  169. </if>
  170. <if test="email != null">
  171. Email = #{email,jdbcType=VARCHAR},
  172. </if>
  173. <if test="memo != null">
  174. Memo = #{memo,jdbcType=VARCHAR},
  175. </if>
  176. </set>
  177. <where>
  178. <if test="site != null">
  179. and Site=#{site,jdbcType=VARCHAR}
  180. </if>
  181. <if test="supplierid != null">
  182. and SupplierID=#{supplierid,jdbcType=VARCHAR}
  183. </if>
  184. </where>
  185. </update>
  186. <select id="getViewSupplierList" resultMap="BaseResultMap">
  187. select * from view_supplier
  188. </select>
  189. <select id="getSupplier" resultType="com.gaotao.modules.base.entity.SupplierData">
  190. Select SupplierID,SupplierName,Active,Site from Supplier
  191. Where site = #{site} and SupplierID = #{supplierId}
  192. </select>
  193. </mapper>