BizWaybillCostDetailsMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.logistics.mapper.BizWaybillCostDetailsMapper">
  6. <resultMap type="com.ruoyi.logistics.domain.BizWaybillCostDetails" id="BizWaybillCostDetailsResult">
  7. <result property="waybillDetailId" column="waybill_detail_id" />
  8. <result property="waybillId" column="waybill_id" />
  9. <result property="externalWaybillNo" column="external_waybill_no" />
  10. <result property="feeItemCode" column="fee_item_code" />
  11. <result property="feeItemName" column="fee_item_name" />
  12. <result property="feeName" column="fee_name" />
  13. <result property="amount" column="amount" />
  14. <result property="rateAmount" column="rate_amount" />
  15. <result property="adjustAmount" column="adjust_amount" />
  16. <result property="remark" column="remark" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="deptId" column="dept_id" />
  20. <result property="userId" column="user_id" />
  21. <result property="delFlag" column="del_flag" />
  22. <result property="createBy" column="create_by" />
  23. <result property="updateBy" column="update_by" />
  24. </resultMap>
  25. <sql id="selectBizWaybillCostDetailsVo">
  26. select waybill_detail_id, waybill_id, external_waybill_no, fee_item_code, fee_item_name, fee_name, amount, rate_amount, adjust_amount, remark, create_time, update_time, dept_id, user_id, del_flag, create_by, update_by from biz_waybill_cost_details
  27. </sql>
  28. <select id="selectBizWaybillCostDetailsList" parameterType="com.ruoyi.logistics.domain.BizWaybillCostDetails" resultMap="BizWaybillCostDetailsResult">
  29. <include refid="selectBizWaybillCostDetailsVo"/>
  30. <where>
  31. <if test="waybillId != null "> and waybill_id = #{waybillId}</if>
  32. <if test="externalWaybillNo != null and externalWaybillNo != ''"> and external_waybill_no = #{externalWaybillNo}</if>
  33. <if test="feeItemCode != null and feeItemCode != ''"> and fee_item_code = #{feeItemCode}</if>
  34. <if test="feeItemName != null and feeItemName != ''"> and fee_item_name like concat('%', #{feeItemName}, '%')</if>
  35. <if test="feeName != null and feeName != ''"> and fee_name like concat('%', #{feeName}, '%')</if>
  36. <if test="amount != null "> and amount = #{amount}</if>
  37. <if test="rateAmount != null "> and rate_amount = #{rateAmount}</if>
  38. <if test="adjustAmount != null "> and adjust_amount = #{adjustAmount}</if>
  39. <if test="deptId != null "> and dept_id = #{deptId}</if>
  40. <if test="userId != null "> and user_id = #{userId}</if>
  41. </where>
  42. </select>
  43. <select id="selectBizWaybillCostDetailsByWaybillDetailId" parameterType="Long" resultMap="BizWaybillCostDetailsResult">
  44. <include refid="selectBizWaybillCostDetailsVo"/>
  45. where waybill_detail_id = #{waybillDetailId}
  46. </select>
  47. <insert id="insertBizWaybillCostDetails" parameterType="com.ruoyi.logistics.domain.BizWaybillCostDetails" useGeneratedKeys="true" keyProperty="waybillDetailId">
  48. insert into biz_waybill_cost_details
  49. <trim prefix="(" suffix=")" suffixOverrides=",">
  50. <if test="waybillId != null">waybill_id,</if>
  51. <if test="externalWaybillNo != null">external_waybill_no,</if>
  52. <if test="feeItemCode != null">fee_item_code,</if>
  53. <if test="feeItemName != null">fee_item_name,</if>
  54. <if test="feeName != null">fee_name,</if>
  55. <if test="amount != null">amount,</if>
  56. <if test="rateAmount != null">rate_amount,</if>
  57. <if test="adjustAmount != null">adjust_amount,</if>
  58. <if test="remark != null">remark,</if>
  59. <if test="createTime != null">create_time,</if>
  60. <if test="updateTime != null">update_time,</if>
  61. <if test="deptId != null">dept_id,</if>
  62. <if test="userId != null">user_id,</if>
  63. <if test="delFlag != null">del_flag,</if>
  64. <if test="createBy != null">create_by,</if>
  65. <if test="updateBy != null">update_by,</if>
  66. </trim>
  67. <trim prefix="values (" suffix=")" suffixOverrides=",">
  68. <if test="waybillId != null">#{waybillId},</if>
  69. <if test="externalWaybillNo != null">#{externalWaybillNo},</if>
  70. <if test="feeItemCode != null">#{feeItemCode},</if>
  71. <if test="feeItemName != null">#{feeItemName},</if>
  72. <if test="feeName != null">#{feeName},</if>
  73. <if test="amount != null">#{amount},</if>
  74. <if test="rateAmount != null">#{rateAmount},</if>
  75. <if test="adjustAmount != null">#{adjustAmount},</if>
  76. <if test="remark != null">#{remark},</if>
  77. <if test="createTime != null">#{createTime},</if>
  78. <if test="updateTime != null">#{updateTime},</if>
  79. <if test="deptId != null">#{deptId},</if>
  80. <if test="userId != null">#{userId},</if>
  81. <if test="delFlag != null">#{delFlag},</if>
  82. <if test="createBy != null">#{createBy},</if>
  83. <if test="updateBy != null">#{updateBy},</if>
  84. </trim>
  85. </insert>
  86. <update id="updateBizWaybillCostDetails" parameterType="com.ruoyi.logistics.domain.BizWaybillCostDetails">
  87. update biz_waybill_cost_details
  88. <trim prefix="SET" suffixOverrides=",">
  89. <if test="waybillId != null">waybill_id = #{waybillId},</if>
  90. <if test="externalWaybillNo != null">external_waybill_no = #{externalWaybillNo},</if>
  91. <if test="feeItemCode != null">fee_item_code = #{feeItemCode},</if>
  92. <if test="feeItemName != null">fee_item_name = #{feeItemName},</if>
  93. <if test="feeName != null">fee_name = #{feeName},</if>
  94. <if test="amount != null">amount = #{amount},</if>
  95. <if test="rateAmount != null">rate_amount = #{rateAmount},</if>
  96. <if test="adjustAmount != null">adjust_amount = #{adjustAmount},</if>
  97. <if test="remark != null">remark = #{remark},</if>
  98. <if test="createTime != null">create_time = #{createTime},</if>
  99. <if test="updateTime != null">update_time = #{updateTime},</if>
  100. <if test="deptId != null">dept_id = #{deptId},</if>
  101. <if test="userId != null">user_id = #{userId},</if>
  102. <if test="delFlag != null">del_flag = #{delFlag},</if>
  103. <if test="createBy != null">create_by = #{createBy},</if>
  104. <if test="updateBy != null">update_by = #{updateBy},</if>
  105. </trim>
  106. where waybill_detail_id = #{waybillDetailId}
  107. </update>
  108. <delete id="deleteBizWaybillCostDetailsByWaybillDetailId" parameterType="Long">
  109. delete from biz_waybill_cost_details where waybill_detail_id = #{waybillDetailId}
  110. </delete>
  111. <delete id="deleteBizWaybillCostDetailsByWaybillDetailIds" parameterType="String">
  112. delete from biz_waybill_cost_details where waybill_detail_id in
  113. <foreach item="waybillDetailId" collection="array" open="(" separator="," close=")">
  114. #{waybillDetailId}
  115. </foreach>
  116. </delete>
  117. </mapper>