西藏巴青项目

BizSupplierMapper.xml 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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.ruoyi.web.modules.trading.mapper.BizSupplierMapper">
  4. <resultMap type="com.ruoyi.web.modules.trading.domain.BizSupplier" id="BizSupplierResult">
  5. <id property="id" column="id"/>
  6. <result property="supplierCode" column="supplier_code"/>
  7. <result property="supplierName" column="supplier_name"/>
  8. <result property="supplierType" column="supplier_type"/>
  9. <result property="identityNo" column="identity_no"/>
  10. <result property="contactPhone" column="contact_phone"/>
  11. <result property="businessLocation" column="business_location"/>
  12. <result property="vehiclePlatesJson" column="vehicle_plates"/>
  13. <result property="feeMethod" column="fee_method"/>
  14. <result property="feeStandard" column="fee_standard"/>
  15. <result property="transactionFeeRate" column="transaction_fee_rate"/>
  16. <result property="managementFeeRate" column="management_fee_rate"/>
  17. <result property="accountAssigned" column="account_assigned"/>
  18. <result property="sysUserId" column="sys_user_id"/>
  19. <result property="assignedLoginName" column="assigned_login_name"/>
  20. <result property="delFlag" column="del_flag"/>
  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="remark" column="remark"/>
  26. </resultMap>
  27. <sql id="selectVo">
  28. select id, supplier_code, supplier_name, supplier_type, identity_no, contact_phone,
  29. business_location, vehicle_plates, fee_method, fee_standard,
  30. transaction_fee_rate, management_fee_rate,
  31. account_assigned, sys_user_id, assigned_login_name, del_flag,
  32. create_by, create_time, update_by, update_time, remark
  33. from biz_supplier
  34. </sql>
  35. <select id="selectBizSupplierById" parameterType="long" resultMap="BizSupplierResult">
  36. <include refid="selectVo"/>
  37. where id = #{id} and del_flag = '0'
  38. </select>
  39. <select id="selectBizSupplierByIdAny" parameterType="long" resultMap="BizSupplierResult">
  40. <include refid="selectVo"/>
  41. where id = #{id}
  42. </select>
  43. <select id="selectBizSupplierBySysUserId" parameterType="long" resultMap="BizSupplierResult">
  44. <include refid="selectVo"/>
  45. where sys_user_id = #{sysUserId} and del_flag = '0'
  46. limit 1
  47. </select>
  48. <select id="selectMaxSupplierCodeForUpdate" resultType="string">
  49. select max(supplier_code) from biz_supplier for update
  50. </select>
  51. <select id="countBizSupplierByNameExcludeId" resultType="int">
  52. select count(1) from biz_supplier
  53. where del_flag = '0' and supplier_name = #{supplierName}
  54. <if test="excludeId != null">
  55. and id != #{excludeId}
  56. </if>
  57. </select>
  58. <select id="countBizSupplierByIdentityNoExcludeId" resultType="int">
  59. select count(1) from biz_supplier
  60. where del_flag = '0' and identity_no = #{identityNo}
  61. <if test="excludeId != null">
  62. and id != #{excludeId}
  63. </if>
  64. </select>
  65. <select id="selectBizSupplierList" parameterType="com.ruoyi.web.modules.trading.domain.BizSupplier" resultMap="BizSupplierResult">
  66. <include refid="selectVo"/>
  67. <where>
  68. del_flag = '0'
  69. <if test="supplierCode != null and supplierCode != ''">
  70. and supplier_code = #{supplierCode}
  71. </if>
  72. <if test="supplierName != null and supplierName != ''">
  73. and supplier_name = #{supplierName}
  74. </if>
  75. </where>
  76. order by supplier_code asc, id asc
  77. </select>
  78. <insert id="insertBizSupplier" parameterType="com.ruoyi.web.modules.trading.domain.BizSupplier" useGeneratedKeys="true" keyProperty="id">
  79. insert into biz_supplier (
  80. supplier_code, supplier_name, supplier_type, identity_no, contact_phone,
  81. business_location, vehicle_plates, fee_method, fee_standard,
  82. transaction_fee_rate, management_fee_rate,
  83. account_assigned, sys_user_id, assigned_login_name, del_flag,
  84. create_by, create_time, remark
  85. ) values (
  86. #{supplierCode}, #{supplierName}, #{supplierType}, #{identityNo}, #{contactPhone},
  87. #{businessLocation}, #{vehiclePlatesJson}, #{feeMethod}, #{feeStandard},
  88. #{transactionFeeRate}, #{managementFeeRate},
  89. #{accountAssigned}, #{sysUserId}, #{assignedLoginName}, #{delFlag},
  90. #{createBy}, sysdate(), #{remark}
  91. )
  92. </insert>
  93. <update id="updateBizSupplier" parameterType="com.ruoyi.web.modules.trading.domain.BizSupplier">
  94. update biz_supplier set
  95. supplier_name = #{supplierName},
  96. supplier_type = #{supplierType},
  97. identity_no = #{identityNo},
  98. contact_phone = #{contactPhone},
  99. business_location = #{businessLocation},
  100. vehicle_plates = #{vehiclePlatesJson},
  101. fee_method = #{feeMethod},
  102. fee_standard = #{feeStandard},
  103. transaction_fee_rate = #{transactionFeeRate},
  104. management_fee_rate = #{managementFeeRate},
  105. account_assigned = #{accountAssigned},
  106. sys_user_id = #{sysUserId},
  107. assigned_login_name = #{assignedLoginName},
  108. update_by = #{updateBy},
  109. update_time = sysdate(),
  110. remark = #{remark}
  111. where id = #{id} and del_flag = '0'
  112. </update>
  113. <update id="logicDeleteBizSupplierByIds">
  114. update biz_supplier set del_flag = '2', update_by = #{updateBy}, update_time = sysdate()
  115. where del_flag = '0' and id in
  116. <foreach collection="ids" item="id" open="(" separator="," close=")">
  117. #{id}
  118. </foreach>
  119. </update>
  120. </mapper>