综合办公系统
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

CmcBudgetSettleMapper.xml 6.7KB

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.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="checkPriceId" column="check_price_id" />
  11. <result property="content" column="content" />
  12. <result property="workload" column="workload" />
  13. <result property="coefficient" column="coefficient" />
  14. <result property="groundType" column="ground_type" />
  15. <result property="settle" column="settle" />
  16. <result property="remark" column="remark" />
  17. <association property="cmcPrice" javaType="CmcPrice" resultMap="CmcPriceResult" />
  18. <association property="cmcCheckPrice" javaType="CmcCheckPrice" resultMap="CmcCheckPriceResult" />
  19. </resultMap>
  20. <resultMap type="CmcPrice" id="CmcPriceResult">
  21. <result property="id" column="id" />
  22. <result property="workType" column="work_type" />
  23. <result property="workItem" column="work_item" />
  24. <result property="subItem" column="sub_item" />
  25. <result property="scaleGrade" column="scale_grade" />
  26. <result property="unit" column="unit" />
  27. <result property="commonPrice" column="common_price" />
  28. <result property="complexPrice" column="complex_price" />
  29. </resultMap>
  30. <resultMap type="CmcCheckPrice" id="CmcCheckPriceResult">
  31. <result property="id" column="id" />
  32. <result property="workType" column="check_work_type" />
  33. <result property="workItem" column="check_work_item" />
  34. <result property="subItem" column="check_sub_item" />
  35. <result property="scaleGrade" column="check_scale_grade" />
  36. <result property="unit" column="check_unit" />
  37. <result property="commonPrice" column="check_common_price" />
  38. <result property="complexPrice" column="check_complex_price" />
  39. <result property="remark" column="check_remark" />
  40. </resultMap>
  41. <sql id="selectCmcBudgetSettleVo">
  42. select bs.budget_settle_id, bs.budget_id, bs.content, bs.price_id, bs.check_price_id, p.work_type, p.work_item, p.sub_item, p.scale_grade, p.unit,
  43. p.common_price, p.complex_price, cp.work_type as check_work_type, cp.work_item as check_work_item, cp.sub_item as check_sub_item, cp.scale_grade as check_scale_grade,
  44. cp.unit as check_unit, cp.common_price as check_common_price, cp.complex_price as check_complex_price, cp.remark as check_remark, bs.workload, bs.coefficient,
  45. bs.ground_type, bs.settle , bs.remark from cmc_budget_settle as bs
  46. left join cmc_price as p on p.id = bs.price_id
  47. left join cmc_check_price as cp on cp.id = bs.check_price_id
  48. </sql>
  49. <select id="selectCmcBudgetSettleList" parameterType="CmcBudgetSettle" resultMap="CmcBudgetSettleResult">
  50. <include refid="selectCmcBudgetSettleVo"/>
  51. <where>
  52. <if test="budgetId != null and budgetId != ''"> and bs.budget_id = #{budgetId}</if>
  53. <if test="priceId != null "> and bs.price_id = #{priceId}</if>
  54. <if test="workload != null "> and bs.workload = #{workload}</if>
  55. <if test="coefficient != null "> and bs.coefficient = #{coefficient}</if>
  56. <if test="groundType != null and groundType != ''"> and bs.ground_type = #{groundType}</if>
  57. <if test="settle != null "> and bs.settle = #{settle}</if>
  58. </where>
  59. </select>
  60. <select id="selectCmcBudgetSettleByBudgetId" parameterType="String" resultMap="CmcBudgetSettleResult">
  61. <include refid="selectCmcBudgetSettleVo"/>
  62. where bs.budget_id = #{budgetId}
  63. </select>
  64. <insert id="insertCmcBudgetSettle" parameterType="CmcBudgetSettle">
  65. insert into cmc_budget_settle
  66. <trim prefix="(" suffix=")" suffixOverrides=",">
  67. <if test="budgetSettleId != null">budget_settle_id,</if>
  68. <if test="budgetId != null">budget_id,</if>
  69. <if test="content != null">content,</if>
  70. <if test="priceId != null">price_id,</if>
  71. <if test="checkPriceId != null">check_price_id,</if>
  72. <if test="workload != null">workload,</if>
  73. <if test="coefficient != null">coefficient,</if>
  74. <if test="groundType != null">ground_type,</if>
  75. <if test="settle != null">settle,</if>
  76. <if test="remark != null">remark,</if>
  77. </trim>
  78. <trim prefix="values (" suffix=")" suffixOverrides=",">
  79. <if test="budgetSettleId != null">#{budgetSettleId},</if>
  80. <if test="budgetId != null">#{budgetId},</if>
  81. <if test="content != null">#{content},</if>
  82. <if test="priceId != null">#{priceId},</if>
  83. <if test="checkPriceId != null">#{checkPriceId},</if>
  84. <if test="workload != null">#{workload},</if>
  85. <if test="coefficient != null">#{coefficient},</if>
  86. <if test="groundType != null">#{groundType},</if>
  87. <if test="settle != null">#{settle},</if>
  88. <if test="remark != null">#{remark},</if>
  89. </trim>
  90. </insert>
  91. <update id="updateCmcBudgetSettle" parameterType="CmcBudgetSettle">
  92. update cmc_budget_settle
  93. <trim prefix="SET" suffixOverrides=",">
  94. <if test="budgetId != null">budget_id = #{budgetId},</if>
  95. <if test="content != null">content = #{content},</if>
  96. <if test="priceId != null">price_id = #{priceId},</if>
  97. <if test="checkPriceId != null">check_price_id = #{checkPriceId},</if>
  98. <if test="workload != null">workload = #{workload},</if>
  99. <if test="coefficient != null">coefficient = #{coefficient},</if>
  100. <if test="groundType != null">ground_type = #{groundType},</if>
  101. <if test="settle != null">settle = #{settle},</if>
  102. <if test="remark != null">remark = #{remark},</if>
  103. </trim>
  104. where budget_settle_id = #{budgetSettleId}
  105. </update>
  106. <delete id="deleteCmcBudgetSettleByBudgetId" parameterType="String">
  107. delete from cmc_budget_settle where budget_id = #{budgetId}
  108. </delete>
  109. <delete id="deleteCmcBudgetSettleByBudgetIds" parameterType="String">
  110. delete from cmc_budget_settle where budget_id in
  111. <foreach item="budgetId" collection="array" open="(" separator="," close=")">
  112. #{budgetId}
  113. </foreach>
  114. </delete>
  115. </mapper>