综合办公系统
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.

CmcBorrowDetailMapper.xml 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.oa.mapper.CmcBorrowDetailMapper">
  6. <resultMap type="CmcBorrowDetail" id="CmcBorrowDetailResult">
  7. <result property="borrowDetailId" column="borrow_detail_id" />
  8. <result property="borrowId" column="borrow_id" />
  9. <result property="borrowItem" column="borrow_item" />
  10. <result property="unit" column="unit" />
  11. <result property="price" column="price" />
  12. <result property="quantity" column="quantity" />
  13. <result property="applyAmount" column="apply_amount" />
  14. <result property="xmAmount" column="xm_amount" />
  15. <result property="managerAmount" column="manager_amount" />
  16. </resultMap>
  17. <sql id="selectCmcBorrowDetailVo">
  18. select borrow_detail_id, borrow_id, borrow_item, unit, price, quantity, apply_amount, xm_amount, manager_amount from cmc_borrow_detail
  19. </sql>
  20. <select id="selectCmcBorrowDetailList" parameterType="CmcBorrowDetail" resultMap="CmcBorrowDetailResult">
  21. <include refid="selectCmcBorrowDetailVo"/>
  22. <where>
  23. <if test="borrowId != null and borrowId != ''"> and borrow_id = #{borrowId}</if>
  24. <if test="borrowItem != null and borrowItem != ''"> and borrow_item = #{borrowItem}</if>
  25. <if test="unit != null and unit != ''"> and unit = #{unit}</if>
  26. <if test="price != null "> and price = #{price}</if>
  27. <if test="quantity != null "> and quantity = #{quantity}</if>
  28. <if test="applyAmount != null "> and apply_amount = #{applyAmount}</if>
  29. <if test="xmAmount != null "> and xm_amount = #{xmAmount}</if>
  30. <if test="managerAmount != null "> and manager_amount = #{managerAmount}</if>
  31. </where>
  32. </select>
  33. <select id="selectCmcBorrowDetailByBorrowId" parameterType="String" resultMap="CmcBorrowDetailResult">
  34. <include refid="selectCmcBorrowDetailVo"/>
  35. where borrow_id = #{borrowId}
  36. </select>
  37. <insert id="insertCmcBorrowDetail" parameterType="CmcBorrowDetail">
  38. insert into cmc_borrow_detail
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="borrowDetailId != null">borrow_detail_id,</if>
  41. <if test="borrowId != null">borrow_id,</if>
  42. <if test="borrowItem != null">borrow_item,</if>
  43. <if test="unit != null">unit,</if>
  44. <if test="price != null">price,</if>
  45. <if test="quantity != null">quantity,</if>
  46. <if test="applyAmount != null">apply_amount,</if>
  47. <if test="xmAmount != null">xm_amount,</if>
  48. <if test="managerAmount != null">manager_amount,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="borrowDetailId != null">#{borrowDetailId},</if>
  52. <if test="borrowId != null">#{borrowId},</if>
  53. <if test="borrowItem != null">#{borrowItem},</if>
  54. <if test="unit != null">#{unit},</if>
  55. <if test="price != null">#{price},</if>
  56. <if test="quantity != null">#{quantity},</if>
  57. <if test="applyAmount != null">#{applyAmount},</if>
  58. <if test="xmAmount != null">#{xmAmount},</if>
  59. <if test="managerAmount != null">#{managerAmount},</if>
  60. </trim>
  61. </insert>
  62. <update id="updateCmcBorrowDetail" parameterType="CmcBorrowDetail">
  63. update cmc_borrow_detail
  64. <trim prefix="SET" suffixOverrides=",">
  65. <if test="borrowId != null">borrow_id = #{borrowId},</if>
  66. <if test="borrowItem != null">borrow_item = #{borrowItem},</if>
  67. <if test="unit != null">unit = #{unit},</if>
  68. <if test="price != null">price = #{price},</if>
  69. <if test="quantity != null">quantity = #{quantity},</if>
  70. <if test="applyAmount != null">apply_amount = #{applyAmount},</if>
  71. <if test="xmAmount != null">xm_amount = #{xmAmount},</if>
  72. <if test="managerAmount != null">manager_amount = #{managerAmount},</if>
  73. </trim>
  74. where borrow_detail_id = #{borrowDetailId}
  75. </update>
  76. <delete id="deleteCmcBorrowDetailByBorrowId" parameterType="String">
  77. delete from cmc_borrow_detail where borrow_id = #{borrowId}
  78. </delete>
  79. <delete id="deleteCmcBorrowDetailByBorrowIds" parameterType="String">
  80. delete from cmc_borrow_detail where borrow_id in
  81. <foreach item="borrowId" collection="array" open="(" separator="," close=")">
  82. #{borrowId}
  83. </foreach>
  84. </delete>
  85. </mapper>