综合办公系统
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

CmcBudgetSettleMapper.xml 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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.CmcBudgetSettleMapper">
  6. <resultMap type="CmcBudgetSettle" id="CmcBudgetSettleResult">
  7. <result property="budgetSettleId" column="budget_settle_id" />
  8. <result property="budgetId" column="budget_id" />
  9. <result property="priceId" column="price_id" />
  10. <result property="workload" column="workload" />
  11. <result property="coefficient" column="coefficient" />
  12. <result property="groundType" column="ground_type" />
  13. <result property="settle" column="settle" />
  14. <association property="cmcPrice" javaType="CmcPrice" resultMap="CmcPriceResult" />
  15. </resultMap>
  16. <resultMap type="CmcPrice" id="CmcPriceResult">
  17. <result property="id" column="id" />
  18. <result property="workType" column="work_type" />
  19. <result property="workItem" column="work_item" />
  20. <result property="subItem" column="sub_item" />
  21. <result property="scaleGrade" column="scale_grade" />
  22. <result property="unit" column="unit" />
  23. <result property="commonPrice" column="common_price" />
  24. <result property="complexPrice" column="complex_price" />
  25. </resultMap>
  26. <sql id="selectCmcBudgetSettleVo">
  27. select bs.budget_settle_id, bs.budget_id, bs.price_id, p.work_type, p.work_item, p.sub_item, p.scale_grade, p.unit, p.common_price, p.complex_price, bs.workload, bs.coefficient, bs.ground_type, bs.settle from cmc_budget_settle as bs
  28. left join cmc_price as p on p.id = bs.price_id
  29. </sql>
  30. <select id="selectCmcBudgetSettleList" parameterType="CmcBudgetSettle" resultMap="CmcBudgetSettleResult">
  31. <include refid="selectCmcBudgetSettleVo"/>
  32. <where>
  33. <if test="budgetId != null and budgetId != ''"> and bs.budget_id = #{budgetId}</if>
  34. <if test="priceId != null "> and bs.price_id = #{priceId}</if>
  35. <if test="workload != null "> and bs.workload = #{workload}</if>
  36. <if test="coefficient != null "> and bs.coefficient = #{coefficient}</if>
  37. <if test="groundType != null and groundType != ''"> and bs.ground_type = #{groundType}</if>
  38. <if test="settle != null "> and bs.settle = #{settle}</if>
  39. </where>
  40. </select>
  41. <select id="selectCmcBudgetSettleByBudgetId" parameterType="String" resultMap="CmcBudgetSettleResult">
  42. <include refid="selectCmcBudgetSettleVo"/>
  43. where bs.budget_id = #{budgetId}
  44. </select>
  45. <insert id="insertCmcBudgetSettle" parameterType="CmcBudgetSettle">
  46. insert into cmc_budget_settle
  47. <trim prefix="(" suffix=")" suffixOverrides=",">
  48. <if test="budgetSettleId != null">budget_settle_id,</if>
  49. <if test="budgetId != null">budget_id,</if>
  50. <if test="priceId != null">price_id,</if>
  51. <if test="workload != null">workload,</if>
  52. <if test="coefficient != null">coefficient,</if>
  53. <if test="groundType != null">ground_type,</if>
  54. <if test="settle != null">settle,</if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="budgetSettleId != null">#{budgetSettleId},</if>
  58. <if test="budgetId != null">#{budgetId},</if>
  59. <if test="priceId != null">#{priceId},</if>
  60. <if test="workload != null">#{workload},</if>
  61. <if test="coefficient != null">#{coefficient},</if>
  62. <if test="groundType != null">#{groundType},</if>
  63. <if test="settle != null">#{settle},</if>
  64. </trim>
  65. </insert>
  66. <update id="updateCmcBudgetSettle" parameterType="CmcBudgetSettle">
  67. update cmc_budget_settle
  68. <trim prefix="SET" suffixOverrides=",">
  69. <if test="budgetId != null">budget_id = #{budgetId},</if>
  70. <if test="priceId != null">price_id = #{priceId},</if>
  71. <if test="workload != null">workload = #{workload},</if>
  72. <if test="coefficient != null">coefficient = #{coefficient},</if>
  73. <if test="groundType != null">ground_type = #{groundType},</if>
  74. <if test="settle != null">settle = #{settle},</if>
  75. </trim>
  76. where budget_settle_id = #{budgetSettleId}
  77. </update>
  78. <delete id="deleteCmcBudgetSettleByBudgetSettleId" parameterType="String">
  79. delete from cmc_budget_settle where budget_settle_id = #{budgetSettleId}
  80. </delete>
  81. <delete id="deleteCmcBudgetSettleByBudgetSettleIds" parameterType="String">
  82. delete from cmc_budget_settle where budget_settle_id in
  83. <foreach item="budgetSettleId" collection="array" open="(" separator="," close=")">
  84. #{budgetSettleId}
  85. </foreach>
  86. </delete>
  87. </mapper>