TFeeInvoiceMapper.xml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.shipping.mapper.TFeeInvoiceMapper">
  6. <resultMap type="TFeeInvoice" id="TFeeInvoiceResult">
  7. <result property="fId" column="f_id" />
  8. <result property="fPid" column="f_pid" />
  9. <result property="fFeeid" column="f_feeid" />
  10. <result property="fModel" column="f_model" />
  11. <result property="fSbu" column="f_sbu" />
  12. <result property="fNumber" column="f_number" />
  13. <result property="fUnitprice" column="f_unitprice" />
  14. <result property="fMoney" column="f_money" />
  15. <result property="fTaxrate" column="f_taxrate" />
  16. <result property="fTax" column="f_tax" />
  17. <result property="fAmount" column="f_amount" />
  18. <result property="fStatus" column="f_status" />
  19. <result property="fBillstatus" column="f_billstatus"/>
  20. <result property="createBy" column="create_by" />
  21. <result property="createTime" column="create_time" />
  22. <result property="updateBy" column="update_by" />
  23. <result property="updateTime" column="update_time" />
  24. <result property="remarks" column="remarks" />
  25. </resultMap>
  26. <sql id="selectTFeeInvoiceVo">
  27. select f_id, f_pid, f_feeid, f_model, f_sbu, f_number, f_unitprice, f_money, f_taxrate, f_tax, f_amount, f_status,f_billstatus, create_by, create_time, update_by, update_time, remarks from t_fee_invoice
  28. </sql>
  29. <select id="selectTFeeInvoiceList" parameterType="TFeeInvoice" resultMap="TFeeInvoiceResult">
  30. SELECT
  31. tf.f_id,
  32. tf.f_pid,
  33. tf.f_feeid,
  34. te.f_name fFeeName,
  35. tf.f_model,
  36. tf.f_sbu,
  37. pr.dict_label fSbuName,
  38. tf.f_number,
  39. tf.f_unitprice,
  40. tf.f_money,
  41. tf.f_taxrate,
  42. tf.f_tax,
  43. tf.f_amount,
  44. tf.f_status,
  45. tf.f_billstatus,
  46. tf.create_by,
  47. tf.create_time,
  48. tf.update_by,
  49. tf.update_time,
  50. tf.remarks
  51. FROM
  52. t_fee_invoice tf
  53. LEFT JOIN sys_dict_data pr ON pr.dict_value = tf.f_sbu AND pr.dict_type = 'data_unitfees'
  54. LEFT JOIN t_fees te ON tf.f_feeid = te.f_id
  55. <where>
  56. <if test="fPid != null "> and tf.f_pid = #{fPid}</if>
  57. <if test="fFeeid != null "> and tf.f_feeid = #{fFeeid}</if>
  58. <if test="fModel != null and fModel != ''"> and tf.f_model = #{fModel}</if>
  59. <if test="fSbu != null "> and tf.f_sbu = #{fSbu}</if>
  60. <if test="fNumber != null "> and tf.f_number = #{fNumber}</if>
  61. <if test="fUnitprice != null "> and tf.f_unitprice = #{fUnitprice}</if>
  62. <if test="fMoney != null "> and tf.f_money = #{fMoney}</if>
  63. <if test="fTaxrate != null "> and tf.f_taxrate = #{fTaxrate}</if>
  64. <if test="fTax != null "> and tf.f_tax = #{fTax}</if>
  65. <if test="fAmount != null "> and tf.f_amount = #{fAmount}</if>
  66. <if test="fStatus != null and fStatus != ''"> and tf.f_status = #{fStatus}</if>
  67. <if test="fBillstatus != null and fBillstatus != ''">and tf.f_billstatus = #{fBillstatus}</if>
  68. <if test="remarks != null and remarks != ''"> and tf.remarks = #{remarks}</if>
  69. </where>
  70. </select>
  71. <select id="selectTFeeInvoiceById" parameterType="Long" resultMap="TFeeInvoiceResult">
  72. <include refid="selectTFeeInvoiceVo"/>
  73. where f_id = #{fId}
  74. </select>
  75. <insert id="insertTFeeInvoice" parameterType="TFeeInvoice">
  76. insert into t_fee_invoice
  77. <trim prefix="(" suffix=")" suffixOverrides=",">
  78. <if test="fId != null">f_id,</if>
  79. <if test="fPid != null">f_pid,</if>
  80. <if test="fFeeid != null">f_feeid,</if>
  81. <if test="fModel != null">f_model,</if>
  82. <if test="fSbu != null">f_sbu,</if>
  83. <if test="fNumber != null">f_number,</if>
  84. <if test="fUnitprice != null">f_unitprice,</if>
  85. <if test="fMoney != null">f_money,</if>
  86. <if test="fTaxrate != null">f_taxrate,</if>
  87. <if test="fTax != null">f_tax,</if>
  88. <if test="fAmount != null">f_amount,</if>
  89. <if test="fStatus != null">f_status,</if>
  90. <if test="fBillstatus != null and fBillstatus != ''">f_billstatus,</if>
  91. <if test="createBy != null">create_by,</if>
  92. <if test="createTime != null">create_time,</if>
  93. <if test="updateBy != null">update_by,</if>
  94. <if test="updateTime != null">update_time,</if>
  95. <if test="remarks != null">remarks,</if>
  96. </trim>
  97. <trim prefix="values (" suffix=")" suffixOverrides=",">
  98. <if test="fId != null">#{fId},</if>
  99. <if test="fPid != null">#{fPid},</if>
  100. <if test="fFeeid != null">#{fFeeid},</if>
  101. <if test="fModel != null">#{fModel},</if>
  102. <if test="fSbu != null">#{fSbu},</if>
  103. <if test="fNumber != null">#{fNumber},</if>
  104. <if test="fUnitprice != null">#{fUnitprice},</if>
  105. <if test="fMoney != null">#{fMoney},</if>
  106. <if test="fTaxrate != null">#{fTaxrate},</if>
  107. <if test="fTax != null">#{fTax},</if>
  108. <if test="fAmount != null">#{fAmount},</if>
  109. <if test="fStatus != null">#{fStatus},</if>
  110. <if test="fBillstatus != null and fBillstatus != ''">#{fBillstatus},</if>
  111. <if test="createBy != null">#{createBy},</if>
  112. <if test="createTime != null">#{createTime},</if>
  113. <if test="updateBy != null">#{updateBy},</if>
  114. <if test="updateTime != null">#{updateTime},</if>
  115. <if test="remarks != null">#{remarks},</if>
  116. </trim>
  117. </insert>
  118. <update id="updateTFeeInvoice" parameterType="TFeeInvoice">
  119. update t_fee_invoice
  120. <trim prefix="SET" suffixOverrides=",">
  121. <if test="fPid != null">f_pid = #{fPid},</if>
  122. <if test="fFeeid != null">f_feeid = #{fFeeid},</if>
  123. <if test="fModel != null">f_model = #{fModel},</if>
  124. <if test="fSbu != null">f_sbu = #{fSbu},</if>
  125. <if test="fNumber != null">f_number = #{fNumber},</if>
  126. <if test="fUnitprice != null">f_unitprice = #{fUnitprice},</if>
  127. <if test="fMoney != null">f_money = #{fMoney},</if>
  128. <if test="fTaxrate != null">f_taxrate = #{fTaxrate},</if>
  129. <if test="fTax != null">f_tax = #{fTax},</if>
  130. <if test="fAmount != null">f_amount = #{fAmount},</if>
  131. <if test="fStatus != null">f_status = #{fStatus},</if>
  132. <if test="fBillstatus != null and fBillstatus != ''">f_billstatus = #{fBillstatus},</if>
  133. <if test="createBy != null">create_by = #{createBy},</if>
  134. <if test="createTime != null">create_time = #{createTime},</if>
  135. <if test="updateBy != null">update_by = #{updateBy},</if>
  136. <if test="updateTime != null">update_time = #{updateTime},</if>
  137. <if test="remarks != null">remarks = #{remarks},</if>
  138. </trim>
  139. where f_id = #{fId}
  140. </update>
  141. <delete id="deleteTFeeInvoiceById" parameterType="Long">
  142. delete from t_fee_invoice where f_id = #{fId}
  143. </delete>
  144. <delete id="deleteTFeeInvoiceByIds" parameterType="String">
  145. delete from t_fee_invoice where f_id in
  146. <foreach item="fId" collection="array" open="(" separator="," close=")">
  147. #{fId}
  148. </foreach>
  149. </delete>
  150. <delete id="deleteByFPid" parameterType="Long">
  151. delete from t_fee_invoice where f_pid = #{fId}
  152. </delete>
  153. <update id="tFeeInvoiceUpdate" parameterType="Long">
  154. update
  155. t_fee_invoice
  156. set f_billstatus = #{fettle}
  157. where
  158. f_pid = #{fPid}
  159. </update>
  160. </mapper>